Poll
Question: What version of MS Visual Studio are you using  (Voting closed: June 06, 2010, 11:06:48 pm)
VS2010 - 7 (30.4%)
VS2008 - 5 (21.7%)
VS2005 - 1 (4.3%)
VS6 - 0 (0%)
No thanks, I'm not going near no M$ stuff - 10 (43.5%)
Total Voters: 22

Pages: [1]
  Print  
Author Topic: Which version of Visual Studio do you use?  (Read 546 times)
jonoerik
Champion
***
Posts: 196



View Profile
« on: May 27, 2010, 01:04:10 pm »

When trying to compile my libtcod program under Visual Studio 2010, the following error occurs several times, preventing the build from finishing:
Code:
libtcod-1.5.0\include\parser.hpp(97): error C2252: an explicit instantiation of a template can only occur at namespace scope
The offending code is preceeded by the comment "// silly stuff to avoid VS warning", which seems rather ironic considering that it causes one.
I'd simply try removing the line, but would that require a recompile of libtcod?  Or do I need to use some pre-processor defines?

Library version : 1.5.0 (Visual Studio)
OS : Windows XP Professional; Service Pack 3
Compiler : Visual Studio 2010 Express Edition
« Last Edit: May 28, 2010, 08:35:01 am by jonoerik » Logged
mingos
Master
****
Posts: 396



View Profile WWW
« Reply #1 on: May 27, 2010, 02:32:12 pm »

The exact same bug report was issued here: http://doryen.eptalys.net/forum/index.php?topic=391.0

As far as I reckon, there's still no workaround to this problem Sad
Logged

(15:56:14) jice: oh and teach your dog to code roguelikes too Cheesy
(16:00:11) mingos: OMFG
jonoerik
Champion
***
Posts: 196



View Profile
« Reply #2 on: May 27, 2010, 10:40:17 pm »

Ah, sorry.
Didn't find that on the search, but I was obviously not trying hard enough.
I'll continue there for the moment then.
-------------------------------------------------------------
We now have a poll: Thanks jice!
As for me, I'm currently using 2010 (express), having only recently installed it.  I do have a boxed copy of Visual Studio .net 2003 lying around but its probably too outdated to be using now.
« Last Edit: May 28, 2010, 08:38:45 am by jonoerik » Logged
jonoerik
Champion
***
Posts: 196



View Profile
« Reply #3 on: May 30, 2010, 03:49:26 am »

This isn't looking too hopeful for us 2010'ers.  Oh well; keep developing libtcod for 2008, and I'll see if I can a) get libtcod compiling, and b) get libtcod compiling for VS2010.  I had tried getting it compiling for mingw without much success, but perhaps I'll have more luck this time.
Logged
jice
Administrator
Master
*****
Posts: 941


View Profile WWW
« Reply #4 on: May 30, 2010, 09:48:58 am »

Yeah. If you manage to get it compile on VC2010, I'll be happy to merge the patch in svn, but right now, I don't feel like installing yet another version of visual studio...
Logged
jonoerik
Champion
***
Posts: 196



View Profile
« Reply #5 on: June 01, 2010, 10:30:20 am »

GOT IT!!!!!!

I now have libtcod-svn compiling with VC++2010.
Only 2 changes were required with the source code.
In lex_c.c I had to move the declaration of 'long size;' in TCOD_lex_set_data_file() to the start of the function
In sys_sdl_c.c I had to change 3 instances of strcasecmp() to strcmpi().  I'm not sure if this will affect the other compilations though.
I also had to create a new batch file to call cmake with the correct generator:
Code:
generate-vc-2010.bat
@mkdir vcproj
@cd vcproj
@cmake -G "Visual Studio 10" ..\..\
@cd ..

I can't attach a patch here due to file extension restrictions, but if any of the changes need further details, just ask.

The samples and heightmap tool compile correctly.  I also it working in a project, although I found I had to add some .lib files to the project from the depths of the filesystem tree.

Edit: Some instructions on how to properly use the compiled libtcod in projects would be useful.  I get the feeling that what I've done is a bit hack-ish.
Logged
mingos
Master
****
Posts: 396



View Profile WWW
« Reply #6 on: June 01, 2010, 07:58:16 pm »

Thou shalt be remembered as Teh Gr8 M$VC Libtcod Haxxor! Nice job, man Smiley
Logged

(15:56:14) jice: oh and teach your dog to code roguelikes too Cheesy
(16:00:11) mingos: OMFG
jice
Administrator
Master
*****
Posts: 941


View Profile WWW
« Reply #7 on: June 01, 2010, 09:34:38 pm »

 Cheesy Amen !

Ok all the fixes are belong to us. The svn version should now compile on the almighty VC++2010 Wink
Logged
jonoerik
Champion
***
Posts: 196



View Profile
« Reply #8 on: June 01, 2010, 10:55:05 pm »

I'm not sure this warrants your praise.  Most of it was just "compile + google errors + make semi-random changes + repeat" Smiley.
The changes have worked, and libtcod seems to compile with VS2010 as is.  You do have to run generate-vc2010.bat twice, as it fails on the first run for some reason.

What's the official method of using the compiled libtcod in an actual program though?  I've got it working, but I had add some .lib files from "libtcod\cmake\vcproj\src\RelWithDebInfo" to the Visual C++ project, and copy some dlls into the project directory.
Logged
klomer
Apprentice
*
Posts: 7


View Profile
« Reply #9 on: June 12, 2010, 06:43:00 am »

Could someone email me their compiled svn version or post it somewhere so I can get VS2010 running without switching over to the source?

Thanks!
Logged
jonoerik
Champion
***
Posts: 196



View Profile
« Reply #10 on: June 14, 2010, 08:01:19 am »

Could someone email me their compiled svn version or post it somewhere so I can get VS2010 running without switching over to the source?
My compiled libtcod directory is only just under 50mb, most of which is generated stuff from cmake, so emailing it is probably out of the question.  You could wait for the next libtcod release, which I imagine will include VS2010 binaries, or you could just compile your own.  The process is pretty straightforward, and you shouldn't need to install anything extra, but I'll walk you through it if there's any issues.
Logged
Pages: [1]
  Print  
 
Jump to: