Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Dark GDK / Setting up Code::Blocks for GDK

Author
Message
Square
16
Years of Service
User Offline
Joined: 5th May 2008
Location: London, UK
Posted: 29th Mar 2010 20:40
I have in the past compiled a successful version of my GDK game, using Code::Blocks as IDE and selecting VS2008 C++ compiler. Therefore, is very possible with the right compiler settings.

I chose to use Code::Blocks as it will always output a good clean version of my game, similar-better intellisense. Also seems to run on any computer with a fairly recent WinOS and DirectX, whereas I've had complaints from people running my game when using VS2008 Express or VS2008 in the nature of directx incompatibility or some file dependency.

Now.. I have tried setting up Code::Blocks recently after a fresh Windows7 install, with the following:

GDK (Game Development Kit with Update NOV08)
DirectXSDK August 2008
Code::Blocks 8.02
Visual Studio 2008 (full)

detecting VS2005/2008 C++ Compiler in Code::Blocks.

I linked up to DirectXSDK and the GDK packages by Build Options > Search Directories, to revelant lib and header files, under Compiler for header directories, and Linker for lib directories.

Problem 1: At first compile atls.lib can not be found, or missing. Many people have come across this error, which can be resolved by simply using VS2008 GDK wizards. But as I am using Code::Blocks, I searched up atls.lib and linked in the Search Directories facility.

This resolved the problem with some errors.

Problem 2: I have some complaints at this stage in MSVCRT.lib, with the compiler output recommending /NODEFAULTLIB setting for this library. The second complaint is - subsystem is not defined, but console is assumed.. So, in Build Options > Other options I enter:

/SUBSYSTEM:CONSOLE
/NODEFAULTLIB:msvcrt

This solves everything but one issue.

LIBCMT.lib(crt0.obj)||error LNK2019: unresolved external symbol _main referenced in function ___tmainCRTStartup|

This is as far as I have got. Have I missed anything early on? And I hope the Game Creators can appreciate users that want to use Code::Blocks as an IDE, rather than simply VS2008 and the GDK wizards, (which I believe do actually help you to compile a GDK project first time.)

Any solutions please? Before you post "VS2008 is better in every way so use that!!!" can you please first see the title of this thread.


StarCrypt - a classic vertical super-shoot in 3d
pirogoth
16
Years of Service
User Offline
Joined: 6th Apr 2008
Location: Good Old California
Posted: 30th Mar 2010 08:49
You need to link against the multi threaded libs. Pass the "/MT" switch to the compiler and it should compile cleanly.

I use NANT for my C/C++ work along with VIM as my editor. Works quite well. Here's a simple NANT build file that shows all the options and such that need to be set to compile GDK apps outside of visual studio. Cheers!



-Piro
Diggsey
18
Years of Service
User Offline
Joined: 24th Apr 2006
Location: On this web page.
Posted: 30th Mar 2010 12:30
Quote: "I've had complaints from people running my game when using VS2008 Express or VS2008 in the nature of directx incompatibility or some file dependency."


You're still using the MSVC++ compiler so it won't make the slightest difference which IDE you use with it.

Any unusual file dependencies are either caused by incorrect compiler settings (linking against the debug runtime libraries) or in the case of directx, the end user not having the correct version. (All you have to do is distribute a version of the directx redistributable web installer with your projects)

Square
16
Years of Service
User Offline
Joined: 5th May 2008
Location: London, UK
Posted: 5th Apr 2010 01:15
Thank you.

I did actually move back to VS2008. It makes sense. And I probably was linking incorrectly to cause file dependencies last time I used it.

Asteroids3d - a classic game, remade in a 3d environment.

Login to post a reply

Server time is: 2024-10-02 03:40:09
Your offset time is: 2024-10-02 03:40:09