Undefined reference Poco::* when compiling OF from Git on QtCreator 4.1.0

Hi,

I decided to try again update QtCreator to 4.1 and OF from GitHub, without much luck. I have tried both the master branch and 0.9.4 branch, but I always get the same error when compiling even an empty project:

linking SimpleTest3_debug
/usr/bin/clang++ -target x86_64-pc-linux-gnu -Wl,--unresolved-symbols=ignore-in-shared-libs '-Wl,-rpath,$ORIGIN' -o /X/Desktop/edu/src/openframeworks/SimpleTest3/bin/SimpleTest3_debug /X/Desktop/edu/src/openframeworks/build-SimpleTest3-Desktop-Debug/qtc_Desktop_117cab14-debug/SimpleTest3.qtc-Desktop-117cab14.52199c50/.obj/f27fede2220bcd32/main.cpp.o /X/Desktop/edu/src/openframeworks/build-SimpleTest3-Desktop-Debug/qtc_Desktop_117cab14-debug/SimpleTest3.qtc-Desktop-117cab14.52199c50/.obj/f27fede2220bcd32/ofApp.cpp.o /X/src/openFrameworks/libs/openFrameworksCompiled/lib/linux64/libopenFrameworksDebug.a /X/src/openFrameworks/libs/fmodex/lib/linux64/libfmodex.so /X/src/openFrameworks/libs/kiss/lib/linux64/libkiss.a /X/src/openFrameworks/libs/tess2/lib/linux64/libtess2.a /X/src/openFrameworks/libs/poco/lib/linux64/libPocoNetSSL.a /X/src/openFrameworks/libs/poco/lib/linux64/libPocoNet.a /X/src/openFrameworks/libs/poco/lib/linux64/libPocoCrypto.a /X/src/openFrameworks/libs/poco/lib/linux64/libPocoUtil.a /X/src/openFrameworks/libs/poco/lib/linux64/libPocoJSON.a /X/src/openFrameworks/libs/poco/lib/linux64/libPocoXML.a /X/src/openFrameworks/libs/poco/lib/linux64/libPocoFoundation.a -lz -lgstapp-1.0 -lgstvideo-1.0 -lgstbase-1.0 -lgstreamer-1.0 -ludev -lfontconfig -lfreetype -lsndfile -lopenal -lpulse-simple -lpulse -lasound -lGLEW -lGLU -lGL -lgtk-3 -lgdk-3 -lpangocairo-1.0 -lpango-1.0 -latk-1.0 -lcairo-gobject -lcairo -lgdk_pixbuf-2.0 -lgio-2.0 -lgobject-2.0 -lglib-2.0 -lmpg123 -lglfw -lssl -lcrypto -lglut -lX11 -lXrandr -lXxf86vm -lXi -lXcursor -ldl -lpthread -lfreeimage -lrtaudio -lboost_filesystem -lboost_system


/home/fnpr/src/openFrameworks/libs/openFrameworksCompiled/lib/linux64/libopenFrameworksDebug.a(ofUtils.o): In function `ofLaunchBrowser(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, bool)':
/home/fnpr/src/openFrameworks/libs/openFrameworks/utils/ofUtils.cpp:827: undefined reference to `Poco::URI::URI(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)'
/home/fnpr/src/openFrameworks/libs/openFrameworks/utils/ofUtils.cpp:834: undefined reference to `Poco::URI::setQuery(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)'
/home/fnpr/src/openFrameworks/libs/openFrameworks/utils/ofUtils.cpp:842: undefined reference to `Poco::URI::toString[abi:cxx11]() const'
/home/fnpr/src/openFrameworks/libs/openFrameworks/utils/ofUtils.cpp:861: undefined reference to `Poco::URI::toString[abi:cxx11]() const'
/home/fnpr/src/openFrameworks/libs/openFrameworksCompiled/lib/linux64/libopenFrameworksDebug.a(ofImage.o): In function `bool loadImage<unsigned char>(ofPixels_<unsigned char>&, boost::filesystem::path const&, ofImageLoadSettings const&)':
/home/fnpr/src/openFrameworks/libs/openFrameworks/graphics/ofImage.cpp:190: undefined reference to `Poco::URI::URI(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)'
/home/fnpr/src/openFrameworks/libs/openFrameworksCompiled/lib/linux64/libopenFrameworksDebug.a(ofImage.o): In function `bool loadImage<unsigned short>(ofPixels_<unsigned short>&, boost::filesystem::path const&, ofImageLoadSettings const&)':
/home/fnpr/src/openFrameworks/libs/openFrameworks/graphics/ofImage.cpp:190: undefined reference to `Poco::URI::URI(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)'
/home/fnpr/src/openFrameworks/libs/openFrameworksCompiled/lib/linux64/libopenFrameworksDebug.a(ofImage.o): In function `bool loadImage<float>(ofPixels_<float>&, boost::filesystem::path const&, ofImageLoadSettings const&)':
/home/fnpr/src/openFrameworks/libs/openFrameworks/graphics/ofImage.cpp:190: undefined reference to `Poco::URI::URI(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)'
/home/fnpr/src/openFrameworks/libs/openFrameworksCompiled/lib/linux64/libopenFrameworksDebug.a(ofURLFileLoader.o): In function `ofURLFileLoaderImpl::ofURLFileLoaderImpl()':
/home/fnpr/src/openFrameworks/libs/openFrameworks/utils/ofURLFileLoader.cpp:78: undefined reference to `Poco::Net::Context::Context(Poco::Net::Context::Usage, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, Poco::Net::Context::VerificationMode, int, bool, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)'
/home/fnpr/src/openFrameworks/libs/openFrameworks/utils/ofURLFileLoader.cpp:83: undefined reference to `Poco::Exception::displayText[abi:cxx11]() const'
/home/fnpr/src/openFrameworks/libs/openFrameworks/utils/ofURLFileLoader.cpp:86: undefined reference to `Poco::Exception::displayText[abi:cxx11]() const'
/home/fnpr/src/openFrameworks/libs/openFrameworksCompiled/lib/linux64/libopenFrameworksDebug.a(ofURLFileLoader.o): In function `ofURLFileLoaderImpl::handleRequest(ofHttpRequest const&)':
/home/fnpr/src/openFrameworks/libs/openFrameworks/utils/ofURLFileLoader.cpp:172: undefined reference to `Poco::URI::URI(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)'
/home/fnpr/src/openFrameworks/libs/openFrameworks/utils/ofURLFileLoader.cpp:173: undefined reference to `Poco::URI::getPathAndQuery[abi:cxx11]() const'
/home/fnpr/src/openFrameworks/libs/openFrameworks/utils/ofURLFileLoader.cpp:177: undefined reference to `Poco::Net::HTTPRequest::HTTP_GET[abi:cxx11]'
/home/fnpr/src/openFrameworks/libs/openFrameworks/utils/ofURLFileLoader.cpp:179: undefined reference to `Poco::Net::HTTPRequest::HTTP_POST[abi:cxx11]'
/home/fnpr/src/openFrameworks/libs/openFrameworks/utils/ofURLFileLoader.cpp:181: undefined reference to `Poco::Net::HTTPMessage::HTTP_1_1[abi:cxx11]'
/home/fnpr/src/openFrameworks/libs/openFrameworks/utils/ofURLFileLoader.cpp:181: undefined reference to `Poco::Net::HTTPRequest::HTTPRequest(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)'
/home/fnpr/src/openFrameworks/libs/openFrameworks/utils/ofURLFileLoader.cpp:183: undefined reference to `Poco::Net::NameValueCollection::add(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)'
/home/fnpr/src/openFrameworks/libs/openFrameworks/utils/ofURLFileLoader.cpp:189: undefined reference to `Poco::Net::HTTPSClientSession::HTTPSClientSession(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, unsigned short)'
/home/fnpr/src/openFrameworks/libs/openFrameworks/utils/ofURLFileLoader.cpp:191: undefined reference to `Poco::Net::HTTPClientSession::HTTPClientSession(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, unsigned short)'
/home/fnpr/src/openFrameworks/libs/openFrameworks/utils/ofURLFileLoader.cpp:195: undefined reference to `Poco::Net::HTTPMessage::setContentType(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)'
/home/fnpr/src/openFrameworks/libs/openFrameworks/utils/ofURLFileLoader.cpp:227: undefined reference to `Poco::Exception::displayText[abi:cxx11]() const'
/home/fnpr/src/openFrameworks/libs/openFrameworks/utils/ofURLFileLoader.cpp:229: undefined reference to `Poco::Exception::displayText[abi:cxx11]() const'
clang-3.8: error: linker command failed with exit code 1 (use -v to see invocation)
Process failed with exit code 1.

I did run install_dependencies.sh, compileOF.sh, git submodule update --init --recursive, ./apothecary update core poco addons, ./install_template.sh, I pulled the latest apothecary changes, I deleted my build project folders, used clean all and rebuild, created new blank projects…

I see 11 .a files inside libs/poco/lib/linux64/ and lots of .h files inside libs/poco/include/Poco/.

Nothing I tried so far made it work. What can I try next?

that error happens because the libraries included in the repository are compiled with gcc4 not 5 install_dependencies should compile them but it’s leaving them in the wrong folder. you can download the last libraries for every platform (including gcc5 linux) here: http://ci.openframeworks.cc/libs just uncompress the .a in the libs/poco/lib/linux64 folder

2 Likes

Thank you! Copying them from scripts/ to libs/ was enough :slight_smile:

I have the following errors when i try to compile the example for ofxXmlSettings with some modifications. Have I to do the same thing that hamoid as well, and in that case, where i have to copy the libraries, which folder. Please help!!!

C:/OFram/of/libs/openFrameworksCompiled/lib/msys2/libopenFrameworks.a(ofAppGlutWindow.o):ofAppGlutWindow.cpp:(.text+0x157): undefined reference to _imp__glutGet@4' C:/OFram/of/libs/openFrameworksCompiled/lib/msys2/libopenFrameworks.a(ofAppGlutWindow.o):ofAppGlutWindow.cpp:(.text+0x1bb): undefined reference to_imp__glutGet@4’
C:/OFram/of/libs/openFrameworksCompiled/lib/msys2/libopenFrameworks.a(ofAppGlutWindow.o):ofAppGlutWindow.cpp:(.text+0x250): undefined reference to _imp__glutSetWindowTitle@4' C:/OFram/of/libs/openFrameworksCompiled/lib/msys2/libopenFrameworks.a(ofAppGlutWindow.o):ofAppGlutWindow.cpp:(.text+0x25a): undefined reference to_imp__glutPositionWindow@8’
C:/OFram/of/libs/openFrameworksCompiled/lib/msys2/libopenFrameworks.a(ofAppGlutWindow.o):ofAppGlutWindow.cpp:(.text+0x275): undefined reference to _imp__glutReshapeWindow@8' C:/OFram/of/libs/openFrameworksCompiled/lib/msys2/libopenFrameworks.a(ofAppGlutWindow.o):ofAppGlutWindow.cpp:(.text+0x29f): undefined reference to_imp__glutSetCursor@4’
C:/OFram/of/libs/openFrameworksCompiled/lib/msys2/libopenFrameworks.a(ofAppGlutWindow.o):ofAppGlutWindow.cpp:(.text+0x2b5): undefined reference to _imp__glutSetCursor@4' C:/OFram/of/libs/openFrameworksCompiled/lib/msys2/libopenFrameworks.a(ofAppGlutWindow.o):ofAppGlutWindow.cpp:(.text+0x2e5): undefined reference to_imp__glutGet@4’
C:/OFram/of/libs/openFrameworksCompiled/lib/msys2/libopenFrameworks.a(ofAppGlutWindow.o):ofAppGlutWindow.cpp:(.text+0x309): undefined reference to _imp__glutFullScreen@0' C:/OFram/of/libs/openFrameworksCompiled/lib/msys2/libopenFrameworks.a(ofAppGlutWindow.o):ofAppGlutWindow.cpp:(.text+0x326): undefined reference to_imp__glutReshapeWindow@8’
C:/OFram/of/libs/openFrameworksCompiled/lib/msys2/libopenFrameworks.a(ofAppGlutWindow.o):ofAppGlutWindow.cpp:(.text+0x355): undefined reference to _imp__glutPositionWindow@8' C:/OFram/of/libs/openFrameworksCompiled/lib/msys2/libopenFrameworks.a(ofAppGlutWindow.o):ofAppGlutWindow.cpp:(.text+0x400): undefined reference to_imp__glutSwapBuffers@0’
C:/OFram/of/libs/openFrameworksCompiled/lib/msys2/libopenFrameworks.a(ofAppGlutWindow.o):ofAppGlutWindow.cpp:(.text+0x603): undefined reference to _imp__glutPostRedisplay@0' C:/OFram/of/libs/openFrameworksCompiled/lib/msys2/libopenFrameworks.a(ofAppGlutWindow.o):ofAppGlutWindow.cpp:(.text+0xa09): undefined reference to_imp__glutMainLoop@0’
C:/OFram/of/libs/openFrameworksCompiled/lib/msys2/libopenFrameworks.a(ofAppGlutWindow.o):ofAppGlutWindow.cpp:(.text+0xa7c): undefined reference to _imp____glutInitWithExit@12' C:/OFram/of/libs/openFrameworksCompiled/lib/msys2/libopenFrameworks.a(ofAppGlutWindow.o):ofAppGlutWindow.cpp:(.text+0xaa7): undefined reference to_imp__glutInitDisplayString@4’
C:/OFram/of/libs/openFrameworksCompiled/lib/msys2/libopenFrameworks.a(ofAppGlutWindow.o):ofAppGlutWindow.cpp:(.text+0xab5): undefined reference to _imp__glutInitDisplayMode@4' C:/OFram/of/libs/openFrameworksCompiled/lib/msys2/libopenFrameworks.a(ofAppGlutWindow.o):ofAppGlutWindow.cpp:(.text+0xaf1): undefined reference to_imp__glutGet@4’
C:/OFram/of/libs/openFrameworksCompiled/lib/msys2/libopenFrameworks.a(ofAppGlutWindow.o):ofAppGlutWindow.cpp:(.text+0xb05): undefined reference to _imp__glutGet@4' C:/OFram/of/libs/openFrameworksCompiled/lib/msys2/libopenFrameworks.a(ofAppGlutWindow.o):ofAppGlutWindow.cpp:(.text+0xb19): undefined reference to_imp__glutInitWindowSize@8’
C:/OFram/of/libs/openFrameworksCompiled/lib/msys2/libopenFrameworks.a(ofAppGlutWindow.o):ofAppGlutWindow.cpp:(.text+0xb30): undefined reference to _imp____glutCreateWindowWithExit@8' C:/OFram/of/libs/openFrameworksCompiled/lib/msys2/libopenFrameworks.a(ofAppGlutWindow.o):ofAppGlutWindow.cpp:(.text+0xb5d): undefined reference to_imp__glutInitWindowSize@8’
C:/OFram/of/libs/openFrameworksCompiled/lib/msys2/libopenFrameworks.a(ofAppGlutWindow.o):ofAppGlutWindow.cpp:(.text+0xb74): undefined reference to _imp____glutCreateWindowWithExit@8' C:/OFram/of/libs/openFrameworksCompiled/lib/msys2/libopenFrameworks.a(ofAppGlutWindow.o):ofAppGlutWindow.cpp:(.text+0xb83): undefined reference to_imp__glutGet@4’
C:/OFram/of/libs/openFrameworksCompiled/lib/msys2/libopenFrameworks.a(ofAppGlutWindow.o):ofAppGlutWindow.cpp:(.text+0xb96): undefined reference to _imp__glutGet@4' C:/OFram/of/libs/openFrameworksCompiled/lib/msys2/libopenFrameworks.a(ofAppGlutWindow.o):ofAppGlutWindow.cpp:(.text+0xbc1): undefined reference to_imp__glutInitDisplayString@4’
C:/OFram/of/libs/openFrameworksCompiled/lib/msys2/libopenFrameworks.a(ofAppGlutWindow.o):ofAppGlutWindow.cpp:(.text+0xbd0): undefined reference to _imp__glutInitDisplayMode@4' C:/OFram/of/libs/openFrameworksCompiled/lib/msys2/libopenFrameworks.a(ofAppGlutWindow.o):ofAppGlutWindow.cpp:(.text+0xc08): undefined reference to_imp__glutGameModeString@4’
C:/OFram/of/libs/openFrameworksCompiled/lib/msys2/libopenFrameworks.a(ofAppGlutWindow.o):ofAppGlutWindow.cpp:(.text+0xc16): undefined reference to _imp__glutGameModeGet@4' C:/OFram/of/libs/openFrameworksCompiled/lib/msys2/libopenFrameworks.a(ofAppGlutWindow.o):ofAppGlutWindow.cpp:(.text+0xc8c): undefined reference to_imp__glutEnterGameMode@0’
C:/OFram/of/libs/openFrameworksCompiled/lib/msys2/libopenFrameworks.a(ofAppGlutWindow.o):ofAppGlutWindow.cpp:(.text+0xc99): undefined reference to _imp__glutGet@4' C:/OFram/of/libs/openFrameworksCompiled/lib/msys2/libopenFrameworks.a(ofAppGlutWindow.o):ofAppGlutWindow.cpp:(.text+0xcac): undefined reference to_imp__glutGet@4’
C:/OFram/of/libs/openFrameworksCompiled/lib/msys2/libopenFrameworks.a(ofAppGlutWindow.o):ofAppGlutWindow.cpp:(.text+0xe3a): undefined reference to _imp__glutMouseFunc@4' C:/OFram/of/libs/openFrameworksCompiled/lib/msys2/libopenFrameworks.a(ofAppGlutWindow.o):ofAppGlutWindow.cpp:(.text+0xe48): undefined reference to_imp__glutMotionFunc@4’
C:/OFram/of/libs/openFrameworksCompiled/lib/msys2/libopenFrameworks.a(ofAppGlutWindow.o):ofAppGlutWindow.cpp:(.text+0xe56): undefined reference to _imp__glutPassiveMotionFunc@4' C:/OFram/of/libs/openFrameworksCompiled/lib/msys2/libopenFrameworks.a(ofAppGlutWindow.o):ofAppGlutWindow.cpp:(.text+0xe64): undefined reference to_imp__glutIdleFunc@4’
C:/OFram/of/libs/openFrameworksCompiled/lib/msys2/libopenFrameworks.a(ofAppGlutWindow.o):ofAppGlutWindow.cpp:(.text+0xe72): undefined reference to _imp__glutDisplayFunc@4' C:/OFram/of/libs/openFrameworksCompiled/lib/msys2/libopenFrameworks.a(ofAppGlutWindow.o):ofAppGlutWindow.cpp:(.text+0xe80): undefined reference to_imp__glutKeyboardFunc@4’
C:/OFram/of/libs/openFrameworksCompiled/lib/msys2/libopenFrameworks.a(ofAppGlutWindow.o):ofAppGlutWindow.cpp:(.text+0xe8e): undefined reference to _imp__glutKeyboardUpFunc@4' C:/OFram/of/libs/openFrameworksCompiled/lib/msys2/libopenFrameworks.a(ofAppGlutWindow.o):ofAppGlutWindow.cpp:(.text+0xe9c): undefined reference to_imp__glutSpecialFunc@4’
C:/OFram/of/libs/openFrameworksCompiled/lib/msys2/libopenFrameworks.a(ofAppGlutWindow.o):ofAppGlutWindow.cpp:(.text+0xeaa): undefined reference to _imp__glutSpecialUpFunc@4' C:/OFram/of/libs/openFrameworksCompiled/lib/msys2/libopenFrameworks.a(ofAppGlutWindow.o):ofAppGlutWindow.cpp:(.text+0xeb8): undefined reference to_imp__glutReshapeFunc@4’
C:/OFram/of/libs/openFrameworksCompiled/lib/msys2/libopenFrameworks.a(ofAppGlutWindow.o):ofAppGlutWindow.cpp:(.text+0xec6): undefined reference to `_imp__glutEntryFunc@4’

For anyone who encounters this in the future,
I had issues with poco and fixed by following this: https://github.com/openframeworks/openFrameworks/issues/6041

The essential steps are to go into ofxPoco/addon_config.mk file and comment out ADDON_INCLUDES line, then remove or rename the /libs folder in ofxPoco as well

make clean then make worked for me after that