Author Topic: Compiling under Visual Studio 2012  (Read 11095 times)

Offline aybe

  • Squaddie
  • *
  • Posts: 2
    • View Profile
Compiling under Visual Studio 2012
« on: December 06, 2013, 06:56:56 pm »
I've been trying to build it under VS2012, it builds fine but cannot be debugged because it complains of MSVCP100D.DLL not being found. I've installed VS2010 and the error is gone but an access violation is thrown as soon as the program is ran. Using depends.exe on the executable shows that VS2010 has been used but I'm not entirely sure about what's causing this.

I've asked a question at SO : https://stackoverflow.com/questions/20427920/upgrading-a-vs2010-project-results-in-0xc0000005-access-violation-reading-loca

Do you know if this could be the solution ?

Thanks for your help  :D

Offline Yankes

  • Global Moderator
  • Commander
  • *****
  • Posts: 3350
    • View Profile
Re: Compiling under Visual Studio 2012
« Reply #1 on: December 06, 2013, 09:02:32 pm »
it could be cased by precompiled libraries that are from previous version of VS

Offline SupSuper

  • Lazy Developer
  • Administrator
  • Commander
  • *****
  • Posts: 2162
    • View Profile
Re: Compiling under Visual Studio 2012
« Reply #2 on: December 06, 2013, 09:12:48 pm »
This answer covered it:
Quote
Ensure all(!) libraries are compiled with the same compiler and with compatible(!) switches (Eg: not mixing debug and release)

Because of how C++ works, you need to build yaml-cpp yourself in VS2012, and don't mix Debug and Release, so everything matches. Otherwise the differing C++ runtimes will conflict and cause weird crashes like that.

(this doesn't affect SDL because it's a C library)

Offline aybe

  • Squaddie
  • *
  • Posts: 2
    • View Profile
Re: Compiling under Visual Studio 2012
« Reply #3 on: December 07, 2013, 10:01:08 pm »
Alright  thanks!

Offline BlackLibrary

  • Colonel
  • ****
  • Posts: 133
    • View Profile
Re: Compiling under Visual Studio 2012
« Reply #4 on: March 18, 2014, 10:51:55 pm »
Attempting to build with VS 2012. 

Getting the following error:
error C1083: Cannot open include file: 'yaml-cpp/yaml.h': No such file or directory   

Steps to recreate:
Downloaded source from Git.
Rebuilt the solution for VS 2012.

I can only assume there are files that need to get moved into a specific place.  Not sure what files and where to find them, and where they should go.

Be gentle, I'm new to C++ completely.
« Last Edit: March 18, 2014, 10:54:45 pm by BlackLibrary »

Offline Shoes

  • Commander
  • *****
  • Posts: 502
    • View Profile

Offline BlackLibrary

  • Colonel
  • ****
  • Posts: 133
    • View Profile
Re: Compiling under Visual Studio 2012
« Reply #6 on: March 19, 2014, 04:04:40 am »
I later installed the pre-compiled dependencies.  I got the following error:

The element 'PropertyGroup' in namespace 'https://schemas.microsoft.com/developer/msbuild/2003' has invalid child element 'YieldDuringToolExecution' in namespace 'https://schemas.microsoft.com/developer/msbuild/2003'. List of possible elements expected: 'Property, AllowUnsafeBlocks, AppConfigForCompiler, ApplicationIcon, ApplicationRevision, ApplicationVersion, AppDesignerFolder, AspNetConfiguration, AssemblyKeyContainerName, AssemblyKeyProviderName, AssemblyName, AssemblyOriginatorKeyFile, AssemblyOriginatorKeyFileType, AssemblyOriginatorKeyMode, AssemblyType, AutorunEnabled, BaseAddress, BootstrapperComponentsLocation, BootstrapperComponentsUrl, BootstrapperEnabled, CharacterSet, CheckForOverflowUnderflow, CLRSupport, UseDebugLibraries, CodePage, Configuration, ConfigurationName, ConfigurationOverrideFile, CreateDesktopShortcut, CreateWebPageOnPublish, CurrentSolutionConfigurationContents, DebugSecurityZoneURL, DebugSymbols, DebugType, DefaultClientScript, DefaultHTMLPageLayout, DefaultTargetSchema, DefineConstants, DefineDebug, DefineTrace, DelaySign, DisableLangXtns, DisallowUrlActivation, CodeAnalysisAdditionalOptions, CodeAnalysisApplyLogFileXsl, CodeAnalysisConsoleXsl, CodeAnalysisCulture, CodeAnalysisFailOnMissingRules, CodeAnalysisForceOutput, Co....   C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V110\Microsoft.CppCommon.targets   

This error plus 100 others, actually.  I'm sure its something simple...

I was busy at work and just saw your response.  Shoes, thanks for being gentle with me on that, btw...

1.  Should I have not used the precompiled deps? 
2.  Where do I find the correct lib files to place in the deps folder?
« Last Edit: March 19, 2014, 04:06:41 am by BlackLibrary »

Offline Warboy1982

  • Administrator
  • Commander
  • *****
  • Posts: 2333
  • Developer
    • View Profile
Re: Compiling under Visual Studio 2012
« Reply #7 on: March 19, 2014, 10:00:17 am »
problem is the pre-compiled dependencies were built with VS2010, and VS2012 doesn't like them.

there are a couple of different solutions, i myself simply use VS2010 and don't have any problems, or alternatively you can build them yourself.
please note that should you get errors about afxres.h, there is a simple solution here
« Last Edit: March 19, 2014, 10:02:19 am by Warboy1982 »

Offline BlackLibrary

  • Colonel
  • ****
  • Posts: 133
    • View Profile
Re: Compiling under Visual Studio 2012
« Reply #8 on: March 19, 2014, 03:35:34 pm »
Hmm...makes perfect sense.  So...I only have a copy of VS 2012 update 3, for my current project work.  No desire to spend coin on VS 2010 when VS is about to expand in the upcoming year in anticipation for Win 9.  Resources are tight.

So...with that said...
Can someone point to the files to be compiled and where I find them?  I'd hate to go file by file, line by line thru OpenXcom looking for dependency files.  God forbid...version issues.  Uggh.

BTW...Warboy, did you resort to an older IDE  for simplicities sake, or you couldn't find the solution to getting 2012 working?
« Last Edit: March 19, 2014, 03:38:57 pm by BlackLibrary »

Offline Warboy1982

  • Administrator
  • Commander
  • *****
  • Posts: 2333
  • Developer
    • View Profile
Re: Compiling under Visual Studio 2012
« Reply #9 on: March 19, 2014, 04:07:07 pm »
VS2010 express is completely free from microsoft, no need to spend any coin.
as for why i chose an older IDE: it wasn't old at the time, and i haven't needed to upgrade yet.