Problem with code::Blocks (linker error)

Problems building or running the engine, queries about how to use features etc.

Problem with code::Blocks (linker error)

Postby Toby » Thu Jul 28, 2005 11:30 am

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
Toby
Halfling
 
Posts: 57
Kudos: 0
Joined: 28 Jul 2005
Location: Caen

Postby jacmoe » Thu Jul 28, 2005 5:50 pm

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.
Ogre AppWizards - Ogre project wizards for VC 8-10, Code::Blocks and KDevelop.
OgreAssimpConverter - command-line to convert models to Ogre format.
TwOgreGUI - wrapper for AntTweakBar GUI library.
I accept donations | Me on Google+
User avatar
jacmoe
OGRE Moderator
OGRE Moderator
 
Posts: 21024
Kudos: 162
Joined: 22 Jan 2004
Location: Denmark

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

Postby mandrav » Thu Jul 28, 2005 8:23 pm

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.
User avatar
mandrav
Halfling
 
Posts: 63
Kudos: 0
Joined: 25 Feb 2005
Location: Athens, Greece

Postby jamhap » Fri Jul 29, 2005 5:28 am

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?
jamhap
Gnoblar
 
Posts: 12
Kudos: 0
Joined: 28 Jul 2005

Postby Lodes » Fri Jul 29, 2005 7:01 am

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.
Lodes
Google Summer of Code Student
Google Summer of Code Student
 
Posts: 351
Kudos: 0
Joined: 17 Mar 2003
Location: San Jose, CA, USA


Return to Help

Who is online

Users browsing this forum: al2950, Google Adsense [Bot] and 7 guests