Error C2733 second C linkage of overloaded function after moving to OF 0.8.0

Hi

I’ve had a project working in 0.7.4 in VS2010 and I’ve made a hard decision to move all of my code to 0.8.0 to be up to date. I’ve had to recreate the project from scratch using projectGenerator (visual studio settings give me a headache… somehow xCode manages pretty well with all that C++ project configuration complexity). After i’ve recreated the project I’ve started to get strange error

Error C2733: ‘GetProcessInformation’ : second C linkage of overloaded function is not allowed

This error points to a header file in $(OF_CORE_PATH)/libs/quicktime/include/Processes.h. I cannot remove the file from external dependencies and only commenting out the code which defines GetProcessInformation makes the project compile successfuly. Does anyone know what might cause this issue? I’m a noob on Windows+VS and configuring the project.

openFrameworks supports Visual Studio 2012 only.
So, do you run it with VS2010 or VS2012?

I’m running it in Visual Studio 2012 Express for Windows Desktop

Was this ever resolved?

I’m also on Visual Studio 2012 Express. I was able to run some projects successfully, but I am now trying to port/run the ofxKinectNui (https://github.com/sadmb/ofxKinectNui) example and getting this “second C linkage” error.

I’ve also tried using the migrationToVS2012 bash script but it’s failing because it can’t find the “devenv” command.

I’m having the exact same problem. Any news about this?

My “solution” was to comment out the problematic definition. I know it’s not the proper way but I needed to continue with my project.

I just ran into the same issue. I think it has something to do with openFrameworks re-defining some VS/Windows constants, so if you include things like <windows.h> before ofMain.h, when ofMain.h is finally included and redefines things, it might conflict with other stuff already linked.

So in a nutshell my solution was to include ofMain.h at the top of the file where I had my other fancy includes that are calling more windows specific code. Which apparently won’t work well with ofxKinectNui as its specifically says “#include “kinect/nui/Kinect.h” // this should be before ofMain.h”

For further reference, my feeling is that the ofConstant.h file is messing around with some settings :

  
#ifdef TARGET_WIN32  
	//this is for TryEnterCriticalSection  
	//[http://www.zeroc.com/forums/help-center/351-ice-1-2-tryentercriticalsection-problem.html](http://www.zeroc.com/forums/help-center/351-ice-1-2-tryentercriticalsection-problem.html)  
	#ifndef _WIN32_WINNT  
		#define _WIN32_WINNT 0x500  
	#endif  
	#define WIN32_LEAN_AND_MEAN  
  
	#if (_MSC_VER)  
		#define NOMINMAX		  
		//[http://stackoverflow.com/questions/1904635/warning-c4003-and-errors-c2589-and-c2059-on-x-stdnumeric-limitsintmax](http://stackoverflow.com/questions/1904635/warning-c4003-and-errors-c2589-and-c2059-on-x-stdnumeric-limitsintmax)  
	#endif  
  

Hi I had the this same error while trying to run ofxEdsdk on windows. As I needed it to work I simply removed quicktime from OF, which was what was giving the problems.
Obviously this is not a good solution and it worked for me as I wasn’t using Quicktime.
It would be really good to get this fixed.
The idea of having the includes reordered might work well but I feel that it is also a quick and dirty hack that might lead into further confusion. I’ll recheck this trying to see if OF is redefining something which causes the problem.

Sorry guys,
I didn’t notice this thread.

I have solved this problem.
Check latest version.

For more information see below.

Thanks. :blush:

Just ran upon this in 0.8.1. My solution is also commenting out the line that gives the issue.

It appears that this is still an issue. I just ran into it attempting to build ofxKinectForWindows2 in vs2012 on win10. https://github.com/elliotwoods/ofxKinectForWindows2/issues/35

@braitsch I just ran into the exact same issue. However I’m using VS2015 but it has a version selector and I believe i’m in 2012 mode.

For the googlers out there – got this error in OF084 on Windows 8 in VS2012 when running ofxKinectForWindows2.

Commented out the line (i believe in processes.h) and boom up and running.