getting OF VS2008 to compile in VS2010

Greetings,

We’re working on an official OF release for VS 2010 but in the meantime, since there’s now a free version of VS2010, it makes sense to explain how to compile the version of OF that’s online (VS2008) in VS2010. There are a few steps and things that can trip you up.

First, download these libraries:

http://www.openframeworks.cc/files/vs20-…-vs2010.zip

they are poco libraries compiled for vs2010. You will need to swap them for the libraries that have the same name in libs/poco/lib.

Next, there are few things to do when you import a project. There are a few things that I’d thought I’d point out about setting up VS2010 to work nicer.

[attachment=4:3b7seroa]a.png[/attachment:3b7seroa]

**(a) setup expert view (optional) **

First I recommend using the expert view – this gives the menu more options, like cleaning the project, etc.

[attachment=3:3b7seroa]b.png[/attachment:3b7seroa]

(b) add run without debugging to the toolbar (optional)

in addition, I’d add the “run without debugging” to your toolbar. This is an important button since if you compile in release you don’t always want to debug.

[attachment=2:3b7seroa]c.png[/attachment:3b7seroa]

(c) open a vs 2008 solution, it will ask you to convert it.

let’s do it! Since the project that builds openframeworks (the samples are dependent on the OF library project) is part of each solution it may access if you want to convert again, you can safely say no.

[attachment=1:3b7seroa]d.png[/attachment:3b7seroa]

(d) set VS to run the app from the right directory.

right click the project (on the left side, in the solution viewer) and click properties and bring up the properties dialog. make sure you are altering for *both* release and debug here. Add the /bin as pictured here, ie,

Properties > Configuration Profiles > debugging > Working Directory

should now say

$(ProjectDir)/bin

[attachment=0:3b7seroa]e.png[/attachment:3b7seroa]

(e) add the right name for the debug target

now, in the same properties window, make sure you are editing for only debug here (see the top left of that window, “configuration”). Add _debug to the TargetName,

Properties > Configuration Profiles > General > Target Name

should now say:

$(ProjectName)_debug

I know this is kind of janky : ) – we just wanted to throw up some instructions on how to do this until we post up an official vs 2010 release which should be **very** soon.

take care,
zach

PS on thing that I’ve noticed, is that VC continuously notes that projects are out of date (even when they are not) with a dialog prompt. I’m looking for a solution for this annoyance – you can safely click NO if you know you haven’t changed a project… This is one of the small things we’ll investigate how to remove for the VS 2010 package (and some googling reveals that other people see this after converting projects to vs 2010).

:cry: i failed…

2>oscpackd.lib(UdpSocket.obj) : error LNK2019: unresolved external symbol "__declspec(dllimport) public: void __thiscall std::_Container_base_secure::_Orphan_all(void)const " (__imp_?_Orphan_all@_Container_base_secure@std@@QBEXXZ) referenced in function “protected: void __thiscall std::vector<struct std::pair<class PacketListener *,class UdpSocket *>,class std::allocator<struct std::pair<class PacketListener *,class UdpSocket *> > >::_Tidy(void)” (?_Tidy@?$vector@U?$pair@PAVPacketListener@@PAVUdpSocket@@@std@@V?$allocator@U?$pair@PAVPacketListener@@PAVUdpSocket@@@std@@@2@@std@@IAEXXZ)

2>oscpackd.lib(UdpSocket.obj) : error LNK2019: unresolved external symbol “__declspec(dllimport) public: __thiscall std::_Container_base_secure::~_Container_base_secure(void)” (__imp_??1_Container_base_secure@std@@QAE@XZ) referenced in function “protected: __thiscall std::_Container_base_aux_alloc_empty<class std::allocator<struct std::pair<class PacketListener *,class UdpSocket *> > >::~_Container_base_aux_alloc_empty<class std::allocator<struct std::pair<class PacketListener *,class UdpSocket *> > >(void)” (??1?$_Container_base_aux_alloc_empty@V?$allocator@U?$pair@PAVPacketListener@@PAVUdpSocket@@@std@@@std@@@std@@IAE@XZ)

2>oscpackd.lib(UdpSocket.obj) : error LNK2019: unresolved external symbol “__declspec(dllimport) public: __thiscall std::_Container_base_secure::_Container_base_secure(void)” (__imp_??0_Container_base_secure@std@@QAE@XZ) referenced in function “protected: __thiscall std::_Container_base_aux_alloc_empty<class std::allocator<struct std::pair<class PacketListener *,class UdpSocket *> > >::_Container_base_aux_alloc_empty<class std::allocator<struct std::pair<class PacketListener *,class UdpSocket *> > >(class std::allocator<struct std::pair<class PacketListener *,class UdpSocket *> >)” (??0?$_Container_base_aux_alloc_empty@V?$allocator@U?$pair@PAVPacketListener@@PAVUdpSocket@@@std@@@std@@@std@@IAE@V?$allocator@U?$pair@PAVPacketListener@@PAVUdpSocket@@@std@@@1@@Z)

Build: 1 succeeded, 1 failed, 0 up-to-date, 0 skipped

oh sorry – I hadn’t looked at the libs for the addons (oscpack and opencv) – I’ll take a look as they also might need to be updated, and the error you are seeing seems to be about the oscpack lib.

do the other examples (empty example, drawing example, etc) work for you?

  • z

emptyExample is ok

wait for your official vs 2010 release :slight_smile:

we’re working through an official 2010 release, but in case you are anxious to try, here’s oscpack libraries compiled for vs2010:

openFrameworks.cc/files/vs2010/oscpack_swap_for_vs2010.zip

if you follow the same steps as for poco, you should be able to fix the problem you have.

take care,
zach

I follow yous steps, and I replaced the Poco libs. I am getting the following error when Building a project:

  
  
Error	1	error LNK2038: mismatch detected for '_ITERATOR_DEBUG_LEVEL': value '2' doesn't match value '0' in Figure.obj	D:\Documents\Projects\of_preRelease_v0061_vs2008_FAT\apps\examples\jidmo\PocoFoundationmtd.lib(Mutex.obj)	jidmo  
  
Warning	2	warning LNK4075: ignoring '/EDITANDCONTINUE' due to '/OPT:ICF' specification	D:\Documents\Projects\of_preRelease_v0061_vs2008_FAT\apps\examples\jidmo\PocoFoundationmtd.lib(Mutex.obj)	jidmo  
  
Error	3	error LNK2038: mismatch detected for '_ITERATOR_DEBUG_LEVEL': value '2' doesn't match value '0' in Figure.obj	D:\Documents\Projects\of_preRelease_v0061_vs2008_FAT\apps\examples\jidmo\PocoFoundationmtd.lib(Bugcheck.obj)	jidmo  
  
Error	4	error LNK2038: mismatch detected for '_ITERATOR_DEBUG_LEVEL': value '2' doesn't match value '0' in Figure.obj	D:\Documents\Projects\of_preRelease_v0061_vs2008_FAT\apps\examples\jidmo\PocoFoundationmtd.lib(Exception.obj)	jidmo  
  

… there are 18 errors like those. related to the same file PocoFoundationmtd.lib
By the way, this happens when building in Release mode. Debug release is ok.

Can anybody help me?
Thanks!

can you try to clean and do a full rebuild?

does that problem happen in debug and release?

thanks,
zach

I tried many times to Clean (I also went to the folders and deleted everything in Bin folder…), and then Build, Rebuild, etc… but always got the same errors.
These errors are ONLY for Release build. The Debug build works fine.
Thanks!

Hi,

After following these steps, I was able to get VS2010 to compile an allAddonsExample project…

However, I’m getting linking errors when I try to use the ofVideoGrabber class… even simply declaring an object of this class will bug out the compiler…

I tried the same code in CodeBlocks and it did compile… so possibly we need another file swap?

Cheers

EDIT: I did manage to compile an emptyExample with a declared ofVideoGrabber inside… so I might have been mistaken before…

Now, I’m gonna try to either compile the allAddonsExample with the video grabber or include the openCV addon into the emptyExample…

let’s see what happens :wink:

Cheers

Hi,

Just wondering if there is a status update for an official visual studio 2010 release.

I followed the instructions in this thread but came up against errors compiling rtAudioD.lib, I assume for the same reasons.

PS. I tried to find and download express 2008 but it looks like they’ve replaced it with 2010.

Steve

Bump for VS2010 release? I work with vs2010 and have neither been able to get these instructions to work (can’t run - VC90.DebugCRT not found according to event log) nor get it working now with 2008 - too many shared components I think. I did have it working ages ago on vs2008 before I ever migrated to 2010. An official release would be great.

Any news on the 2010 version?

I tried to follow the instructions, but with no luck.

Thanks,

Richard.

Hi, I have followed these instructions and I can compile most of the examples however the openCV example debug exe fails to open.
The alert is ‘The application has failed to start because its side-by-side configuration is incorrect’. The release works fine.

I am a complete noob at this so any help would be appreciated :?

you can clone lastest source from github,should be compiled with vs2010.

I downloaded OF v0.07 on my Win7 x64 machine with VS 2010 Ultimate.

Here is what I get when I try to build the emptyExample in Debug:

  
2>------ Build started: Project: emptyExample, Configuration: Debug Win32 ------  
2>Build started 10/18/2011 2:42:20 PM.  
2>InitializeBuildStatus:  
2>  Touching "obj\Debug\emptyExample.unsuccessfulbuild".  
2>ClCompile:  
2>  All outputs are up-to-date.  
2>ManifestResourceCompile:  
2>  All outputs are up-to-date.  
2>PocoFoundationmdd.lib(LocalDateTime.obj) : error LNK2038: mismatch detected for '_ITERATOR_DEBUG_LEVEL': value '2' doesn't match value '0' in main.obj  
2>PocoFoundationmdd.lib(DateTimeFormatter.obj) : error LNK2038: mismatch detected for '_ITERATOR_DEBUG_LEVEL': value '2' doesn't match value '0' in main.obj  
2>PocoFoundationmdd.lib(StringTokenizer.obj) : error LNK2038: mismatch detected for '_ITERATOR_DEBUG_LEVEL': value '2' doesn't match value '0' in main.obj  
2>PocoFoundationmdd.lib(Ascii.obj) : error LNK2038: mismatch detected for '_ITERATOR_DEBUG_LEVEL': value '2' doesn't match value '0' in main.obj  
2>PocoFoundationmdd.lib(Exception.obj) : error LNK2038: mismatch detected for '_ITERATOR_DEBUG_LEVEL': value '2' doesn't match value '0' in main.obj  
2>PocoFoundationmdd.lib(Bugcheck.obj) : error LNK2038: mismatch detected for '_ITERATOR_DEBUG_LEVEL': value '2' doesn't match value '0' in main.obj  
2>PocoFoundationmdd.lib(AtomicCounter.obj) : error LNK2038: mismatch detected for '_ITERATOR_DEBUG_LEVEL': value '2' doesn't match value '0' in main.obj  
2>PocoFoundationmdd.lib(Mutex.obj) : error LNK2038: mismatch detected for '_ITERATOR_DEBUG_LEVEL': value '2' doesn't match value '0' in main.obj  
2>PocoFoundationmdd.lib(File.obj) : error LNK2038: mismatch detected for '_ITERATOR_DEBUG_LEVEL': value '2' doesn't match value '0' in main.obj  
2>PocoFoundationmdd.lib(Path.obj) : error LNK2038: mismatch detected for '_ITERATOR_DEBUG_LEVEL': value '2' doesn't match value '0' in main.obj  
2>PocoFoundationmdd.lib(Condition.obj) : error LNK2038: mismatch detected for '_ITERATOR_DEBUG_LEVEL': value '2' doesn't match value '0' in main.obj  
2>PocoFoundationmdd.lib(URI.obj) : error LNK2038: mismatch detected for '_ITERATOR_DEBUG_LEVEL': value '2' doesn't match value '0' in main.obj  
2>PocoFoundationmdd.lib(Timespan.obj) : error LNK2038: mismatch detected for '_ITERATOR_DEBUG_LEVEL': value '2' doesn't match value '0' in main.obj  
2>PocoFoundationmdd.lib(Event.obj) : error LNK2038: mismatch detected for '_ITERATOR_DEBUG_LEVEL': value '2' doesn't match value '0' in main.obj  
2>PocoFoundationmdd.lib(DateTime.obj) : error LNK2038: mismatch detected for '_ITERATOR_DEBUG_LEVEL': value '2' doesn't match value '0' in main.obj  
2>PocoFoundationmdd.lib(Timestamp.obj) : error LNK2038: mismatch detected for '_ITERATOR_DEBUG_LEVEL': value '2' doesn't match value '0' in main.obj  
2>PocoFoundationmdd.lib(Timezone.obj) : error LNK2038: mismatch detected for '_ITERATOR_DEBUG_LEVEL': value '2' doesn't match value '0' in main.obj  
2>PocoFoundationmdd.lib(NumberFormatter.obj) : error LNK2038: mismatch detected for '_ITERATOR_DEBUG_LEVEL': value '2' doesn't match value '0' in main.obj  
2>PocoFoundationmdd.lib(DateTimeFormat.obj) : error LNK2038: mismatch detected for '_ITERATOR_DEBUG_LEVEL': value '2' doesn't match value '0' in main.obj  
2>PocoFoundationmdd.lib(Debugger.obj) : error LNK2038: mismatch detected for '_ITERATOR_DEBUG_LEVEL': value '2' doesn't match value '0' in main.obj  
2>PocoFoundationmdd.lib(UnicodeConverter.obj) : error LNK2038: mismatch detected for '_ITERATOR_DEBUG_LEVEL': value '2' doesn't match value '0' in main.obj  
2>PocoFoundationmdd.lib(DirectoryIterator.obj) : error LNK2038: mismatch detected for '_ITERATOR_DEBUG_LEVEL': value '2' doesn't match value '0' in main.obj  
2>PocoFoundationmdd.lib(Environment.obj) : error LNK2038: mismatch detected for '_ITERATOR_DEBUG_LEVEL': value '2' doesn't match value '0' in main.obj  
2>PocoFoundationmdd.lib(NumberParser.obj) : error LNK2038: mismatch detected for '_ITERATOR_DEBUG_LEVEL': value '2' doesn't match value '0' in main.obj  
2>PocoFoundationmdd.lib(UTF8Encoding.obj) : error LNK2038: mismatch detected for '_ITERATOR_DEBUG_LEVEL': value '2' doesn't match value '0' in main.obj  
2>PocoFoundationmdd.lib(TextIterator.obj) : error LNK2038: mismatch detected for '_ITERATOR_DEBUG_LEVEL': value '2' doesn't match value '0' in main.obj  
2>PocoFoundationmdd.lib(UTF16Encoding.obj) : error LNK2038: mismatch detected for '_ITERATOR_DEBUG_LEVEL': value '2' doesn't match value '0' in main.obj  
2>PocoFoundationmdd.lib(TextConverter.obj) : error LNK2038: mismatch detected for '_ITERATOR_DEBUG_LEVEL': value '2' doesn't match value '0' in main.obj  
2>PocoFoundationmdd.lib(TextEncoding.obj) : error LNK2038: mismatch detected for '_ITERATOR_DEBUG_LEVEL': value '2' doesn't match value '0' in main.obj  
2>PocoFoundationmdd.lib(RWLock.obj) : error LNK2038: mismatch detected for '_ITERATOR_DEBUG_LEVEL': value '2' doesn't match value '0' in main.obj  
2>PocoFoundationmdd.lib(Windows1252Encoding.obj) : error LNK2038: mismatch detected for '_ITERATOR_DEBUG_LEVEL': value '2' doesn't match value '0' in main.obj  
2>PocoFoundationmdd.lib(Latin9Encoding.obj) : error LNK2038: mismatch detected for '_ITERATOR_DEBUG_LEVEL': value '2' doesn't match value '0' in main.obj  
2>PocoFoundationmdd.lib(Latin1Encoding.obj) : error LNK2038: mismatch detected for '_ITERATOR_DEBUG_LEVEL': value '2' doesn't match value '0' in main.obj  
2>PocoFoundationmdd.lib(ASCIIEncoding.obj) : error LNK2038: mismatch detected for '_ITERATOR_DEBUG_LEVEL': value '2' doesn't match value '0' in main.obj  
2>PocoNetmdd.lib(HTTPStreamFactory.obj) : error LNK2038: mismatch detected for '_ITERATOR_DEBUG_LEVEL': value '2' doesn't match value '0' in main.obj  
2>PocoNetmdd.lib(HTTPClientSession.obj) : error LNK2038: mismatch detected for '_ITERATOR_DEBUG_LEVEL': value '2' doesn't match value '0' in main.obj  
2>PocoNetmdd.lib(HTTPRequest.obj) : error LNK2038: mismatch detected for '_ITERATOR_DEBUG_LEVEL': value '2' doesn't match value '0' in main.obj  
2>PocoNetmdd.lib(HTTPResponse.obj) : error LNK2038: mismatch detected for '_ITERATOR_DEBUG_LEVEL': value '2' doesn't match value '0' in main.obj  
2>PocoNetmdd.lib(HTTPSession.obj) : error LNK2038: mismatch detected for '_ITERATOR_DEBUG_LEVEL': value '2' doesn't match value '0' in main.obj  
2>PocoNetmdd.lib(HTTPMessage.obj) : error LNK2038: mismatch detected for '_ITERATOR_DEBUG_LEVEL': value '2' doesn't match value '0' in main.obj  
2>PocoNetmdd.lib(NetException.obj) : error LNK2038: mismatch detected for '_ITERATOR_DEBUG_LEVEL': value '2' doesn't match value '0' in main.obj  
2>PocoNetmdd.lib(HTTPIOStream.obj) : error LNK2038: mismatch detected for '_ITERATOR_DEBUG_LEVEL': value '2' doesn't match value '0' in main.obj  
2>PocoNetmdd.lib(NameValueCollection.obj) : error LNK2038: mismatch detected for '_ITERATOR_DEBUG_LEVEL': value '2' doesn't match value '0' in main.obj  
2>PocoNetmdd.lib(SocketAddress.obj) : error LNK2038: mismatch detected for '_ITERATOR_DEBUG_LEVEL': value '2' doesn't match value '0' in main.obj  
2>PocoNetmdd.lib(IPAddress.obj) : error LNK2038: mismatch detected for '_ITERATOR_DEBUG_LEVEL': value '2' doesn't match value '0' in main.obj  
2>PocoNetmdd.lib(HTTPStream.obj) : error LNK2038: mismatch detected for '_ITERATOR_DEBUG_LEVEL': value '2' doesn't match value '0' in main.obj  
2>PocoNetmdd.lib(HTTPFixedLengthStream.obj) : error LNK2038: mismatch detected for '_ITERATOR_DEBUG_LEVEL': value '2' doesn't match value '0' in main.obj  
2>PocoNetmdd.lib(HTTPChunkedStream.obj) : error LNK2038: mismatch detected for '_ITERATOR_DEBUG_LEVEL': value '2' doesn't match value '0' in main.obj  
2>PocoNetmdd.lib(HTTPHeaderStream.obj) : error LNK2038: mismatch detected for '_ITERATOR_DEBUG_LEVEL': value '2' doesn't match value '0' in main.obj  
2>PocoNetmdd.lib(MessageHeader.obj) : error LNK2038: mismatch detected for '_ITERATOR_DEBUG_LEVEL': value '2' doesn't match value '0' in main.obj  
2>PocoNetmdd.lib(HTTPCookie.obj) : error LNK2038: mismatch detected for '_ITERATOR_DEBUG_LEVEL': value '2' doesn't match value '0' in main.obj  
2>PocoNetmdd.lib(StreamSocket.obj) : error LNK2038: mismatch detected for '_ITERATOR_DEBUG_LEVEL': value '2' doesn't match value '0' in main.obj  
2>PocoNetmdd.lib(Socket.obj) : error LNK2038: mismatch detected for '_ITERATOR_DEBUG_LEVEL': value '2' doesn't match value '0' in main.obj  
2>PocoNetmdd.lib(HTTPBufferAllocator.obj) : error LNK2038: mismatch detected for '_ITERATOR_DEBUG_LEVEL': value '2' doesn't match value '0' in main.obj  
2>PocoNetmdd.lib(SocketImpl.obj) : error LNK2038: mismatch detected for '_ITERATOR_DEBUG_LEVEL': value '2' doesn't match value '0' in main.obj  
2>PocoNetmdd.lib(MediaType.obj) : error LNK2038: mismatch detected for '_ITERATOR_DEBUG_LEVEL': value '2' doesn't match value '0' in main.obj  
2>PocoNetmdd.lib(HostEntry.obj) : error LNK2038: mismatch detected for '_ITERATOR_DEBUG_LEVEL': value '2' doesn't match value '0' in main.obj  
2>PocoNetmdd.lib(DNS.obj) : error LNK2038: mismatch detected for '_ITERATOR_DEBUG_LEVEL': value '2' doesn't match value '0' in main.obj  
2>PocoNetmdd.lib(StreamSocketImpl.obj) : error LNK2038: mismatch detected for '_ITERATOR_DEBUG_LEVEL': value '2' doesn't match value '0' in main.obj  
2>PocoFoundationmdd.lib(URIStreamFactory.obj) : error LNK2038: mismatch detected for '_ITERATOR_DEBUG_LEVEL': value '2' doesn't match value '0' in main.obj  
2>PocoFoundationmdd.lib(URIStreamOpener.obj) : error LNK2038: mismatch detected for '_ITERATOR_DEBUG_LEVEL': value '2' doesn't match value '0' in main.obj  
2>PocoFoundationmdd.lib(CountingStream.obj) : error LNK2038: mismatch detected for '_ITERATOR_DEBUG_LEVEL': value '2' doesn't match value '0' in main.obj  
2>PocoFoundationmdd.lib(Base64Encoder.obj) : error LNK2038: mismatch detected for '_ITERATOR_DEBUG_LEVEL': value '2' doesn't match value '0' in main.obj  
2>PocoFoundationmdd.lib(DateTimeParser.obj) : error LNK2038: mismatch detected for '_ITERATOR_DEBUG_LEVEL': value '2' doesn't match value '0' in main.obj  
2>PocoFoundationmdd.lib(RefCountedObject.obj) : error LNK2038: mismatch detected for '_ITERATOR_DEBUG_LEVEL': value '2' doesn't match value '0' in main.obj  
2>PocoFoundationmdd.lib(MemoryPool.obj) : error LNK2038: mismatch detected for '_ITERATOR_DEBUG_LEVEL': value '2' doesn't match value '0' in main.obj  
2>PocoFoundationmdd.lib(FileStreamFactory.obj) : error LNK2038: mismatch detected for '_ITERATOR_DEBUG_LEVEL': value '2' doesn't match value '0' in main.obj  
2>PocoFoundationmdd.lib(FileStream.obj) : error LNK2038: mismatch detected for '_ITERATOR_DEBUG_LEVEL': value '2' doesn't match value '0' in main.obj  
2>     Creating library bin\emptyExample_debug.lib and object bin\emptyExample_debug.exp  
2>LINK : warning LNK4098: defaultlib 'MSVCRT' conflicts with use of other libs; use /NODEFAULTLIB:library  
2>bin\emptyExample_debug.exe : fatal error LNK1319: 68 mismatches detected  
2>  
2>Build FAILED.  

I get the same error with rtAudioD.lib in other projects.

The release version works just fine, in the empty example and in other projects. This is the opposite of what other people have mentioned in this thread.

The link error seems to indicate that some Debug libraries in the official v0.07 VS2010 (pre)release were compiled in a Release configuration. Is this true, is this possible? I have deployed OF v0.07 VS2010 on a few Win32 machines (Vista and XP), and this is the first time I have out-of-the-box problems. Any clues?

OK I fixed my problems by rebuilding the Poco libraries myself.
The filenames and the include files are the same as those used by OF, so it is very easy to do it.

http://pocoproject.org/download/index.html
Building the libraries can be done using VS project files, or a single script to be run in the VS Command Prompt. Takes forever but … does everything!

It looks like that’s the way I’ll have to deal with all other linktime issues :frowning:

EDIT: turns out I didn’t have to rebuild all the libs. The solution is to modify your Debug configuration’s Preprocessor (Configuration Properties -> C/C++ -> Preprocessor -> Processor Definitions) to NOT “inherit from parent or project defaults”. You will also have to do it for the openframeworksLib project. This gets rid of the troublesome _SECURE_SCL=0 and _HAS_ITERATOR_DEBUGGING=0 declarations.