I am just trying to open a UDP socket (a Poco::Net::DatagramSocket) but I just can’t seem to get it to work. I keep getting “undefined reference” errors …
undefined reference to Poco::Timespan::SECONDS
undefined reference to `Poco::RefCountedObject::~RefCountedObject()
and a bunch of others. Something with linker options, perhaps? I get these errors on both Windows and Linux.
Q: Does anybody have a working OF example that opens a DatagramSocket - and if so, did you need to mess around with linker options and stuff?
normally this kind of error is just a matter of changing the order of the libraries in the linker options, try changing PocoNet and PocoFoundation order
are you on windows, linux or mac?
[quote author=“zach”]are you on windows, linux or mac?
Right now I’m on windows, so it looks a little different than on Linux but similar errors.
So on Windows, that would be under Project > Build Options > Linker settings.
I moved them around like this
and most of the errors did go away! Now I’m getting these two, though:
…\libs\poco\libs\libPocoFoundationmt.a(Environment.o):Environment.cpp:(.text+0x10ff)||undefined reference to `_GetAdaptersInfo@8’|
…\libs\poco\libs\libPocoFoundationmt.a(Environment.o):Environment.cpp:(.text+0x1233)||undefined reference to `_GetAdaptersInfo@8’|
add this to your other linker flags: -lIphlpapi
see this post: http://forum.openframeworks.cc/t/getadaptersinfo-link-error-when-using-poco::path-on-windows/1840/1
Its fixed in 0.061[/quote]
alright! thanks guys, will try,
Update: I did try. Not only did this solve my second problem, but it seems it fixed the first one too.
To further help somebody, maybe we could say that the fix is applied under
project > build options > linker settings > other linker options
Also you may need to select all builds (rather than just “release” or “debug” builds) by clicking on the project name in the tree view on the left of the “build options” window.
And then just add -liphlpapi to the bottom of the list.
Thanks for the information.
I really appreaciated it.
Helps me here.