Author Topic: Building in VS 2010  (Read 4363 times)

0 Members and 1 Guest are viewing this topic.

Offline WonderDog

  • Dev Team
  • *****
  • Posts: 35
Building in VS 2010
« on: May 07, 2010, 03:25:07 AM »
Here is a quick patch to allow you to build in VS2010 if you want.

There is a ambiguous operator overload with the new iostream support for open method.  I had to typecast all the open(dirpath ...) to string

Its probably not the correct way to do it but it works ;D

Offline Dagoth

  • Administrator
  • *****
  • Posts: 617
Re: Building in VS 2010
« Reply #1 on: May 07, 2010, 05:31:03 AM »
It doesn't work in VC2008 that way, it needs conversion to char (wchar_t, more precisely) and fails to compile.

If you add .c_str() to the end, like string(DirPath() << "blah").c_str(), does that still work in VC2010?

Offline DocClox

  • Dev Team
  • *****
  • Posts: 1867
  • Messing Around With Python
Re: Building in VS 2010
« Reply #2 on: May 07, 2010, 12:03:39 PM »
Might be easier to add an open() method to DirPath and have it return an iostream&

That way if we need to start writing #ifdev VS_WHATEVER bits, we can at least centralise them

Offline necno

  • Core Developer
  • ******
  • Posts: 385
Re: Building in VS 2010
« Reply #3 on: May 07, 2010, 05:30:32 PM »
Thats interesting, i use VC2008 and don't have that problem :D
Click here to donate
After you do so please pm me the email address you used so I can add you to the donation forum.

Working on:
Whoremaster II (Official)
Birthright (Now a commercial rougelike)

Offline delta224

  • Dev Team
  • *****
  • Posts: 577
Re: Building in VS 2010
« Reply #4 on: May 07, 2010, 07:16:40 PM »
The issue with VS 2010 is that microsoft overloaded fstream.open to take a string argument and a c string agrument. The proper way of dealing with this is to drop the string type coersion in dirpath.
 
On the note of VS 2010, you can take the repurposed auto keyword and the lambda keyword from my cold dead hands.

Offline necno

  • Core Developer
  • ******
  • Posts: 385
Re: Building in VS 2010
« Reply #5 on: May 08, 2010, 12:16:59 AM »
I just looked at auto keywords and yes they seem useful... but at the same time I probably won't use them :)
Click here to donate
After you do so please pm me the email address you used so I can add you to the donation forum.

Working on:
Whoremaster II (Official)
Birthright (Now a commercial rougelike)

Offline DocClox

  • Dev Team
  • *****
  • Posts: 1867
  • Messing Around With Python
Re: Building in VS 2010
« Reply #6 on: May 08, 2010, 02:10:43 AM »
By all means drop the string cast operator.  It's one of those things that would have worked well when I first learned C++, but it's pretty much useless now.

An iostream& open() method is probably still a good idea.

Offline Dagoth

  • Administrator
  • *****
  • Posts: 617
Re: Building in VS 2010
« Reply #7 on: May 10, 2010, 02:45:43 AM »
Sounds good to me, if a bit beyond my capabilities thus far. Any of you feel like going ahead and setting that up?