Unable to compile PG generated project in VS 2015 on Windows 10

Here’s the compilation error

1>------ Build started: Project: openframeworksLib, Configuration: Debug Win32 ------
1>  ofSerial.cpp
1>C:\Dev\of_v0.8.4_vs_release\libs\openFrameworks\types\ofTypes.h(188): error C2061: syntax error: identifier '_Dynamic_tag'
1>  C:\Dev\of_v0.8.4_vs_release\libs\openFrameworks\types\ofTypes.h(203): note: see reference to class template instantiation 'ofPtr<T>' being compiled
1>C:\Dev\of_v0.8.4_vs_release\libs\openFrameworks\types\ofTypes.h(188): error C2535: 'ofPtr<T>::ofPtr(const ofPtr<Tp1> &)': member function already defined or declared
1>  C:\Dev\of_v0.8.4_vs_release\libs\openFrameworks\types\ofTypes.h(166): note: see declaration of 'ofPtr<T>::ofPtr'
1>  ofArduino.cpp
1>C:\Dev\of_v0.8.4_vs_release\libs\openFrameworks\types\ofTypes.h(188): error C2061: syntax error: identifier '_Dynamic_tag'
1>  C:\Dev\of_v0.8.4_vs_release\libs\openFrameworks\types\ofTypes.h(203): note: see reference to class template instantiation 'ofPtr<T>' being compiled
1>C:\Dev\of_v0.8.4_vs_release\libs\openFrameworks\types\ofTypes.h(188): error C2535: 'ofPtr<T>::ofPtr(const ofPtr<Tp1> &)': member function already defined or declared
1>  C:\Dev\of_v0.8.4_vs_release\libs\openFrameworks\types\ofTypes.h(166): note: see declaration of 'ofPtr<T>::ofPtr'
1>  ofVideoPlayer.cpp
1>c:\dev\of_v0.8.4_vs_release\libs\openframeworks\types\ofTypes.h(188): error C2061: syntax error: identifier '_Dynamic_tag'
1>  c:\dev\of_v0.8.4_vs_release\libs\openframeworks\types\ofTypes.h(203): note: see reference to class template instantiation 'ofPtr<T>' being compiled
1>c:\dev\of_v0.8.4_vs_release\libs\openframeworks\types\ofTypes.h(188): error C2535: 'ofPtr<T>::ofPtr(const ofPtr<Tp1> &)': member function already defined or declared
1>  c:\dev\of_v0.8.4_vs_release\libs\openframeworks\types\ofTypes.h(166): note: see declaration of 'ofPtr<T>::ofPtr'
1>c:\dev\of_v0.8.4_vs_release\libs\openframeworks\types\ofTypes.h(188): error C2535: 'ofPtr<ofBaseVideoPlayer>::ofPtr(const ofPtr<Tp1> &)': member function already defined or declared
1>  c:\dev\of_v0.8.4_vs_release\libs\openframeworks\types\ofTypes.h(166): note: see declaration of 'ofPtr<ofBaseVideoPlayer>::ofPtr'
1>c:\dev\of_v0.8.4_vs_release\libs\openframeworks\types\ofTypes.h(188): fatal error C1903: unable to recover from previous error(s); stopping compilation
1>  INTERNAL COMPILER ERROR in 'C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\bin\CL.exe'
1>      Please choose the Technical Support command on the Visual C++
1>      Help menu, or open the Technical Support help file for more information
2>------ Build started: Project: emptyExample, Configuration: Debug Win32 ------
2>  ofApp.cpp
2>c:\dev\of_v0.8.4_vs_release\libs\openframeworks\types\oftypes.h(188): error C2061: syntax error: identifier '_Dynamic_tag'
2>  c:\dev\of_v0.8.4_vs_release\libs\openframeworks\types\oftypes.h(203): note: see reference to class template instantiation 'ofPtr<T>' being compiled
2>c:\dev\of_v0.8.4_vs_release\libs\openframeworks\types\oftypes.h(188): error C2535: 'ofPtr<T>::ofPtr(const ofPtr<Tp1> &)': member function already defined or declared
2>  c:\dev\of_v0.8.4_vs_release\libs\openframeworks\types\oftypes.h(166): note: see declaration of 'ofPtr<T>::ofPtr'
2>c:\dev\of_v0.8.4_vs_release\libs\openframeworks\types\oftypes.h(188): error C2535: 'ofPtr<ofMesh>::ofPtr(const ofPtr<Tp1> &)': member function already defined or declared
2>  c:\dev\of_v0.8.4_vs_release\libs\openframeworks\types\oftypes.h(166): note: see declaration of 'ofPtr<ofMesh>::ofPtr'
2>c:\dev\of_v0.8.4_vs_release\libs\openframeworks\types\oftypes.h(188): fatal error C1903: unable to recover from previous error(s); stopping compilation
2>  INTERNAL COMPILER ERROR in 'C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\bin\CL.exe'
2>      Please choose the Technical Support command on the Visual C++
2>      Help menu, or open the Technical Support help file for more information
========== Build: 0 succeeded, 2 failed, 0 up-to-date, 0 skipped ==========

Most of the topics I found on this forum mention VS 2012, so I’m not really sure if this is a compatibility issue with 2015?

The master branch on GitHub should be compatible with 2015, at least oF itself. I haven’t tried the PG. I think the 0.8.4 download is only compatible with VS2012.

Thanks for pointing this out. I’ve managed to compile the master branch on VS 2015, though I didn’t manage to get any of the examples working, as they don’t have a VS project file. I’ve tried creating one from scratch, but there seems to be many include/linker paths that need to be specified, and doing that in the VS GUI doesn’t seem like the right way.

Is there a simple way to get a sample project up and running using the master branch? I’ve looked through the repo, but didn’t find any instructions anywhere. The only thing I found is the scripts/vs/setupCommandLine.cmd and compileAllExamples.cmd, but those don’t seem to work

On the other hand, running msbuild on .\libs\openFrameworksCompiled\project\vs\openframeworksLib.vcxproj does work, but as mentioned above, I’m not sure how to properly reference OF from an empty solution.

update: I’ve managed to get everything working with PG on the master branch (specifically I built the projectGeneratorSimple app), generated a project with it, and then built it in VS 2015. Though it kept trying to open the solution in VS 2013, which failed to build, but after explicitly opening in VS 2015 it worked.

But I’d still be curious if there’s a simple way to do this without the PG.

0.8.4 will not compile in 2015. The standards of the MSVC compiler changed somewhat significantly between 2012 to even 2013 and now to 2015. The master branch is still experimental but all the examples should build except for some of the addon ones. I believe ofxOSC is still broken and so is ofxNetwork at the time of this post.

To build an example, make an empty example with the project generator and replace the main.cpp, ofApp.h, and ofApp.cpp files in the src folder. The examples from 0.8.4 should still all build