Select to view content in your preferred language

Problems building on the Mac

3148
4
09-18-2013 12:57 PM
DouglasRand
Emerging Contributor
I have a library that I can build successfully on Linux and Windows. I cannot build it on the Mac, I get linkage issues. To debug I setup a simpler test case using a sample, "Sample Editing" from the demos. I link that with the two dylib libraries. This is all with the 64 bit version of the API. I get the output I've appended. I'm sure it isn't library ordering (I tried changing that) and I'm sure the libraries are being used as it got much worse removing the FileGDBAPI library. I'm perplexed and could use a hint.

Anybody selling vowels to solve the puzzle?

Thanks,
Doug

----------------------------------------------------------------------------------------

(null): "FileGDBAPI::Geodatabase::OpenTable(std::__1::basic_string<wchar_t, std::__1::char_traits<wchar_t>, std::__1::allocator<wchar_t> > const&, FileGDBAPI::Table&)", referenced from:

(null): _main in main.o

(null): "FileGDBAPI::OpenGeodatabase(std::__1::basic_string<wchar_t, std::__1::char_traits<wchar_t>, std::__1::allocator<wchar_t> > const&, FileGDBAPI::Geodatabase&)", referenced from:

(null): _main in main.o

(null): "FileGDBAPI::Row::SetInteger(std::__1::basic_string<wchar_t, std::__1::char_traits<wchar_t>, std::__1::allocator<wchar_t> > const&, int)", referenced from:

(null): _main in main.o

(null): "FileGDBAPI::Row::SetString(std::__1::basic_string<wchar_t, std::__1::char_traits<wchar_t>, std::__1::allocator<wchar_t> > const&, std::__1::basic_string<wchar_t, std::__1::char_traits<wchar_t>, std::__1::allocator<wchar_t> > const&)", referenced from:

(null): _main in main.o

(null): "FileGDBAPI::Table::Search(std::__1::basic_string<wchar_t, std::__1::char_traits<wchar_t>, std::__1::allocator<wchar_t> > const&, std::__1::basic_string<wchar_t, std::__1::char_traits<wchar_t>, std::__1::allocator<wchar_t> > const&, FileGDBAPI::Envelope const&, bool, FileGDBAPI::EnumRows&)", referenced from:

(null): _main in main.o

(null): "FileGDBAPI::Table::Search(std::__1::basic_string<wchar_t, std::__1::char_traits<wchar_t>, std::__1::allocator<wchar_t> > const&, std::__1::basic_string<wchar_t, std::__1::char_traits<wchar_t>, std::__1::allocator<wchar_t> > const&, bool, FileGDBAPI::EnumRows&)", referenced from:

(null): _main in main.o

(null): "FileGDBAPI::ErrorInfo::GetErrorDescription(int, std::__1::basic_string<wchar_t, std::__1::char_traits<wchar_t>, std::__1::allocator<wchar_t> >&)", referenced from:

(null): _main in main.o

(null): "FileGDBAPI::Row::IsNull(std::__1::basic_string<wchar_t, std::__1::char_traits<wchar_t>, std::__1::allocator<wchar_t> > const&, bool&) const", referenced from:

(null): _main in main.o

(null): "FileGDBAPI::Row::GetString(std::__1::basic_string<wchar_t, std::__1::char_traits<wchar_t>, std::__1::allocator<wchar_t> > const&, std::__1::basic_string<wchar_t, std::__1::char_traits<wchar_t>, std::__1::allocator<wchar_t> >&) const", referenced from:

(null): _main in main.o

(null): Symbol(s) not found for architecture x86_64

(null): Linker command failed with exit code 1 (use -v to see invocation)
0 Kudos
4 Replies
LanceShipman
Esri Regular Contributor
Is the DYLD_LIBRARY_PATH set to the location where the libraries are? If so, can you provide the link line and options used when linking.
0 Kudos
DouglasRand
Emerging Contributor
This is the fairly messy generated ld command line:

Ld /Users/drand/Library/Developer/Xcode/DerivedData/Test1-gjtnxkdiaanmrbdcogyzqchyfnqo/Build/Products/Debug/Test1 normal x86_64
    cd /Users/drand/FileGDB_API_1_3/Test1
    setenv MACOSX_DEPLOYMENT_TARGET 10.7
    /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang++ -arch x86_64 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.8.sdk -L/Users/drand/Library/Developer/Xcode/DerivedData/Test1-gjtnxkdiaanmrbdcogyzqchyfnqo/Build/Products/Debug -L/Users/drand/FileGDB_API_1_3/lib -F/Users/drand/Library/Developer/Xcode/DerivedData/Test1-gjtnxkdiaanmrbdcogyzqchyfnqo/Build/Products/Debug -filelist /Users/drand/Library/Developer/Xcode/DerivedData/Test1-gjtnxkdiaanmrbdcogyzqchyfnqo/Build/Intermediates/Test1.build/Debug/Test1.build/Objects-normal/x86_64/Test1.LinkFileList -mmacosx-version-min=10.7 -stdlib=libc++ -lFileGDBAPI -lfgdbunixrtl -o /Users/drand/Library/Developer/Xcode/DerivedData/Test1-gjtnxkdiaanmrbdcogyzqchyfnqo/Build/Products/Debug/Test1

I don't directly set the DYLD_LIBRARY_PATH. I could set that if you think it will help; I would have thought that more important at runtime? I have highlighted the appropriate -L parameter, it does seem to be including the directory that I have the libraries stored in.

Doug
0 Kudos
LanceShipman
Esri Regular Contributor
It�??s this option.
-stdlib=libc++

Change to -stdlib=libstdc++ and it should work fine.
0 Kudos
DouglasRand
Emerging Contributor
Thank you very, very much! I very much appreciate the help. I hope this thread helps someone else with the same problem.

Doug
0 Kudos