Code::Blocks Forums
User forums => Using Code::Blocks => Topic started by: EpSiLoN on August 25, 2005, 09:18:46 pm
-
Hi,
i compiled all ogre's sources using Codeblocks and without errors. I tried to compile to ogre application from template but i have this problem with linker:
Project : OGRE_Sample
Compiler : GNU GCC Compiler (called directly)
Directory : C:\Documents and Settings\Ugo\Documenti\AVIV\OGREE\CodeBlocks\Ogre Tutorial\
--------------------------------------------------------------------------------
Switching to target: Release
mingw32-g++.exe -Lc:\OgreSDK\lib -Lc:\OgreSDK\lib\opt\release -LC:\Programmi\CodeBlocks\lib -LC:\Programmi\CodeBlocks\DevPacks\lib -o "OGRE sample.exe" -Wl,--enable-runtime-pseudo-reloc -lmingw32 -luser32 -lkernel32 -lgdi32 -lopengl32 -lOgreMain
C:\Programmi\CodeBlocks\lib/libmingw32.a(main.o):main.c:(.text+0x106): undefined reference to `WinMain@16'
collect2: ld returned 1 exit status
Process terminated with status 1 (0 minutes, 0 seconds)
0 errors, 0 warnings
My project is console application.
Anyone can help me?
Thank you.
-
I don't see any object files in that linker line :shock:
Do a full rebuild and post here the compiler's log please...
Yiannis.
-
Ok, i have done a rebuild, this is the log
Project : OGRE_Sample
Compiler : GNU GCC Compiler (called directly)
Directory : C:\Documents and Settings\Ugo\Documenti\AVIV\OGREE\CodeBlocks\Ogre Tutorial\
--------------------------------------------------------------------------------
Switching to target: Release
mingw32-g++.exe -Lc:\OgreSDK\lib -Lc:\OgreSDK\lib\opt\release -LC:\Programmi\CodeBlocks\lib -LC:\Programmi\CodeBlocks\DevPacks\lib -o "OGRE sample.exe" -Wl,--enable-runtime-pseudo-reloc -lmingw32 -luser32 -lkernel32 -lgdi32 -lopengl32 -lOgreMain
C:\Programmi\CodeBlocks\lib/libmingw32.a(main.o):main.c:(.text+0x106): undefined reference to `WinMain@16'
collect2: ld returned 1 exit status
Process terminated with status 1 (0 minutes, 0 seconds)
0 errors, 0 warnings
It's the same. For accuracy, i have done New Projects->Ogre Application. The variable $OGRE_HOME is set up on c:\OgreSDK where there are my include and my lib.
Any idea?
Thank you.
-
Click on "Compile->Rebuild" please.
Also, check in project properties, the "Release" target has any files associated with it?
Yiannis.
-
It's works!
The file main.c wasn't select! Strange, using the template ogre application the file main.c isn't it already select?
Thank you.
-
I have seen better. In the Ogre Application Template the main.cpp file isn't select in Project/Targets Release options. While in the debug it is select.
One suggest: I think that an opengl template application is a good idea, but this template is only for windows. It is a good idea to add a template using glut library. It is a widespread libray to initialize opengl under all O.S.. This take advantage of release for windows and linux of codeblocks.
Thank you.