Problem with code::Blocks (linker error)

Problems building or running the engine, queries about how to use features etc.
Post Reply
User avatar
Toby
Halfling
Posts: 57
Joined: Thu Jul 28, 2005 11:14 am
Location: Caen
Contact:

Problem with code::Blocks (linker error)

Post by Toby »

Hello,
I've just installed ogre with code::blocks. I followed wiki tuto "the guide of totaly newbie..." but when I compile my first program i've got this error:

Code: Select all

LINK : warning LNK4001: no object files specified; libraries used
LINK : warning LNK4068: /MACHINE not specified; defaulting to X86
LINK : error LNK2001: unresolved external symbol _WinMainCRTStartup
test.exe : fatal error LNK1120: 1 unresolved externals
Can you help me please?
Thanks
Toby or not Toby

http://aubrun.thibaut.free.fr

Freelance software developper, perhaps ;)
User avatar
jacmoe
OGRE Retired Moderator
OGRE Retired Moderator
Posts: 20570
Joined: Thu Jan 22, 2004 10:13 am
Location: Denmark
x 179
Contact:

Post by jacmoe »

You haven't a WinMain() in your project - that means that you will have to make one, or remember to include all files (including the one with a WinMain() in it - the cpp file in the demos). :wink:
/* Less noise. More signal. */
Ogitor Scenebuilder - powered by Ogre, presented by Qt, fueled by Passion.
OgreAddons - the Ogre code suppository.
User avatar
mandrav
Halfling
Posts: 63
Joined: Fri Feb 25, 2005 7:03 pm
Location: Athens, Greece
Contact:

Re: Problem with code::Blocks (linker error)

Post by mandrav »

Toby wrote:Hello,
I've just installed ogre with code::blocks. I followed wiki tuto "the guide of totaly newbie..." but when I compile my first program i've got this error:

Code: Select all

LINK : warning LNK4001: no object files specified; libraries used
LINK : warning LNK4068: /MACHINE not specified; defaulting to X86
LINK : error LNK2001: unresolved external symbol _WinMainCRTStartup
test.exe : fatal error LNK1120: 1 unresolved externals
Can you help me please?
Thanks
> LINK : warning LNK4001: no object files specified; libraries used
This line suggests that there are no compilable files in the current build target. Check that at least one file belongs to this target.
Also check that this (or these) file(s) is "compilable" and "linkable" (in file properties).

Yiannis.
jamhap
Gnoblar
Posts: 12
Joined: Thu Jul 28, 2005 4:59 pm

Post by jamhap »

I get the same errors, I can compile Ogre samples that are part of OgreSDK by importing them into code::blocks, but I get these errors when trying to compile the new Ogre Template sample that is included with Code:Blocks. Would someone try to compile to see if it's my settings or the Template?
Lodes
Google Summer of Code Student
Google Summer of Code Student
Posts: 228
Joined: Mon Mar 17, 2003 12:02 am
Location: San Jose, CA, USA

Post by Lodes »

It happened to me in release mode with the template... Been a bit since I've tried but that was the case. You need to do exactly as mandrav suggested.

Select the main.cpp file and right click. Select properties and makes sure the file belongs in the Debug and Release targets. At least I think that's how it is.. don't really remember, I use VC2003.
Post Reply