GENie
GENie copied to clipboard
Error linking projects on MacOSX in release
Adding "-Wl, -x" around here: https://github.com/bkaradzic/genie/blob/master/src/tools/gcc.lua#L147
Causes macOSX to give the error described here:
http://stackoverflow.com/questions/22689492/cant-link-other-projects-in-my-solution-with-premake
ld: internal error: atom not found in symbolIndex(__ZNKSt3__115basic_stringbufIcNS_11char_traitsIcEENS_9allocatorIcEEE3strEv) for architecture i386 clang: error: linker command failed with exit code 1 (use -v to see invocation) make[1]: *** [../bin/examples_main.cc] Error 1
Removing those flags makes the project to work perfectly.
I can't reproduce this issue on OSX. Can you try reproducing this issue with bgfx or bx repo? Or create minimal project that causes issue and then I'll be able to figure out what's going on.
This is the minimal genie.lua that reproduces the error on MacOSX, with the gmake backend as solution type:
solution "test"
configurations{"debug", "release"}
language("C++")
platforms {"x32"}
location "build"
project "lib"
kind("StaticLib")
files { "lib.cc" }
project "test"
kind("ConsoleApp")
files { "main.cc" }
links { "lib" }
Basically is a static library with an example that uses it.
The code
// lib.h file
void DoSomething(const std::string &str);
//lib.cc file
#include <iostream>
#include "lib.h"
void DoSomething(const std::string& str) {
std::cout << str << std::endl;
}
// main.cc file
#include "lib.h"
int main(int, char**) {
DoSomething("Hello World");
}