Problem with Poco static libraries on Windows

I’ve been trying to set up a couple addons that use the Poco precompiled libraries from the latest github build. ofxAxisGrabber and ofxIpVideoGrabber. Both give the same issue on unresolved external symbols:

1>IPVideoGrabber.obj : error LNK2019: unresolved external symbol "public: void __thiscall Poco::Net::HTTPBasicCredentials::authenticate(class Poco::Net::HTTPRequest &)" (?authenticate@HTTPBasicCredentials@Net@Poco@@QAEXAAVHTTPRequest@23@@Z) referenced in function "protected: virtual void __thiscall ofx::Video::IPVideoGrabber::threadedFunction(void)" (?threadedFunction@IPVideoGrabber@Video@ofx@@MAEXXZ)

It’s been issued under ofxAxisGrabber but I thought this could be a problem with the OF libs. I wanted to get feedback here before issuing to the big repo. Thanks!

Using Windows 7 VS2012

1 Like

i’ve seen the issue but i don’t use windows usually so haven’t had the chance to test what’s going on, it seems like some symbol that exists in other platforms doesn’t exist in windows for some reason, it might be that the library is missing that symbol in windows but not idea why it might be

I think there’s a version mismatch between the headers files in the include folder and the compiled version of the poco library. If you look into the symbols into the .lib file, you can find the authenticate function, but it has a slightly different prototype (it says ?authenticate@HTTPBasicCredentials@Net@Poco@@QBEXAAVHTTPRequest@23@@Z instead ?authenticate@HTTPBasicCredentials@Net@Poco@@QAEXAAVHTTPRequest@23@@Z (notice the B instead of A))

Looking at POCO git history, HTTPRequest was updated 7 month ago, the same time the vs build of Poco was made, while on oF repo files is 3 years old…

Try to replace your file by this one (or in a more involved way, replace all the headers of your poco, but it will lead to trouble regarding Arturo’s patches):

it’s posible that poco for vs was compiled for a wrong version, every other platform uses 1.4.3p1

When I call:

printf("%x\n", Poco::Environment::libraryVersion());

it returns :0x1040601 which if I read it correctly, means that the vs2012 version of the Poco library is using the 1.4.6p1 version of Poco

mmh, yeah that seems like a bug, can you report it on github?

1 Like

thanks!

Great! I’ve built the latest poco release to see if I could use it as a workaround. I’ll let you know. I’ll check if it matches the required version.

Be careful with this approach, Arturo made some patch to the Poco event system that will probably break things in your oF distrib.

A sounder approach would be to use the exact same code as the one used to compile the lib for the other platforms.

i did some changes but it only affect some header files and it’s not used by poco itself so it’s safe to compile the source from the original code. indeed the libraries in other platforms were compiled before those changes

Oh I see what you mean.
When I wanted to compile oF with VS2013 I just got the latest release of Poco and replaced the previous headers with the new ones. It caused mayhem in my ofEvent so I had to put your modification back, hoping for the best. Not the safest way of proceeding, hence my warning to chucklepant

yes you’ll need those headersfor OF but it’s enough to compile the libraries and overwrite the binaries in lib/vs while leaving the headers that are already in OF.

if someone compiles the right version it would be super useful if you can send a PR or just post them somewhere so we can change them

I’m on it. I’m getting 1.4.3 from the poco github. I’ll let you know how it goes. (Yesterday I built 1.4.6 :|)

i would download it from sourceforge, the correct version is 1.4.3p1, which doesn’t appear in their github

Alright. One question, How do I add a windows folder to the Makefile given in the poco source?

I’ve got

INCLUDE += -I/usr/local/include/mysql/ -I/usr/include/mysql -I/usr/mysql/include/mysql -I/usr/local/mysql/include

And I want to add this directory

C:\Program Files\MySQL\MySQL Server 5.6\include

It has spaces and so on, I’m guessing I need quotes but not sure how to put it.

Thanks

we don’t include data so you should be able to compile it without mysql just by configuring it with --without-data or something like that

does vs version use makefiles though? i thought they included vs project files

yep my mistake, I was mixing things up. Using VS it’s done by deleting lines at the components file. I’ve disabled Data/MySQL, building the rest:

CppUnit
Foundation
XML
Util
Net
Crypto
NetSSL_OpenSSL
Data
Data/SQLite
Data/ODBC
Data/MySQL
Zip
PageCompiler
PageCompiler/File2Page

The build succeded, although some of the poco examples didn’t build. In OF I’m getting value '1600' doesn't match value '1700' with the new libraries. They are up in my OF fork in case someone wants to grab them and try

PocoFoundationmdd.lib(Bugcheck.obj) : error LNK2038: mismatch detected for '_MSC_VER': value '1600' doesn't match value '1700' in ofxBaseGui.obj
2>PocoFoundationmdd.lib(Exception.obj) : error LNK2038: mismatch detected for '_MSC_VER': value '1600' doesn't match value '1700' in ofxBaseGui.obj
2>PocoFoundationmdd.lib(Mutex.obj) : error LNK2038: mismatch detected for '_MSC_VER': value '1600' doesn't match value '1700' in ofxBaseGui.obj
2>PocoFoundationmdd.lib(AtomicCounter.obj) : error LNK2038: mismatch detected for '_MSC_VER': value '1600' doesn't match value '1700' in ofxBaseGui.obj 
> ...

Where can I set this?

Edit:
Fixed, I had to build for 2012 instead of 2010, 1.4.3p didn’t support 2012 out of the box, I guess when porting OF to 2012 the 1.4.6 was used because of the 2012 support, although headers weren’t exactly the same. I’ll try the 2012 builds and update here