i have a program that compiles using the following:
g++ -I ../../include -I . -I ../ -I ../../ -I ../ Entity.cpp Attribute.cpp main.cpp -o main.o
The Attribute.cpp includes its header file, Attribute.h, and Attribute.cpp contains all the implementations of Attribute.h.
The Entity.cpp includes the header files Entity.h and Attribute.h, since Entity.cpp uses the Attribute class.
the main.cpp file includes a header file called XML.h, that just includes both the Attribute and Entity headers.
the problem is i keep getting undefined references to functions used in main.cpp and Entity.cpp.
/tmp/ccxKUUNI.o: In function `Entity::entityString() const':
Entity.cpp:(.text+0x3b0): undefined reference to `Attribute::getValueString() const'
Entity.cpp:(.text+0x3c0): undefined reference to `Attribute::getName() const'
/tmp/ccxKUUNI.o: In function `Entity::findAttributePosition(std::basic_string, std::allocator > const&)':
Entity.cpp:(.text+0xb4e): undefined reference to `Attribute::equals(std::basic_string, std::allocator > const&) const'
/tmp/ccxKUUNI.o: In function `Entity::findAttributePositionConst(std::basic_string, std::allocator > const&) const':
Entity.cpp:(.text+0xc24): undefined reference to `Attribute::equals(std::basic_string, std::allocator > const&) const'
/tmp/ccxKUUNI.o: In function `Entity::getAttributeValueString(std::basic_string, std::allocator > const&) const':
Entity.cpp:(.text+0xe0a): undefined reference to `Attribute::getValueString() const'
/tmp/ccvaLwbi.o: In function `main':
main.cpp:(.text+0x2bc): undefined reference to `Entity::addAttribute(Attribute const&)'
main.cpp:(.text+0x359): undefined reference to `Entity::addAttribute(Attribute const&)'
main.cpp:(.text+0x4bb): undefined reference to `Entity::addAttribute(Attribute const&)'
main.cpp:(.text+0x61d): undefined reference to `Entity::addAttribute(Attribute const&)'
main.cpp:(.text+0x77f): undefined reference to `Entity::addAttribute(Attribute const&)'
/tmp/ccvaLwbi.o:main.cpp:(.text+0x8e1): more undefined references to `Entity::addAttribute(Attribute const&)' follow
/tmp/ccvaLwbi.o: In function `main':
main.cpp:(.text+0xc65): undefined reference to `Entity::addEntity(Entity const&)'
main.cpp:(.text+0xd68): undefined reference to `Entity::addAttribute(Attribute const&)'
main.cpp:(.text+0xea9): undefined reference to `Entity::addEntity(Entity const&)'
main.cpp:(.text+0xee1): undefined reference to `Entity::addEntity(Entity const&)'
main.cpp:(.text+0xf53): undefined reference to `Entity::addEntity(Entity const&)'
I know these functions are defined, because their implementations are written in the corresponding cpp files, ie. Entity.cpp and Attribute.cpp.
Thanks.
Okay, problem solved. my question wasn't descriptive enough to have the problem answered,
I was defining functions as inline in the separate cpp file, which causes the compiler to complain about undefined references. So instead I added the implementations to the header file.
Thanks.
Related
I used cmake and I was able to build a C::B project.
But Compiling the Assimp.cbp file raised a bunch of errors.
Is there someone experimented in compiling assimp with mingw64 under w10 for C::B to send me clues ?
Thks in advance.
Here are the log errors :
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/9.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: CMakeFiles\assimp_cmd.dir/objects.a(Main.cpp.obj):Main.cpp:(.text+0x8e): undefined reference to `Assimp::Importer::ValidateFlags(unsigned int) const'
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/9.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: CMakeFiles\assimp_cmd.dir/objects.a(Main.cpp.obj):Main.cpp:(.text+0xc6): undefined reference to `Assimp::Importer::ReadFile(char const*, unsigned int)'
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/9.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: CMakeFiles\assimp_cmd.dir/objects.a(Main.cpp.obj):Main.cpp:(.text+0x14e): undefined reference to `Assimp::DefaultLogger::create(char const*, Assimp::Logger::LogSeverity, unsigned int, Assimp::IOSystem*)'
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/9.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: CMakeFiles\assimp_cmd.dir/objects.a(Main.cpp.obj):Main.cpp:(.text+0x191): undefined reference to `Assimp::DefaultLogger::kill()'
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/9.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: CMakeFiles\assimp_cmd.dir/objects.a(Main.cpp.obj):Main.cpp:(.text+0x1d0): undefined reference to `Assimp::Importer::GetErrorString() const'
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/9.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: CMakeFiles\assimp_cmd.dir/objects.a(Main.cpp.obj):Main.cpp:(.text+0x2b9): undefined reference to `Assimp::Exporter::Export(aiScene const*, char const*, char const*, unsigned int, Assimp::ExportProperties const*)'
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/9.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: CMakeFiles\assimp_cmd.dir/objects.a(Main.cpp.obj):Main.cpp:(.text+0x35c): undefined reference to `Assimp::Exporter::GetErrorString() const'
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/9.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: CMakeFiles\assimp_cmd.dir/objects.a(Main.cpp.obj):Main.cpp:(.text+0x426): undefined reference to `Assimp::DefaultLogger::create(char const*, Assimp::Logger::LogSeverity, unsigned int, Assimp::IOSystem*)'
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/9.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: CMakeFiles\assimp_cmd.dir/objects.a(Main.cpp.obj):Main.cpp:(.text+0x435): undefined reference to `Assimp::DefaultLogger::kill()'
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/9.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: CMakeFiles\assimp_cmd.dir/objects.a(Main.cpp.obj):Main.cpp:(.text+0xded): undefined reference to `Assimp::Importer::ReadFile(char const*, unsigned int)'
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/9.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: CMakeFiles\assimp_cmd.dir/objects.a(Main.cpp.obj):Main.cpp:(.text+0x3b): undefined reference to `Assimp::DefaultLogger::create(char const*, Assimp::Logger::LogSeverity, unsigned int, Assimp::IOSystem*)'
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/9.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: CMakeFiles\assimp_cmd.dir/objects.a(Main.cpp.obj):Main.cpp:(.text+0x41): undefined reference to `Assimp::DefaultLogger::kill()'
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/9.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: CMakeFiles\assimp_cmd.dir/objects.a(Main.cpp.obj):Main.cpp:(.text.startup+0xb9): undefined reference to `Assimp::Importer::Importer()'
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/9.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: CMakeFiles\assimp_cmd.dir/objects.a(Main.cpp.obj):Main.cpp:(.text.startup+0xce): undefined reference to `Assimp::Importer::SetPropertyInteger(char const*, int)'
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/9.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: CMakeFiles\assimp_cmd.dir/objects.a(Main.cpp.obj):Main.cpp:(.text.startup+0xe2): undefined reference to `Assimp::Exporter::Exporter()'
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/9.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: CMakeFiles\assimp_cmd.dir/objects.a(Main.cpp.obj):Main.cpp:(.text.startup+0x17b): undefined reference to `Assimp::Importer::IsExtensionSupported(char const*) const'
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/9.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: CMakeFiles\assimp_cmd.dir/objects.a(Main.cpp.obj):Main.cpp:(.text.startup+0x1b5): undefined reference to `Assimp::Exporter::~Exporter()'
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/9.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: CMakeFiles\assimp_cmd.dir/objects.a(Main.cpp.obj):Main.cpp:(.text.startup+0x1bd): undefined reference to `Assimp::Importer::~Importer()'
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/9.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: CMakeFiles\assimp_cmd.dir/objects.a(Main.cpp.obj):Main.cpp:(.text.startup+0x202): undefined reference to `aiGetCompileFlags'
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/9.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: CMakeFiles\assimp_cmd.dir/objects.a(Main.cpp.obj):Main.cpp:(.text.startup+0x225): undefined reference to `aiGetVersionRevision'
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/9.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: CMakeFiles\assimp_cmd.dir/objects.a(Main.cpp.obj):Main.cpp:(.text.startup+0x25e): undefined reference to `aiGetVersionMinor'
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/9.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: CMakeFiles\assimp_cmd.dir/objects.a(Main.cpp.obj):Main.cpp:(.text.startup+0x265): undefined reference to `aiGetVersionMajor'
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/9.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: CMakeFiles\assimp_cmd.dir/objects.a(Main.cpp.obj):Main.cpp:(.text.startup+0x2ed): undefined reference to `Assimp::Exporter::GetExportFormatCount() const'
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/9.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: CMakeFiles\assimp_cmd.dir/objects.a(Main.cpp.obj):Main.cpp:(.text.startup+0x2ff): undefined reference to `Assimp::Exporter::GetExportFormatDescription(unsigned long long) const'
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/9.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: CMakeFiles\assimp_cmd.dir/objects.a(Main.cpp.obj):Main.cpp:(.text.startup+0x379): undefined reference to `Assimp::Exporter::GetExportFormatCount() const'
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/9.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: CMakeFiles\assimp_cmd.dir/objects.a(Main.cpp.obj):Main.cpp:(.text.startup+0x39b): undefined reference to `Assimp::Exporter::GetExportFormatDescription(unsigned long long) const'
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/9.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: CMakeFiles\assimp_cmd.dir/objects.a(Main.cpp.obj):Main.cpp:(.text.startup+0x40c): undefined reference to `Assimp::Importer::GetExtensionList(aiString&) const'
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/9.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: CMakeFiles\assimp_cmd.dir/objects.a(Main.cpp.obj):Main.cpp:(.text.startup+0x48b): undefined reference to `Assimp::Importer::ReadFile(char const*, unsigned int)'
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/9.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: CMakeFiles\assimp_cmd.dir/objects.a(Main.cpp.obj):Main.cpp:(.text.startup+0x54d): undefined reference to `Assimp::Exporter::~Exporter()'
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/9.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: CMakeFiles\assimp_cmd.dir/objects.a(Main.cpp.obj):Main.cpp:(.text.startup+0x555): undefined reference to `Assimp::Importer::~Importer()'
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/9.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: CMakeFiles\assimp_cmd.dir/objects.a(WriteDumb.cpp.obj):WriteDumb.cpp:(.text+0x2ed3): undefined reference to `aiGetVersionRevision'
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/9.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: CMakeFiles\assimp_cmd.dir/objects.a(WriteDumb.cpp.obj):WriteDumb.cpp:(.text+0x2ef6): undefined reference to `aiGetCompileFlags'
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/9.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: CMakeFiles\assimp_cmd.dir/objects.a(WriteDumb.cpp.obj):WriteDumb.cpp:(.text+0x37a2): undefined reference to `aiGetVersionRevision'
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/9.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: CMakeFiles\assimp_cmd.dir/objects.a(WriteDumb.cpp.obj):WriteDumb.cpp:(.text+0x37a9): undefined reference to `aiGetVersionMinor'
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/9.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: CMakeFiles\assimp_cmd.dir/objects.a(WriteDumb.cpp.obj):WriteDumb.cpp:(.text+0x37b0): undefined reference to `aiGetVersionMajor'
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/9.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: CMakeFiles\assimp_cmd.dir/objects.a(Info.cpp.obj):Info.cpp:(.text+0x22d2): undefined reference to `Assimp::Importer::GetMemoryRequirements(aiMemoryInfo&) const'
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/9.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: CMakeFiles\assimp_cmd.dir/objects.a(Info.cpp.obj):Info.cpp:(.text+0x2775): undefined reference to `aiGetMaterialString'
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/9.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: CMakeFiles\assimp_cmd.dir/objects.a(Info.cpp.obj):Info.cpp:(.text+0x288d): undefined reference to `aiGetMaterialString'
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/9.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: CMakeFiles\assimp_cmd.dir/objects.a(Export.cpp.obj):Export.cpp:(.text+0x1a): undefined reference to `Assimp::Exporter::GetExportFormatCount() const'
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/9.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: CMakeFiles\assimp_cmd.dir/objects.a(Export.cpp.obj):Export.cpp:(.text+0x48): undefined reference to `Assimp::Exporter::GetExportFormatDescription(unsigned long long) const'
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/9.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: CMakeFiles\assimp_cmd.dir/objects.a(Export.cpp.obj):Export.cpp:(.text+0x80): undefined reference to `Assimp::Exporter::GetExportFormatDescription(unsigned long long) const'
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/9.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: CMakeFiles\assimp_cmd.dir/objects.a(Export.cpp.obj):Export.cpp:(.text+0x7ac): undefined reference to `Assimp::Exporter::GetExportFormatCount() const'
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/9.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: CMakeFiles\assimp_cmd.dir/objects.a(Export.cpp.obj):Export.cpp:(.text+0x7e4): undefined reference to `Assimp::Exporter::GetExportFormatDescription(unsigned long long) const'
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/9.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: CMakeFiles\assimp_cmd.dir/objects.a(Export.cpp.obj):Export.cpp:(.text+0x80f): undefined reference to `Assimp::Exporter::GetExportFormatDescription(unsigned long long) const'
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/9.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: CMakeFiles\assimp_cmd.dir/objects.a(Export.cpp.obj):Export.cpp:(.text+0xabb): undefined reference to `Assimp::Exporter::GetExportFormatCount() const'
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/9.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: CMakeFiles\assimp_cmd.dir/objects.a(Export.cpp.obj):Export.cpp:(.text+0xaf4): undefined reference to `Assimp::Exporter::GetExportFormatDescription(unsigned long long) const'
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/9.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: CMakeFiles\assimp_cmd.dir/objects.a(Export.cpp.obj):Export.cpp:(.text+0x106c): undefined reference to `Assimp::Exporter::GetExportFormatCount() const'
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/9.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: CMakeFiles\assimp_cmd.dir/objects.a(Export.cpp.obj):Export.cpp:(.text+0x10a4): undefined reference to `Assimp::Exporter::GetExportFormatDescription(unsigned long long) const'
collect2.exe: error: ld returned 1 exit status
mingw32-make.exe[2]: *** [tools\assimp_cmd\CMakeFiles\assimp_cmd.dir\build.make:177: tools/assimp_cmd/assimp.exe] Error 1
Le processus s'est terminé avec le code d'état 2 (8 minute(s), 52 seconde(s))
50 erreur(s), 113 avertissement(s) (8 minute(s), 52 seconde(s))
Here's how I build it under MSYS2 with MinGW-w64:
tar xfz v5.0.0.tar.gz
cd assimp-5.0.0
# fix missing strcasecmp/strncasecmp in code/StringComparison.h (version >= 4.0.0)
mv code/StringComparison.h code/StringComparison.h.bak &&
sed -e "s/strcasecmp/stricmp/g; s/strncasecmp/strnicmp/g" code/StringComparison.h.bak > code/StringComparison.h
mkdir -p build_static build_shared &&
cd build_static &&
cmake.exe -G"MSYS Makefiles" -DCMAKE_INSTALL_PREFIX:PATH=/usr/local -DCMAKE_BUILD_TYPE:STRING=Release -DBUILD_SHARED_LIBS:BOOL=OFF -DASSIMP_BUILD_TESTS:BOOL=OFF -DASSIMP_BUILD_ASSIMP_TOOLS:BOOL=OFF -DASSIMP_HEADERCHECK:BOOL=OFF -DASSIMP_OPT_BUILD_PACKAGES:BOOL=OFF -DSYSTEM_IRRXML:BOOL=OFF -DASSIMP_BUILD_SAMPLES:BOOL=OFF -DBUILD_DOCS:BOOL=OFF -DASSIMP_BUILD_TESTS:BOOL=OFF .. &&
cd .. &&
cd build_shared &&
cmake.exe -G"MSYS Makefiles" -DCMAKE_INSTALL_PREFIX:PATH=/usr/local -DCMAKE_BUILD_TYPE:STRING=Release -DBUILD_SHARED_LIBS:BOOL=ON -DASSIMP_BUILD_TESTS:BOOL=OFF -DASSIMP_BUILD_ASSIMP_TOOLS:BOOL=OFF -DASSIMP_HEADERCHECK:BOOL=OFF -DASSIMP_OPT_BUILD_PACKAGES:BOOL=OFF -DSYSTEM_IRRXML:BOOL=OFF -DASSIMP_BUILD_SAMPLES:BOOL=OFF -DBUILD_DOCS:BOOL=OFF -DASSIMP_BUILD_TESTS:BOOL=OFF .. &&
cd .. &&
# fix missing ../../revision.h
cp -f build_shared/revision.h . &&
make -Cbuild_static install/strip &&
make -Cbuild_shared install/strip &&
echo Success
Replace /usr/local with the destination folder that you need.
I was not successful building it with -DASSIMP_BUILD_ASSIMP_TOOLS:BOOL=ON though.
I don't know assimp library, but if you use msys2, you can install the complete package (dynamic and static library and all the header files) with the command:
pacman -S mingw-w64-x86_64-assimp.
As far as I know the tools are currently not working with this compiler. I need to check that.
I seem to have a linker problem while compiling with Wt library on MingW64 on windows cmd and or msys. Undefined reference to Wt:: ... Any suggestions?
Using msys shell, I have compiled boost_1_69_0 und wt4.0.5 and generated libs among other libwt.a and libwthttp.a. I moved the libs into a single directory, because they were scattered into different directories.
My hello.cc is simple program from :https://www.webtoolkit.eu/wt/doc/tutorial/wt.html
Am trying to build it as follows:
> g++ -std=c++14 -IC:/.../boost_1_69_0/include -LC:/.../boost_1_69_0/lib -IC:/.../wt4msys -IC:/.../wt4msys/src -LC:/.../wt4msys/lib -lwt -lwthttp hello.cc
But I get the following big error-stack
C:\...\AppData\Local\Temp\ccf7lOkh.o:hello.cc:(.text+0x3c): undefined reference to `Wt::operator+(char const*, Wt::WString const&)'
C:\...\AppData\Local\Temp\ccf7lOkh.o:hello.cc:(.text+0x49): undefined reference to `Wt::WText::setText(Wt::WString const&)'
C:\...\AppData\Local\Temp\ccf7lOkh.o:hello.cc:(.text+0x56): undefined reference to `Wt::WString::~WString()'
C:\...\AppData\Local\Temp\ccf7lOkh.o:hello.cc:(.text+0x64): undefined reference to `Wt::WString::~WString()'
C:\...\AppData\Local\Temp\ccf7lOkh.o:hello.cc:(.text+0x92): undefined reference to `Wt::WApplication::WApplication(Wt::WEnvironment const&, Wt::WtLibVersion)'
C:\...\AppData\Local\Temp\ccf7lOkh.o:hello.cc:(.text+0xbb): undefined reference to `Wt::WString::WString(char const*, Wt::CharEncoding)'
C:\...\AppData\Local\Temp\ccf7lOkh.o:hello.cc:(.text+0xcb): undefined reference to `Wt::WApplication::setTitle(Wt::WString const&)'
C:\...\AppData\Local\Temp\ccf7lOkh.o:hello.cc:(.text+0xd8): undefined reference to `Wt::WString::~WString()'
C:\...\AppData\Local\Temp\ccf7lOkh.o:hello.cc:(.text+0x206): undefined reference to `Wt::WInteractWidget::clicked()'
C:\...\AppData\Local\Temp\ccf7lOkh.o:hello.cc:(.text+0x229): undefined reference to `Wt::Signals::Impl::Connection::~Connection()'
C:\...\AppData\Local\Temp\ccf7lOkh.o:hello.cc:(.text+0x237): undefined reference to `Wt::WString::~WString()'
C:\...\AppData\Local\Temp\ccf7lOkh.o:hello.cc:(.text+0x28b): undefined reference to `Wt::WApplication::~WApplication()'
C:\...\AppData\Local\Temp\ccf7lOkh.o:hello.cc:(.text+0x303): undefined reference to `Wt::WRun(int, char**, std::function<std::unique_ptr<Wt::WApplication, std::default_delete<Wt::WApplication> > (Wt::WEnvironment const&)>)'
C:\...\AppData\Local\Temp\ccf7lOkh.o:hello.cc:(.text+0x347): undefined reference to `Wt::EventSignalBase::exposeSignal()'
C:\...\AppData\Local\Temp\ccf7lOkh.o:hello.cc:(.text$_ZSt11make_uniqueIN2Wt5WTextEJRA20_KcEENSt9_MakeUniqIT_E15__single_objectEDpOT0_[__ZSt11make_uniqueIN2Wt5WTextEJRA20_KcEENSt9_MakeUniqIT_E15__single_objectEDpOT0_]+0x26): undefined reference to `Wt::WString::WString(char const*, Wt::CharEncoding)'
C:\...\AppData\Local\Temp\ccf7lOkh.o:hello.cc:(.text$_ZSt11make_uniqueIN2Wt5WTextEJRA20_KcEENSt9_MakeUniqIT_E15__single_objectEDpOT0_[__ZSt11make_uniqueIN2Wt5WTextEJRA20_KcEENSt9_MakeUniqIT_E15__single_objectEDpOT0_]+0x44): undefined reference to `Wt::WText::WText(Wt::WString const&)'
C:\...\AppData\Local\Temp\ccf7lOkh.o:hello.cc:(.text$_ZSt11make_uniqueIN2Wt5WTextEJRA20_KcEENSt9_MakeUniqIT_E15__single_objectEDpOT0_[__ZSt11make_uniqueIN2Wt5WTextEJRA20_KcEENSt9_MakeUniqIT_E15__single_objectEDpOT0_]+0x5f): undefined reference to `Wt::WString::~WString()'
C:\...\AppData\Local\Temp\ccf7lOkh.o:hello.cc:(.text$_ZSt11make_uniqueIN2Wt5WTextEJRA20_KcEENSt9_MakeUniqIT_E15__single_objectEDpOT0_[__ZSt11make_uniqueIN2Wt5WTextEJRA20_KcEENSt9_MakeUniqIT_E15__single_objectEDpOT0_]+0x83): undefined reference to `Wt::WString::~WString()'
C:\...\AppData\Local\Temp\ccf7lOkh.o:hello.cc:(.text$_ZSt11make_uniqueIN2Wt9WLineEditEJEENSt9_MakeUniqIT_E15__single_objectEDpOT0_[__ZSt11make_uniqueIN2Wt9WLineEditEJEENSt9_MakeUniqIT_E15__single_objectEDpOT0_]+0x19): undefined reference to `Wt::WLineEdit::WLineEdit()'
C:\...\AppData\Local\Temp\ccf7lOkh.o:hello.cc:(.text$_ZSt11make_uniqueIN2Wt11WPushButtonEJRA10_KcEENSt9_MakeUniqIT_E15__single_objectEDpOT0_[__ZSt11make_uniqueIN2Wt11WPushButtonEJRA10_KcEENSt9_MakeUniqIT_E15__single_objectEDpOT0_]+0x26): undefined reference to `Wt::WString::WString(char const*, Wt::CharEncoding)'
C:\...\AppData\Local\Temp\ccf7lOkh.o:hello.cc:(.text$_ZSt11make_uniqueIN2Wt11WPushButtonEJRA10_KcEENSt9_MakeUniqIT_E15__single_objectEDpOT0_[__ZSt11make_uniqueIN2Wt11WPushButtonEJRA10_KcEENSt9_MakeUniqIT_E15__single_objectEDpOT0_]+0x44): undefined reference to `Wt::WPushButton::WPushButton(Wt::WString const&)'
C:\...\AppData\Local\Temp\ccf7lOkh.o:hello.cc:(.text$_ZSt11make_uniqueIN2Wt11WPushButtonEJRA10_KcEENSt9_MakeUniqIT_E15__single_objectEDpOT0_[__ZSt11make_uniqueIN2Wt11WPushButtonEJRA10_KcEENSt9_MakeUniqIT_E15__single_objectEDpOT0_]+0x5f): undefined reference to `Wt::WString::~WString()'
C:\...\AppData\Local\Temp\ccf7lOkh.o:hello.cc:(.text$_ZSt11make_uniqueIN2Wt11WPushButtonEJRA10_KcEENSt9_MakeUniqIT_E15__single_objectEDpOT0_[__ZSt11make_uniqueIN2Wt11WPushButtonEJRA10_KcEENSt9_MakeUniqIT_E15__single_objectEDpOT0_]+0x83): undefined reference to `Wt::WString::~WString()'
C:\...\AppData\Local\Temp\ccf7lOkh.o:hello.cc:(.text$_ZSt11make_uniqueIN2Wt6WBreakEJEENSt9_MakeUniqIT_E15__single_objectEDpOT0_[__ZSt11make_uniqueIN2Wt6WBreakEJEENSt9_MakeUniqIT_E15__single_objectEDpOT0_]+0x19): undefined reference to `Wt::WBreak::WBreak()'
C:\...\AppData\Local\Temp\ccf7lOkh.o:hello.cc:(.text$_ZSt11make_uniqueIN2Wt5WTextEJEENSt9_MakeUniqIT_E15__single_objectEDpOT0_[__ZSt11make_uniqueIN2Wt5WTextEJEENSt9_MakeUniqIT_E15__single_objectEDpOT0_]+0x19): undefined reference to `Wt::WText::WText()'
C:\...\AppData\Local\Temp\ccf7lOkh.o:hello.cc:(.text$_ZN16HelloApplicationD1Ev[__ZN16HelloApplicationD1Ev]+0x19): undefined reference to `Wt::WApplication::~WApplication()'
C:\...\AppData\Local\Temp\ccf7lOkh.o:hello.cc:(.text$_ZN2Wt7Signals4Impl11ProtoSignalIJNS_11WMouseEventEEE10SignalLink10add_beforeEOSt8functionIFvS3_EEPKNS_4Core10observableE[__ZN2Wt7Signals4Impl11ProtoSignalIJNS_11WMouseEventEEE10SignalLink10add_beforeEOSt8functionIFvS3_EEPKNS_4Core10observableE]+0x67): undefined reference to `Wt::Signals::Impl::SignalLinkBase::connect(Wt::Core::observable const*)'
C:\...\AppData\Local\Temp\ccf7lOkh.o:hello.cc:(.text$_ZN2Wt7Signals4Impl11ProtoSignalIJNS_11WMouseEventEEE10SignalLinkC1Ev[__ZN2Wt7Signals4Impl11ProtoSignalIJNS_11WMouseEventEEE10SignalLinkC1Ev]+0x16): undefined reference to `Wt::Signals::Impl::SignalLinkBase::SignalLinkBase(void (*)(Wt::Signals::Impl::SignalLinkBase*))'
C:\...\AppData\Local\Temp\ccf7lOkh.o:hello.cc:(.text$_ZN2Wt7Signals4Impl11ProtoSignalIJNS_11WMouseEventEEE10SignalLinkD1Ev[__ZN2Wt7Signals4Impl11ProtoSignalIJNS_11WMouseEventEEE10SignalLinkD1Ev]+0x42): undefined reference to `Wt::Signals::Impl::SignalLinkBase::~SignalLinkBase()'
C:\...\AppData\Local\Temp\ccf7lOkh.o:hello.cc:(.rdata$_ZTV16HelloApplication[__ZTV16HelloApplication]+0x10): undefined reference to `Wt::WObject::id[abi:cxx11]() const'
C:\...\AppData\Local\Temp\ccf7lOkh.o:hello.cc:(.rdata$_ZTV16HelloApplication[__ZTV16HelloApplication]+0x14): undefined reference to `Wt::WObject::setObjectName(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)'
C:\...\AppData\Local\Temp\ccf7lOkh.o:hello.cc:(.rdata$_ZTV16HelloApplication[__ZTV16HelloApplication]+0x18): undefined reference to `Wt::WObject::objectName[abi:cxx11]() const'
C:\...\AppData\Local\Temp\ccf7lOkh.o:hello.cc:(.rdata$_ZTV16HelloApplication[__ZTV16HelloApplication]+0x1c): undefined reference to `Wt::WObject::signalConnectionsChanged()'
C:\...\AppData\Local\Temp\ccf7lOkh.o:hello.cc:(.rdata$_ZTV16HelloApplication[__ZTV16HelloApplication]+0x20): undefined reference to `Wt::WObject::setFormData(Wt::WObject::FormData const&)'
C:\...\AppData\Local\Temp\ccf7lOkh.o:hello.cc:(.rdata$_ZTV16HelloApplication[__ZTV16HelloApplication]+0x24): undefined reference to `Wt::WObject::setRequestTooLarge(long long)'
C:\...\AppData\Local\Temp\ccf7lOkh.o:hello.cc:(.rdata$_ZTV16HelloApplication[__ZTV16HelloApplication]+0x28): undefined reference to `Wt::WObject::getStateless(void (Wt::WObject::*)())'
C:\...\AppData\Local\Temp\ccf7lOkh.o:hello.cc:(.rdata$_ZTV16HelloApplication[__ZTV16HelloApplication]+0x2c): undefined reference to `Wt::WApplication::refresh()'
C:\...\AppData\Local\Temp\ccf7lOkh.o:hello.cc:(.rdata$_ZTV16HelloApplication[__ZTV16HelloApplication]+0x30): undefined reference to `Wt::WApplication::makeAbsoluteUrl(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) const'
C:\...\AppData\Local\Temp\ccf7lOkh.o:hello.cc:(.rdata$_ZTV16HelloApplication[__ZTV16HelloApplication]+0x34): undefined reference to `Wt::WApplication::waitForEvent()'
C:\...\AppData\Local\Temp\ccf7lOkh.o:hello.cc:(.rdata$_ZTV16HelloApplication[__ZTV16HelloApplication]+0x38): undefined reference to `Wt::WApplication::initialize()'
C:\...\AppData\Local\Temp\ccf7lOkh.o:hello.cc:(.rdata$_ZTV16HelloApplication[__ZTV16HelloApplication]+0x3c): undefined reference to `Wt::WApplication::finalize()'
C:\...\AppData\Local\Temp\ccf7lOkh.o:hello.cc:(.rdata$_ZTV16HelloApplication[__ZTV16HelloApplication]+0x40): undefined reference to `Wt::WApplication::notify(Wt::WEvent const&)'
C:\...\AppData\Local\Temp\ccf7lOkh.o:hello.cc:(.rdata$_ZTV16HelloApplication[__ZTV16HelloApplication]+0x44): undefined reference to `Wt::WApplication::isExposed(Wt::WWidget*) const'
C:\...\AppData\Local\Temp\ccf7lOkh.o:hello.cc:(.rdata$_ZTV16HelloApplication[__ZTV16HelloApplication]+0x48): undefined reference to `Wt::WApplication::enableAjax()'
C:\...\AppData\Local\Temp\ccf7lOkh.o:hello.cc:(.rdata$_ZTV16HelloApplication[__ZTV16HelloApplication]+0x4c): undefined reference to `Wt::WApplication::unload()'
C:\...\AppData\Local\Temp\ccf7lOkh.o:hello.cc:(.rdata$_ZTV16HelloApplication[__ZTV16HelloApplication]+0x50): undefined reference to `Wt::WApplication::idleTimeout()'
C:\...\AppData\Local\Temp\ccf7lOkh.o:hello.cc:(.rdata$_ZTV16HelloApplication[__ZTV16HelloApplication]+0x54): undefined reference to `Wt::WApplication::handleJavaScriptError(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)'
collect2.exe: error: ld returned 1 exit status
What else should try or where am I making a mistake?
I want to compile C files in ubuntu16.04, the makefile file is as follows:
TARGET := matchengine.exe
INCS = -I ../network -I ../utils
LIBS = -L ../utils -lutils -L ../network -lnetwork -Wl,-Bstatic -lev -ljansson -lmpdec -lmysqlclient -lz -lrdkafka -lssl -lcrypto -lhiredis -Wl,-Bdynamic -lm -lpthread -ldl
include ../makefile.inc
I have installed libmysqlclient-dev and mysql-client library using following command:
apt install mysql-client-5.6
apt-get install libmysqlclient-dev
While I compiled the C files , the following errors show:
/usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/libmysqlclient.a(my_default.cc.o):(.data.DW.ref.__gxx_personality_v0[DW.ref.__gxx_personality_v0]+0x0): undefined reference to `__gxx_personality_v0'
/usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/libmysqlclient.a(ssl.cpp.o): In function `yaSSLv3_server_method':
(.text+0x60): undefined reference to `operator new(unsigned long)'
/usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/libmysqlclient.a(ssl.cpp.o): In function `yaSSLv3_server_method':
(.text+0x9e): undefined reference to `operator delete(void*)'
/usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/libmysqlclient.a(ssl.cpp.o): In function `yaSSLv3_client_method':
(.text+0xe0): undefined reference to `operator new(unsigned long)'
/usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/libmysqlclient.a(ssl.cpp.o): In function `yaSSLv3_client_method':
(.text+0x121): undefined reference to `operator delete(void*)'
/usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/libmysqlclient.a(ssl.cpp.o): In function `yaTLSv1_server_method':
(.text+0x173): undefined reference to `operator new(unsigned long)'
.....
/usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/libmysqlclient.a(ripemd.cpp.o):(.data.rel.ro._ZTIN8TaoCrypt9RIPEMD160E[_ZTIN8TaoCrypt9RIPEMD160E]+0x0): undefined reference to `vtable for __cxxabiv1::__si_class_type_info'
/usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/libmysqlclient.a(dh.cpp.o): In function `TaoCrypt::DH::GeneratePrivate(TaoCrypt::RandomNumberGenerator&, unsigned char*)':
(.text+0x122): undefined reference to `operator delete[](void*)'
/usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/libmysqlclient.a(dh.cpp.o): In function `TaoCrypt::DH::GeneratePrivate(TaoCrypt::RandomNumberGenerator&, unsigned char*)':
(.text+0x145): undefined reference to `operator delete[](void*)'
/usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/libmysqlclient.a(dh.cpp.o): In function `TaoCrypt::DH::GeneratePrivate(TaoCrypt::RandomNumberGenerator&, unsigned char*)':
(.text+0x162): undefined reference to `operator delete[](void*)'
/usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/libmysqlclient.a(dh.cpp.o): In function `TaoCrypt::DH::GeneratePrivate(TaoCrypt::RandomNumberGenerator&, unsigned char*)':
(.text+0x1a0): undefined reference to `operator delete[](void*)'
/usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/libmysqlclient.a(dh.cpp.o): In function `TaoCrypt::DH::GeneratePublic(unsigned char const*, unsigned char*)':
(.text+0x2b3): undefined reference to `operator delete[](void*)'
/usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/libmysqlclient.a(dh.cpp.o):(.text+0x2d0): more undefined references to `operator delete[](void*)' follow
I have a problem compiling Transceiver52M for OpenBTS, I have a Ettus B200 peripheral, and have installed UHD version UHD_003.010.git-156-g2d68f228.
But I get the following errors once I get to compiling Transceiver52M; the filing lines are (the full build output is here):
libtool: link: g++ -g -O2 -Wall -pthread -rdynamic -DTIMESTAMP_ISO=\"2016-03-28T20:57:00\" -o transceiver runTransceiver.o /usr/local/lib/libuhd.so ./.libs/libtransceiver.a ../GSM/.libs/libGSM.a ../C
ommonLibs/.libs/libcommon.a -ldl /usr/lib/x86_64-linux-gnu/libsqlite3.so -la53 -lzmq -pthread
./.libs/libtransceiver.a(UHDDevice.o): In function `uhd_device::stop()':
/home/openbts/dev/openbts/Transceiver52M/UHDDevice.cpp:673: undefined reference to `uhd::stream_cmd_t::stream_cmd_t(uhd::stream_cmd_t::stream_mode_t const&)'
./.libs/libtransceiver.a(UHDDevice.o): In function `uhd::usrp::multi_usrp::set_rx_gain(double, unsigned long)':
/usr/local/include/uhd/usrp/multi_usrp.hpp:500: undefined reference to `uhd::usrp::multi_usrp::ALL_GAINS'
./.libs/libtransceiver.a(UHDDevice.o): In function `uhd::usrp::multi_usrp::set_tx_gain(double, unsigned long)':
/usr/local/include/uhd/usrp/multi_usrp.hpp:786: undefined reference to `uhd::usrp::multi_usrp::ALL_GAINS'
./.libs/libtransceiver.a(UHDDevice.o): In function `uhd_device::writeSamples(short*, int, bool*, unsigned long long, bool)':
/home/openbts/dev/openbts/Transceiver52M/UHDDevice.cpp:810: undefined reference to `uhd::tx_metadata_t::tx_metadata_t()'
/home/openbts/dev/openbts/Transceiver52M/UHDDevice.cpp:814: undefined reference to `uhd::time_spec_t::from_ticks(long long, double)'
/home/openbts/dev/openbts/Transceiver52M/UHDDevice.cpp:847: undefined reference to `uhd::get_version_string()'
./.libs/libtransceiver.a(UHDDevice.o): In function `uhd_device::uhd_device(int, bool)':
/home/openbts/dev/openbts/Transceiver52M/UHDDevice.cpp:343: undefined reference to `uhd::time_spec_t::time_spec_t(long, double)'
./.libs/libtransceiver.a(UHDDevice.o): In function `uhd_device::parse_dev_type()':
/home/openbts/dev/openbts/Transceiver52M/UHDDevice.cpp:479: undefined reference to `uhd::device::get_tree() const'
/home/openbts/dev/openbts/Transceiver52M/UHDDevice.cpp:480: undefined reference to `uhd::fs_path::fs_path(char const*)'
./.libs/libtransceiver.a(UHDDevice.o): In function `rx_metadata_t':
/usr/local/include/uhd/types/metadata.hpp:37: undefined reference to `uhd::time_spec_t::time_spec_t(double)'
./.libs/libtransceiver.a(UHDDevice.o): In function `uhd::rx_metadata_t::reset()':
/usr/local/include/uhd/types/metadata.hpp:45: undefined reference to `uhd::time_spec_t::time_spec_t(double)'
./.libs/libtransceiver.a(UHDDevice.o): In function `uhd_device::restart(uhd::time_spec_t)':
/home/openbts/dev/openbts/Transceiver52M/UHDDevice.cpp:629: undefined reference to `uhd::stream_cmd_t::stream_cmd_t(uhd::stream_cmd_t::stream_mode_t const&)'
/home/openbts/dev/openbts/Transceiver52M/UHDDevice.cpp:637: undefined reference to `uhd::stream_cmd_t::stream_cmd_t(uhd::stream_cmd_t::stream_mode_t const&)'
./.libs/libtransceiver.a(UHDDevice.o): In function `uhd_device::start()':
/home/openbts/dev/openbts/Transceiver52M/UHDDevice.cpp:654: undefined reference to `uhd::msg::register_handler(void (* const&)(uhd::msg::type_t, std::string const&))'
/home/openbts/dev/openbts/Transceiver52M/UHDDevice.cpp:660: undefined reference to `uhd::time_spec_t::time_spec_t(double)'
/home/openbts/dev/openbts/Transceiver52M/UHDDevice.cpp:663: undefined reference to `uhd::time_spec_t::get_real_secs() const'
./.libs/libtransceiver.a(UHDDevice.o): In function `smpl_buf::avail_smpls(uhd::time_spec_t) const':
/home/openbts/dev/openbts/Transceiver52M/UHDDevice.cpp:987: undefined reference to `uhd::time_spec_t::to_ticks(double) const'
./.libs/libtransceiver.a(UHDDevice.o): In function `smpl_buf::read(void*, unsigned long, uhd::time_spec_t)':
/home/openbts/dev/openbts/Transceiver52M/UHDDevice.cpp:1033: undefined reference to `uhd::time_spec_t::to_ticks(double) const'
./.libs/libtransceiver.a(UHDDevice.o): In function `smpl_buf::write(void*, unsigned long, uhd::time_spec_t)':
/home/openbts/dev/openbts/Transceiver52M/UHDDevice.cpp:1074: undefined reference to `uhd::time_spec_t::to_ticks(double) const'
./.libs/libtransceiver.a(UHDDevice.o): In function `uhd_device::init_gains()':
/home/openbts/dev/openbts/Transceiver52M/UHDDevice.cpp:359: undefined reference to `uhd::meta_range_t::meta_range_t()'
./.libs/libtransceiver.a(UHDDevice.o): In function `uhd::usrp::multi_usrp::get_tx_gain_range(unsigned long)':
/usr/local/include/uhd/usrp/multi_usrp.hpp:838: undefined reference to `uhd::usrp::multi_usrp::ALL_GAINS'
./.libs/libtransceiver.a(UHDDevice.o): In function `uhd_device::init_gains()':
/home/openbts/dev/openbts/Transceiver52M/UHDDevice.cpp:362: undefined reference to `uhd::meta_range_t::start() const'
/home/openbts/dev/openbts/Transceiver52M/UHDDevice.cpp:363: undefined reference to `uhd::meta_range_t::stop() const'
/home/openbts/dev/openbts/Transceiver52M/UHDDevice.cpp:366: undefined reference to `uhd::meta_range_t::start() const'
/home/openbts/dev/openbts/Transceiver52M/UHDDevice.cpp:367: undefined reference to `uhd::meta_range_t::stop() const'
./.libs/libtransceiver.a(UHDDevice.o): In function `uhd_device::setTxFreq(double)':
/home/openbts/dev/openbts/Transceiver52M/UHDDevice.cpp:862: undefined reference to `uhd::tune_request_t::tune_request_t(double)'
/home/openbts/dev/openbts/Transceiver52M/UHDDevice.cpp:863: undefined reference to `uhd::tune_result_t::to_pp_string() const'
./.libs/libtransceiver.a(UHDDevice.o): In function `uhd_device::setRxFreq(double)':
/home/openbts/dev/openbts/Transceiver52M/UHDDevice.cpp:871: undefined reference to `uhd::tune_request_t::tune_request_t(double)'
/home/openbts/dev/openbts/Transceiver52M/UHDDevice.cpp:872: undefined reference to `uhd::tune_result_t::to_pp_string() const'
./.libs/libtransceiver.a(UHDDevice.o): In function `uhd_device::open(std::string const&, bool)':
/home/openbts/dev/openbts/Transceiver52M/UHDDevice.cpp:531: undefined reference to `uhd::device_addr_t::device_addr_t(std::string const&)'
/home/openbts/dev/openbts/Transceiver52M/UHDDevice.cpp:532: undefined reference to `uhd::device::find(uhd::device_addr_t const&, uhd::device::device_filter_t)'
/home/openbts/dev/openbts/Transceiver52M/UHDDevice.cpp:539: undefined reference to `uhd::device_addr_t::to_string() const'
/home/openbts/dev/openbts/Transceiver52M/UHDDevice.cpp:541: undefined reference to `uhd::usrp::multi_usrp::make(uhd::device_addr_t const&)'
./.libs/libtransceiver.a(UHDDevice.o): In function `stream_args_t':
/usr/local/include/uhd/stream.hpp:63: undefined reference to `uhd::device_addr_t::device_addr_t(std::string const&)'
./.libs/libtransceiver.a(UHDDevice.o): In function `uhd_device::open(std::string const&, bool)':
/home/openbts/dev/openbts/Transceiver52M/UHDDevice.cpp:543: undefined reference to `uhd::device_addr_t::to_string() const'
./.libs/libtransceiver.a(UHDDevice.o): In function `uhd_device::str_code(uhd::rx_metadata_t)':
/home/openbts/dev/openbts/Transceiver52M/UHDDevice.cpp:925: undefined reference to `uhd::time_spec_t::get_real_secs() const'
./.libs/libtransceiver.a(UHDDevice.o): In function `uhd_device::check_rx_md_err(uhd::rx_metadata_t&, long)':
/home/openbts/dev/openbts/Transceiver52M/UHDDevice.cpp:689: undefined reference to `uhd::time_spec_t::time_spec_t(double)'
/home/openbts/dev/openbts/Transceiver52M/UHDDevice.cpp:716: undefined reference to `uhd::operator<(uhd::time_spec_t const&, uhd::time_spec_t const&)'
/home/openbts/dev/openbts/Transceiver52M/UHDDevice.cpp:719: undefined reference to `uhd::time_spec_t::get_real_secs() const'
/home/openbts/dev/openbts/Transceiver52M/UHDDevice.cpp:718: undefined reference to `uhd::time_spec_t::get_real_secs() const'
./.libs/libtransceiver.a(UHDDevice.o): In function `uhd_device::readSamples(short*, int, bool*, unsigned long long, bool*, unsigned int*)':
/home/openbts/dev/openbts/Transceiver52M/UHDDevice.cpp:732: undefined reference to `uhd::time_spec_t::time_spec_t(double)'
./.libs/libtransceiver.a(UHDDevice.o): In function `rx_metadata_t':
/usr/local/include/uhd/types/metadata.hpp:37: undefined reference to `uhd::time_spec_t::time_spec_t(double)'
./.libs/libtransceiver.a(UHDDevice.o): In function `uhd::rx_metadata_t::reset()':
/usr/local/include/uhd/types/metadata.hpp:45: undefined reference to `uhd::time_spec_t::time_spec_t(double)'
./.libs/libtransceiver.a(UHDDevice.o): In function `uhd_device::readSamples(short*, int, bool*, unsigned long long, bool*, unsigned int*)':
/home/openbts/dev/openbts/Transceiver52M/UHDDevice.cpp:745: undefined reference to `uhd::time_spec_t::from_ticks(long long, double)'
/home/openbts/dev/openbts/Transceiver52M/UHDDevice.cpp:746: undefined reference to `uhd::time_spec_t::get_real_secs() const'
/home/openbts/dev/openbts/Transceiver52M/UHDDevice.cpp:781: undefined reference to `uhd::time_spec_t::get_real_secs() const'
/home/openbts/dev/openbts/Transceiver52M/UHDDevice.cpp:770: undefined reference to `uhd::get_version_string()'
./.libs/libtransceiver.a(UHDDevice.o): In function `uhd_device::str_code(uhd::async_metadata_t)':
/home/openbts/dev/openbts/Transceiver52M/UHDDevice.cpp:958: undefined reference to `uhd::time_spec_t::get_real_secs() const'
./.libs/libtransceiver.a(UHDDevice.o): In function `async_metadata_t':
/usr/local/include/uhd/types/metadata.hpp:169: undefined reference to `uhd::time_spec_t::time_spec_t(double)'
./.libs/libtransceiver.a(UHDDevice.o): In function `uhd_device::setPriority()':
/home/openbts/dev/openbts/Transceiver52M/UHDDevice.cpp:683: undefined reference to `uhd::set_thread_priority_safe(float, bool)'
collect2: error: ld returned 1 exit status
make[2]: *** [transceiver] Error 1
make[2]: Leaving directory `/home/openbts/dev/openbts/Transceiver52M'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/home/openbts/dev/openbts'
This is very symptomatic of having multiple competing UHD installations. Maybe you've installed UHD from your Linux Distro's repository and then installed UHD again, manually, atop? Or maybe you've installed it when building OpenBTS.
However, make sure that you've only got one installation that your build system will find, or else you'd see exactly what you're experiencing now.
I tried to put up an example using c++ for accessing Cassandra, and so Using Thrift.
Copying the example, I had this strange situation:
storm#debian:~/Script/goh-server/src/cassandra$ g++ -I/usr/include/thrift/ -c prova.cpp -o prova.o
storm#debian:~/Script/goh-server/src/cassandra$ g++ -I/usr/include/thrift/ -c cassandra_constants.cpp -o cassandra_constants.o
storm#debian:~/Script/goh-server/src/cassandra$ g++ -I/usr/include/thrift/ -c cassandra_types.cpp -o cassandra_types.o
storm#debian:~/Script/goh-server/src/cassandra$ g++ -I/usr/include/thrift/ -c Cassandra.cpp -o Cassandra.o
g++storm#debian:~/Script/goh-server/src/cassandra$ g++ -lthrift *.o -o prova
Cassandra.o: In function `org::apache::cassandra::CassandraClient::recv_login()':
Cassandra.cpp:(.text+0x12d2c): undefined reference to `apache::thrift::TApplicationException::read(apache::thrift::protocol::TProtocol*)'
Cassandra.o: In function `org::apache::cassandra::CassandraClient::recv_set_keyspace()':
Cassandra.cpp:(.text+0x1339c): undefined reference to `apache::thrift::TApplicationException::read(apache::thrift::protocol::TProtocol*)'
Cassandra.o: In function `org::apache::cassandra::CassandraClient::recv_get(org::apache::cassandra::ColumnOrSuperColumn&)':
Cassandra.cpp:(.text+0x13a0b): undefined reference to `apache::thrift::TApplicationException::read(apache::thrift::protocol::TProtocol*)'
Cassandra.o: In function `org::apache::cassandra::CassandraClient::recv_get_slice(std::vector<org::apache::cassandra::ColumnOrSuperColumn, std::allocator<org::apache::cassandra::ColumnOrSuperColumn> >&)':
Cassandra.cpp:(.text+0x142db): undefined reference to `apache::thrift::TApplicationException::read(apache::thrift::protocol::TProtocol*)'
Cassandra.o: In function `org::apache::cassandra::CassandraClient::recv_get_count()':
Cassandra.cpp:(.text+0x14b40): undefined reference to `apache::thrift::TApplicationException::read(apache::thrift::protocol::TProtocol*)'
Cassandra.o:Cassandra.cpp:(.text+0x153bd): more undefined references to `apache::thrift::TApplicationException::read(apache::thrift::protocol::TProtocol*)' follow
Cassandra.o: In function `org::apache::cassandra::CassandraProcessor::process(boost::shared_ptr<apache::thrift::protocol::TProtocol>, boost::shared_ptr<apache::thrift::protocol::TProtocol>, void*)':
Cassandra.cpp:(.text+0x21511): undefined reference to `apache::thrift::TApplicationException::write(apache::thrift::protocol::TProtocol*) const'
Cassandra.o: In function `org::apache::cassandra::CassandraProcessor::process_fn(apache::thrift::protocol::TProtocol*, apache::thrift::protocol::TProtocol*, std::basic_string<char, std::char_traits<char>, std::allocator<char> >&, int, void*)':
Cassandra.cpp:(.text+0x21882): undefined reference to `apache::thrift::TApplicationException::write(apache::thrift::protocol::TProtocol*) const'
Cassandra.o: In function `org::apache::cassandra::CassandraProcessor::process_login(int, apache::thrift::protocol::TProtocol*, apache::thrift::protocol::TProtocol*, void*)':
Cassandra.cpp:(.text+0x21fa8): undefined reference to `apache::thrift::TApplicationException::write(apache::thrift::protocol::TProtocol*) const'
Cassandra.o: In function `org::apache::cassandra::CassandraProcessor::process_set_keyspace(int, apache::thrift::protocol::TProtocol*, apache::thrift::protocol::TProtocol*, void*)':
Cassandra.cpp:(.text+0x2291e): undefined reference to `apache::thrift::TApplicationException::write(apache::thrift::protocol::TProtocol*) const'
Cassandra.o: In function `org::apache::cassandra::CassandraProcessor::process_get(int, apache::thrift::protocol::TProtocol*, apache::thrift::protocol::TProtocol*, void*)':
Cassandra.cpp:(.text+0x233b9): undefined reference to `apache::thrift::TApplicationException::write(apache::thrift::protocol::TProtocol*) const'
Cassandra.o:Cassandra.cpp:(.text+0x23e16): more undefined references to `apache::thrift::TApplicationException::write(apache::thrift::protocol::TProtocol*) const' follow
prova.o: In function `main':
prova.cpp:(.text+0x6e): undefined reference to `apache::thrift::transport::TSocket::TSocket(std::basic_string<char, std::char_traits<char>, std::allocator<char> >, int)'
prova.o: In function `apache::thrift::transport::TFramedTransport::TFramedTransport(boost::shared_ptr<apache::thrift::transport::TTransport>)':
prova.cpp:(.text._ZN6apache6thrift9transport16TFramedTransportC1EN5boost10shared_ptrINS1_10TTransportEEE[apache::thrift::transport::TFramedTransport::TFramedTransport(boost::shared_ptr<apache::thrift::transport::TTransport>)]+0x26): undefined reference to `vtable for apache::thrift::transport::TFramedTransport'
collect2: ld returned 1 exit status
storm#debian:~/Script/goh-server/src/cassandra$ ls
cassandra_constants.cpp cassandra_constants.o Cassandra.h cassandra_types.cpp cassandra_types.o prova.o
cassandra_constants.h Cassandra.cpp Cassandra.o cassandra_types.h prova.cpp
Then, with some Voodoo I tried to move the -l switch at the end of the linking order, and magically ...
storm#debian:~/Script/goh-server/src/cassandra$ g++ *.o -o prova -lthrift
storm#debian:~/Script/goh-server/src/cassandra$
On the Thrift documentation, the -l switch is put in the beginning, and in fact automake DOES put it before the '*.o's and -o switch.
What's wrong with it ?
Edit:
In fact is not true that automake put -l flags in the beginning. It does put them in the end in the linking stage. Still: why does the order matter ?
It matters. -llibrary must follow everything that references the library.
If you have circular references between static libraries, you end up with -llibrary twice.