Hope someone can help. We are trying to Linux support for our native extension but we get a lot of compile errors to do with std::thread when compiling for Linux target. It compiles fine for both Windows and Mac and uses same code base for it native static library as it does for Windows and Mac.
@Mathias_Westerdahl I am trying fix Linux support for our SDK but I get the above compile errors when I try to build, do you know what I could be doing wrong?
Yeah it works in the other SDKs we use it in, I think it would say “undefined symbols” if the functions would be missing in the static library. I think it might be related to this: https://stackoverflow.com/questions/37004976/undefined-reference-to-processstd-cxx11basic-string-when-compiling-a. I have compiled the static library with GCC 5 (also tried with clang), do you also use GCC 5 on the build server for Linux builds or what compiler do you use?
Yeah, I was thinking the same, I will add some methods to the library not using STL (const char* instead of std::string) and use them instead that should solve the problem.
Btw, do you have any numbers of library size before/after the STL/noSTL? I’m guessing the library shrank?
Also, wouldn’t this be the same benefit for your other platforms? I.e. what happens when the user wants your library and another 3rd party library with STL? (this is one of the reasons why we don’t use STL in Defold )
For now I have just created an interface in our public header file with functions not using STL, we still use STL underneath the hood. But I will let you know if I totally get rid of STL in our library