Building STK in Visual C++ 2008

Building STK in Visual C++ 2008

Postby sj04736 » 04 Jan 2010, 04:27

I'm trying to compile the SVN trunk, but I can't figure out VC++ 9. I'm more of a autotools kind of person (Linux).

So I've installed Visual C++ 2008 Express, I've downloaded all 1.8GB of the STK repo and opened the VC9 project, I've downloaded the Irrlicht 1.6 sources... and this is where I'm stuck. I suspect I'm missing all kinds of dependencies, but I have no idea where to look for the header files, or how to tell VC9 where to find them.

I'm only going to ask two questions, because from those two questions, I hope that I should be able to figure out the rest on my own.
1- How do I tell VC9 where to find irrlicht.h that trunk requires? Looking at the project file in a text editor, it looks like I have to change "Additional Include Directories" somewhere, because right now, its set to a local path on hiker's machine. How do I do this from within the IDE?
2- Where do I find the GL/*.h header files? I suppose I have to tell VC9 where to find them, and I doubt windows includes them.

This is one of those days I wish Windows had a single software repository :cry:

EDIT: I figured out the irrlicht.h problem, now I just need the rest of the dependencies
EDIT2: Looks like gl.h and glu.h are included, but they're from 1996... I guess I'd better start looking for newer header files.

EDIT3: Figured out one problem: Even though WIN32 is defined in the preprocessor defines, it isn't picking it up... Win64 isn't defined either. If I change all of the WIN32s to _WIN32, then compilation gets much further.

EDIT4: I should probably have done this alreay, but it looks like if you don't set STK_LIBS, then it tries to include WIN32 rather than define it.
Stephen
Role: STK-Addons Developer

Image
User avatar
sj04736
 
Posts: 146
Joined: 07 Dec 2009, 02:56
Location: Western Canada

Re: Building STK in Visual C++ 2008

Postby hiker » 04 Jan 2010, 23:38

sj04736 {l Wrote}:I'm trying to compile the SVN trunk, but I can't figure out VC++ 9. I'm more of a autotools kind of person (Linux).

*grin* VS us supposed to be easier, isn't it? Don't worry, I am usually an autotools person, too, and got it to work. And admittedly the instruction for a VS build are out of date.
So I've installed Visual C++ 2008 Express, I've downloaded all 1.8GB of the STK repo and opened the VC9 project,

That sounds like a minor problem - 1.8GB is way too much. Did you by chance check out the whole repo instead of just the trunk? You should use:
{l Code}: {l Select All Code}
'
svn checkout https://supertuxkart.svn.sourceforge.net/svnroot/supertuxkart/main/trunk

Important is the main/trunk - otherwise you would get indeed the whole repository, and that would be huge indeed. For reference, my working directory (with compiled files!) is 625MB, and probably at least 20MB of 'other' stuff in there.

I've downloaded the Irrlicht 1.6 sources... and this is where I'm stuck. I suspect I'm missing all kinds of dependencies, but I have no idea where to look for the header files, or how to tell VC9 where to find them.

The VS project files are in irrlicht/source/Irrlicht. Open it (9.0), then modify IrrCompieConfig.h (unless you have the directx development files installed) to #undef _IRR_COMPILE_WITH_DIRECT3D_9_ and ... 3d_8_.
Then hit build, and you should be ready to go. Note that this will compile more renderer than necessary, but it doesn't hurt.

I'm only going to ask two questions, because from those two questions, I hope that I should be able to figure out the rest on my own.
1- How do I tell VC9 where to find irrlicht.h that trunk requires? Looking at the project file in a text editor, it looks like I have to change "Additional Include Directories" somewhere, because right now, its set to a local path on hiker's machine. How do I do this from within the IDE?

In the 'solution explorer' right click on supertuxkart and select properties. In the "C/C++ General" tab there is a 'Additional include directories' section - modify the entry for irrlicht-1.6.Same for the Linker General section:"Additional Library Directories".
...

Dang, and why do I only now see the additional edits further down?? Stupid me.

...
2- Where do I find the GL/*.h header files? I suppose I have to tell VC9 where to find them, and I doubt windows includes them.

This is one of those days I wish Windows had a single software repository :cry:

EDIT: I figured out the irrlicht.h problem, now I just need the rest of the dependencies
EDIT2: Looks like gl.h and glu.h are included, but they're from 1996... I guess I'd better start looking for newer header files.

EDIT3: Figured out one problem: Even though WIN32 is defined in the preprocessor defines, it isn't picking it up... Win64 isn't defined either. If I change all of the WIN32s to _WIN32, then compilation gets much further.

That sounds similar to a problem I was made aware of yesterday: on 64-bit windows bullet does not include windows.h, which then causes including the GL files to fail. Can you post some details? Are you using 64 bit, and which files are the problem, what error messages do you get? If it's the same 64-bit bullet problem, we'll fix this by adding WIN64 #ifdefs (though you write it's not defined - so perhaps it's a different issue?). So more details please (or a patch ;) ).

Not entirely sure about changing WIN32 to _WIN32 - afaik one comes from the compiler, the other from the SDK - no idea what happens if we change the define on a 64 bit machine, and I can't easily test this myself.

EDIT4: I should probably have done this alreay, but it looks like if you don't set STK_LIBS, then it tries to include WIN32 rather than define it.

I can't see how this could happen, but I might be missing something.

I was about to mention this anyway: you have to define two environment variables: STK_INCLUDE and STK_LIBS to point to the include and lib directories with all other dependencies (don't forget to restart VS after setting those). If you have problems with the dependency, let me know - I always wanted to put a dependency package online, I just need someone gently pushing me.

I am not sure what kind of help you still need, and what your current problems exactly are - sounds like you have solved most/all (?)

Cheers,
Joerg

Edit: Should mention that I will improve the docs once we have the alpha release ready.
hiker
 
Posts: 1435
Joined: 07 Dec 2009, 12:15
Location: Melbourne, Australia

Re: Building STK in Visual C++ 2008

Postby sj04736 » 05 Jan 2010, 00:58

hiker {l Wrote}:That sounds like a minor problem - 1.8GB is way too much. Did you by chance check out the whole repo instead of just the trunk?

Yes, I checked out the whole repo, but that was intentional :D I did think better of it later

hiker {l Wrote}:That sounds similar to a problem I was made aware of yesterday: on 64-bit windows bullet does not include windows.h, which then causes including the GL files to fail. Can you post some details? Are you using 64 bit, and which files are the problem, what error messages do you get? If it's the same 64-bit bullet problem, we'll fix this by adding WIN64 #ifdefs (though you write it's not defined - so perhaps it's a different issue?). So more details please (or a patch ;) ).

Not entirely sure about changing WIN32 to _WIN32 - afaik one comes from the compiler, the other from the SDK - no idea what happens if we change the define on a 64 bit machine, and I can't easily test this myself.

That was me on IRC :)

[EDIT]
Just a note to anyone attempting to compile STK - On 64-bit windows, 32-bit DLLs belong in C:\Windows\SysWOW64, and 64-bit DLLs belong in C:\Windows\System32. It's a little bit backwards, so that's why I mention it here to save somebody time in the future.
[/EDIT]

As it turns out, VC9 Express won't compile in 64-bit mode unless you edit the command-line directly, so WIN32 was always correct. Again, I hadn't set $(STK_LIBS), so the command-line looked something like this: ... \I "" \D "WIN32"... and it wasn't actually defining win32 like it should have been, rather it tried to include it. Anyways, _WIN32 is defined by the compiler, and WIN32 must be defined by the user. It was defined in the VC project, I just didn't have it set up properly.

Anyways, I managed to get STK to compile and run (after journeying through dependency hell) without modification to the source. Now I've just got to fix that corrupted SVN checkout. Thanks for your help!
Stephen
Role: STK-Addons Developer

Image
User avatar
sj04736
 
Posts: 146
Joined: 07 Dec 2009, 02:56
Location: Western Canada

Who is online

Users browsing this forum: Google [Bot], Majestic-12 [Bot] and 1 guest

cron