The addon of ofxOsc doesn't compile on the win7 VS2012.
“netdb.h”: No such file or directory. “pthread.h”: No such file or directory.
pinging @ofTheo
@QiangJi is this with the current master branch? ofxOsc has been upgraded yesterday.
Is because OF yesterday after the update, just cause can't compile.
After I check found that in the https://github.com/openframeworks/openFrameworks/tree/master/addons/ofxOsc/libs/oscpack/src/ip/posix the two files lack of "!defined( WIN32 ) && !defined( _WIN32 )".
that's correct, these are the posix files. windows should only see the ones in the win32 directory above. are you saying your VS project sees and tries to compile those files?
Yeah, because the two files without the macro definition.
afaik, this was previously not done with a macro, but with inclusion/linker settings in the project files. pinging @arturoc @openframeworks/windows
the rule is there in addons_config.mk:
ADDON_SOURCES_EXCLUDE += libs/oscpack/src/ip/posix/%
not sure why it wouldn't work, have you generated the project with the project generator? adding the addon manually to the project won't work
oh, i see previously, we had a patched version with ifdefs for windows in the posix files:
https://github.com/openframeworks/openFrameworks/blob/34877438b4d3bd13073ad3007a71c2af7070541f/addons/ofxOsc/libs/oscpack/src/ip/posix/NetworkingUtils.cpp
@QiangJi - could you see if you still have this issue with the current 0.9.0 release ( http://openframeworks.cc/download/ ) ?
I tested the osc example on Windows before we did the 0.9.0 release so the issue should be closed now.
To get back to this old issue: I'm getting the same error, using OF 0.9.3 and Visual Studio 2015, but only when I use the Visual Studio plugin to create a project using New -> project -> Openframeworks
After selecting to include ofxOsc and building the empty project, I get the same Cannot open include file: 'netdb.h': No such file or directory error. Same for pthread.h.
But when I use the project generator to create my new project and open it in Visual studio, it builds without any problems.
Tested using current versions of OF and VS
@arturoc is the below still true? adding the project even by right clicking on solution and going to openFrameworks addons and checking off ofxOsc gives me the same issue as above.
adding the addon manually to the project won't work
just to add to above, i went through all the project properties and seemed like the osc receiver example has a Debugging working directory of $(ProjectDir)/bin whereas the projected I generated previously (that originally didn't have ofxOsc but was then added after) had a working directory of \bin. Not sure what that means but it allowed it to compile. But then it would call abort() once it received an Osc message.
Windows 7, 64-bit, oF 0.9.3
Update: even trying to make a new blank project with the ofxOsc as an addon has the same error of finding netdb.h. But for some reason the example in the examples/addons folder works
Update 2: using the windows #if from the patch, lets it compile, but it calls abort() shortly after starting up in anything other than the example project.
Update 3: seems like the abort was unrelated to this issue, something to do with the huge window I was drawing and the while loop iterating through hasWaitingMessages().
i can confirm @javl findings. using the VS2015 new project method doesn't play nice with ofOSC. the project generator does. win10,x64
I can also confirm@javl and @5shekel
of_v0.9.8_vs_release still cannot add ofxOSC by vs mode. But it is do useful by projectGenerator. So anyone know what is the reason for it. Just because of include the wrong files or not?
Because I was a beginner in OF, so I fellow @arturoc post and add some line in two file and fix it.
file1 is: OF_ROOT\addons\ofxOsc\libs\oscpack\src\ip\posix\NetworkingUtils.cpp
file2 is: OF_ROOT\addons\ofxOsc\libs\oscpack\src\ip\posix\UdpSocket.cpp
adding content is :
/*position is below the first include line */
#if !defined( __WIN32__ ) && !defined( _WIN32 )
...
#endif
/*position is at end of line */
And the simple way is just not include "posix" in win32 application. How to? move from addons> ofxOSC> libs> oscpacks> src> ip> posix
I had the same problem. but I found the difference between the project generator's one and VS2015 plugin's one.
plugin's one's projectname.vcxproj.filters includes posix path.
But the project generator's one doesn't.
As a test, I removed the path and built. then It worked!