Poco error compiling HttpUtils

hi

Is there any detailed instructions or howto edit the makefiles for OF apart from the basic documentation in the website and the makefile itself?

I am trying to compile the example for HttpUtils from github. I have created the usual folder structure and copied the makefile plus added the addons.make but I get an error related to Poco library

… loads of stuff…
…/…/…/libs/poco/lib/linux/libPocoNet.a(DNS.o): In function Poco::Net::DNS::thisHost()': DNS.cpp:(.text+0xb93): undefined reference toPoco::Environment::nodeName()’
collect2: ld returned 1 exit status
make: *** [bin/httpUtilsExample] Error 1

any idea why this might be happening? I am in ubuntu maverick. Sorry I dont know much about makefiles, so many thanks in advance

enrike

are you using 0062 or the version from github?

it seems like you are missing a library, PocoNet. in the github version of OF it’s already included, in 0062 you’ll need to include it in:

USER_LIBS = -lPocoNet

thanks arturo, but same problem after adding USER_LIBS = -lPocoNet in 0.62 makefile

…/…/…/libs/poco/lib/linux/libPocoNet.a(SocketImpl.o):(.rodata._ZTIN4Poco3Net10SocketImplE[typeinfo for Poco::Net::SocketImpl]+0x8): undefined reference to typeinfo for Poco::RefCountedObject' ../../../libs/poco/lib/linux/libPocoNet.a(DNS.o): In functionPoco::Net::DNS::thisHost()’:
DNS.cpp:(.text+0xb93): undefined reference to `Poco::Environment::nodeName()’
collect2: ld returned 1 exit status
make: *** [bin/httpUtilsExample] Error 1

I just double checked and it seems to be that the structure of files is correct. I have
addons/ofxHttpUtils/src with all the httpUtils source files (from github btw), then a httpUtilsExample file with the makefile, addons.make and src folder with the source.

addons/ofxHttpUtils/src$ dir
ofxHttpTypes.h ofxHttpUtils.cpp ofxHttpUtils.h

addonsExamples/httpUtilsExample/src$ dir
main.cpp testApp.cpp testApp.h

addonsExamples/httpUtilsExample$ dir
addons.make bin makefile obj src

I downloaded the OF github version but it does not compile either, first I was missing OpenAL-dev then I get this

linking bin/httpUtilsExample 1
g++ -o bin/httpUtilsExample obj/Release/src/main.o obj/Release/src/testApp.o obj/Release/addons/ofxHttpUtils/src/ofxHttpUtils.o -L…/…/…/libs/fmodex/lib/linux -L…/…/…/libs/FreeImage/lib/linux -L…/…/…/libs/freetype/lib/linux -L…/…/…/libs/openFrameworksCompiled/lib/linux -L…/…/…/libs/poco/lib/linux -L…/…/…/libs/rtAudio/lib/linux -Wl,-rpath=./libs -lopenFrameworks …/…/…/addons/ofxOpenCv/libs/opencv/lib/linux/libopencv_calib3d.a …/…/…/addons/ofxOpenCv/libs/opencv/lib/linux/libopencv_contrib.a …/…/…/addons/ofxOpenCv/libs/opencv/lib/linux/libopencv_core.a …/…/…/addons/ofxOpenCv/libs/opencv/lib/linux/libopencv_features2d.a …/…/…/addons/ofxOpenCv/libs/opencv/lib/linux/libopencv_flann.a …/…/…/addons/ofxOpenCv/libs/opencv/lib/linux/libopencv_gpu.a …/…/…/addons/ofxOpenCv/libs/opencv/lib/linux/libopencv_haartraining_engine.a …/…/…/addons/ofxOpenCv/libs/opencv/lib/linux/libopencv_highgui.a …/…/…/addons/ofxOpenCv/libs/opencv/lib/linux/libopencv_imgproc.a …/…/…/addons/ofxOpenCv/libs/opencv/lib/linux/libopencv_lapack.a …/…/…/addons/ofxOpenCv/libs/opencv/lib/linux/libopencv_legacy.a …/…/…/addons/ofxOpenCv/libs/opencv/lib/linux/libopencv_ml.a …/…/…/addons/ofxOpenCv/libs/opencv/lib/linux/libopencv_objdetect.a …/…/…/addons/ofxOpenCv/libs/opencv/lib/linux/libopencv_video.a …/…/…/addons/ofxOpenCv/libs/opencv/lib/linux/libzlib.a …/…/…/addons/ofxOsc/libs/oscpack/lib/linux/liboscpack.a -lopencv_legacy -lopencv_haartraining_engine -lopencv_features2d -lopencv_calib3d -lopencv_objdetect -lopencv_imgproc -lopencv_video -lopencv_highgui -lopencv_ml -lopencv_legacy -lopencv_core -lopencv_lapack -lopencv_flann -lopencv_contrib -lopencv_gpu -lzlib -L…/…/…/addons/ofxOpenCv/libs/opencv/lib/linux/ -lfmodex -lfreeimage -lfreetype -lRtAudio …/…/…/libs/poco/lib/linux/libPocoNet.a …/…/…/libs/poco/lib/linux/libPocoXML.a …/…/…/libs/poco/lib/linux/libPocoUtil.a …/…/…/libs/poco/lib/linux/libPocoFoundation.a -pthread -lGLEW -lgstvideo-0.10 -lgstapp-0.10 -lgstbase-0.10 -lgstreamer-0.10 -lgobject-2.0 -lgmodule-2.0 -lxml2 -lgthread-2.0 -lrt -lglib-2.0 -ludev -lglut -lGL -lGLU -lasound -lopenal -lsndfile -lvorbis -lFLAC -logg
/usr/bin/ld: cannot find -lopenFrameworks
collect2: ld returned 1 exit status
make: *** [bin/httpUtilsExample] Error 1

sorry to be a p* in the a* but I am not sure how to solve this myself… is there any good post that explains this things somewhere in the forum? I have been searching but I dont see any tutorial or docs.

thanks

enrike

hey now it worked. I decided to try to add all the Poco libraries

USER_LIBS = -lPocoNet -lPocoUtil -lPocoXML -lPocoFoundation

this is with 0.62

yes, i didn’t remember but in linux you need to add libraries in the correct order if they depend on each other. Since PocoNet depends on PocoFoundation you need to set them one before the other when calling the linker. when youadded PocoNet only it was probably added at the end.

In the case of OF 007, the version from github. the problem seems to be that you need to run the install_dependencies.sh script again since the dependencies has changed, also it compiles the OF lib that was the error you were getting after installing the dependencies manually.