Author Topic: Compiling with VS 2012  (Read 5656 times)

Offline Partybwal

  • Squaddie
  • *
  • Posts: 4
    • View Profile
Compiling with VS 2012
« on: March 12, 2014, 08:27:00 pm »
So, I decided to try getting the source from GitHub and maybe take a stab at that new Smooth Camera code, but I just can't get it to run from code. I use Visual Studio Ultimate 2012, which if I'm not completely wrong, is actually VS 11, right? At first, after having to copy a couple of msvcrt.dll's into the game folder, and I finally got it to compile without errors, I got an access violation when starting the game, and after a bit of googling I found that Yaml would need to be rebuilt in VS2012 for it to work when debugging the game in VS2012. So I tried building Yaml-cpp with CMake, selecting VS11 as generator, and it spit out a shitload of files, when I thought it would actually compile a dll. Anyway, so I opened up the sln CMake made in VS and compiled it, and it finally spits out a yaml-cpp.dll. I then renamed that (and the .lib) to yaml-cppd.dll (I built them in debug, but both debug and release seem to output a yaml-cpp.dll) and copied it into the bin folder (and copied the release versions without renaming).

Unfortunately now when I try to compile the game, I get a bunch of Unresolved Externals from Yaml. Unresolved Externals have always been a real headache for me. If it's a declaration missing a definition, that's fine, but in cases like this, I just feel like giving up. The error messages are just a diarrhea of colons, ampersands, at-signs and underscores. Let me just copy-paste the first unresolved and see if anyone can explain to me what the hell I need to do, it would be much appreciated:

Code: [Select]
error LNK2001: unresolved external symbol "public: class YAML::detail::node & __thiscall YAML::detail::memory::create_node(void)" (?create_node@memory@detail@YAML@@QAEAAVnode@23@XZ)

Anyway, unresolved externals should mean that I have declarations of everything but missing their definitions, or vice versa, right? I know how to code, but this whole linking business in C++ has always been my enemy... any help much appreciated, thanks!

Offline Warboy1982

  • Administrator
  • Commander
  • *****
  • Posts: 2333
  • Developer
    • View Profile
Re: Compiling with VS 2012
« Reply #1 on: March 13, 2014, 02:20:36 am »
« Last Edit: March 13, 2014, 02:23:13 am by Warboy1982 »

Offline Partybwal

  • Squaddie
  • *
  • Posts: 4
    • View Profile
Re: Compiling with VS 2012
« Reply #2 on: March 13, 2014, 03:24:17 am »
As I must have failed to explain, the precompiled deps package is compiled for VS 10 (or is it 2010?), and I am running VS 11 aka 2012. And apparently yaml is more sensitive about its stuff having been built using the same version of VS as is being used to compile the game. Or something. Like I said, using the deps package, I got an access violation reading 0xcdcdcd somewhere around when yaml is loading options.cfg. After compiling yaml myself, I get all these unresolved externals.

Offline Warboy1982

  • Administrator
  • Commander
  • *****
  • Posts: 2333
  • Developer
    • View Profile
Re: Compiling with VS 2012
« Reply #3 on: March 13, 2014, 04:11:27 am »
if you're building yaml yourself you'll also need the boost libraries.

Offline Partybwal

  • Squaddie
  • *
  • Posts: 4
    • View Profile
Re: Compiling with VS 2012
« Reply #4 on: March 13, 2014, 10:56:32 am »
Yes, I had a "boost_1_33_1" folder laying around on my drive, which I had to point out to CMake before it would do anything. I successfully compiled yaml-cpp and got out a yaml-cpp.dll and .lib.

I copied them into the deps/lib/Win32 folder and the dll also to the bin/Win32 folder. And renamed the debug versions to yaml-cppd.* before copying them.

Could my boost library be an old version?

Offline Partybwal

  • Squaddie
  • *
  • Posts: 4
    • View Profile
Re: Compiling with VS 2012
« Reply #5 on: March 13, 2014, 11:17:14 am »
SUCCESS! I downloaded latest boost 1_55 and recompiled yaml, and this time for some reason I didn't get a lib and a dll, I only got a lib, and it was named libyaml-cppmdd.lib. I copied it into the deps folder and changed the linker input to use that library instead of yaml-cppd.lib, and suddenly everything works.

Time to do some coding... :)