Page 1 of 1

Problem with code::Blocks (linker error)

Posted: Thu Jul 28, 2005 11:30 am
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

Posted: Thu Jul 28, 2005 5:50 pm
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:

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

Posted: Thu Jul 28, 2005 8:23 pm
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.

Posted: Fri Jul 29, 2005 5:28 am
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?

Posted: Fri Jul 29, 2005 7:01 am
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.