NetworkInitializer duplicate symbol ofxOsc with new POCO

sorry for asking ,does anyone had this trouble?
@bakercp, did you work with new version poco yet? the 1.5.x-1.6.0 has duplicate class NetworkInitializer
https://github.com/liquidzym/openFrameworks/issues/6

On windows (only), in the newer versions of Poco, lazy network initialization is now done by default in Poco’s Net class:

Unfortunately this happens outside of Poco’s namespace Poco::Net which means that it conflicts with : https://github.com/openframeworks/openFrameworks/blob/master/addons/ofxOsc/libs/oscpack/src/ip/NetworkingUtils.h#L45-L49

Currently in ofSketch and elsewhere, I explicitly instantiate the network for OF so we don’t require lazy network initialization.

So, two solutions are possible – configure apothecary to configure Poco to compile with the POCO_NO_AUTOMATIC_LIB_INIT define (though this prevents the initialization of openSSL on windows, etc), or modify oscpack to use a namespace or modify our local version.

I just did a bit more research on this. I think the best solution for OF is to compile Poco with POCO_NO_AUTOMATIC_LIB_INIT and then explicitly call any initialization that needs to be done during ofInit() in ofAppRunner.

Previously I said that OpenSSL is auto-inited on windows in poco, but actually that was just something the Poco team discussed somewhere (I can’t find the reference now) and hasn’t been implemented. Currently the only items that are auto-inited are the database connectors (which includes SQLite, which is now part of the OF Poco configuration) and the network, which we’ll need to manually initialize.

Anyway, that’s my report! :smile:

1 Like

@bakercp,wow,thank you so much for such details report,also did you notice that the new version of Poco 1.6.0
does have NetSSL_Win module besides NetSSL_OpenSSL,so i’m guessing i can using NetSSL_Win under the windows without openssl?

cheers
alex

Yes, theoretically you should be able to use NetSSL_Win (without OpenSSL). I haven’t tested it though. If you get it working without openssl that would be super! It will make compiling Poco on windows with apothecary a little easier … keep me posted.

Sorry for hopping on an old thread but I’m trying to get some stuff working in a bit of a rush and am stuck with Windows 8.1 and OSC. Is there a fix for this (just w/r/t to ofxOSC) that doesn’t involve rebuilding all of Poco?

I can add some defines and get to:

1>------ Build started: Project: uiExploration5_remote, Configuration: Release Win32 ------
1>     Creating library bin\uiExploration5_remote.lib and object bin\uiExploration5_remote.exp
1>ofxOscReceiver.obj : error LNK2001: unresolved external symbol "void __cdecl Poco::Net::uninitializeNetwork(void)" (?uninitializeNetwork@Net@Poco@@YAXXZ)
1>ofxOscSender.obj : error LNK2001: unresolved external symbol "void __cdecl Poco::Net::uninitializeNetwork(void)" (?uninitializeNetwork@Net@Poco@@YAXXZ)
1>main.obj : error LNK2001: unresolved external symbol "void __cdecl Poco::Net::uninitializeNetwork(void)" (?uninitializeNetwork@Net@Poco@@YAXXZ)
1>ofApp.obj : error LNK2001: unresolved external symbol "void __cdecl Poco::Net::uninitializeNetwork(void)" (?uninitializeNetwork@Net@Poco@@YAXXZ)
1>IpEndpointName.obj : error LNK2001: unresolved external symbol "void __cdecl Poco::Net::uninitializeNetwork(void)" (?uninitializeNetwork@Net@Poco@@YAXXZ)
1>NetworkingUtilsWin.obj : error LNK2001: unresolved external symbol "void __cdecl Poco::Net::uninitializeNetwork(void)" (?uninitializeNetwork@Net@Poco@@YAXXZ)
1>UdpSocketWin.obj : error LNK2001: unresolved external symbol "void __cdecl Poco::Net::uninitializeNetwork(void)" (?uninitializeNetwork@Net@Poco@@YAXXZ)
1>ofxOscParameterSync.obj : error LNK2001: unresolved external symbol "void __cdecl Poco::Net::uninitializeNetwork(void)" (?uninitializeNetwork@Net@Poco@@YAXXZ)
1>bin\uiExploration5_remote.exe : fatal error LNK1120: 1 unresolved externals

but that’s as far as I can get.

not best way to do it,but you can changed the NetworkInitializer::NetworkInitializer() to i.e NetworkInitializers::NetworkInitializers() in NetworkingUtils.h&NetworkingUtilsWin.cpp to avoid this issue.

Nice, that totally works :slight_smile:

I was trying to get everything just using the Poco struct but it was
getting really messy and I’m in a bit of a rush.