Eclipse 3.1 + CDT 3.0.0 + Gcc 3.4 (MinGW+MYSys) + Ogre 1.0.3

Problems building or running the engine, queries about how to use features etc.
User avatar
steven
Gnoll
Posts: 657
Joined: Mon Feb 28, 2005 1:53 pm
Location: Australia - Canberra (ex - Switzerland - Geneva)
Contact:

Eclipse 3.1 + CDT 3.0.0 + Gcc 3.4 (MinGW+MYSys) + Ogre 1.0.3

Post by steven »

Eclipse 3.1 + CDT 3.0.0 RC2 + Gcc 3.4 (MinGW + MYSys) + Ogre 1.0.3


Goal : Compiling ogre on Windows without cygwin, pkgconfig, autotools, bootstrap, etc etc) .

== WIKIED August 05==

UPDATE August 05 : A newer version of this guide has been put on wiki. See http://www.ogre3d.org/wiki/index.php/Bu ... se_And_GCC


This post is following my previous post about Eclipse + Cygwin :
http://www.ogre3d.org/phpBB2/viewtopic.php?t=8741


I didn't want to use cygwin anymore, because I find its gcc to old... ;-)
So I switched to pure MinGW.

Here is a complete verbous step-by-step instructions to compile and run one Ogre sample.


Go directly to part 3 if you have a functional Eclipse with MinGW 3.4 and CDT 3.0.


TODO : Post a table with all project settings for every samples/plugins.

TODO : Make a .zip containing all the Eclipse project file. Sort of SDK.

TODO : Post a example of simple ogre Hello program. However, should be very similar to the part 5 of my previous thread (except the cygwin specific settings). See http://www.ogre3d.org/phpBB2/viewtopic.php?t=8741.

TODO : Add this on the wiki.


1 - Install MinGW and Mysys.

I am on a Windows platform so I used the MinGW version 3.4.4 + MYSys.
(AFAIK, there is no 4.0 version of gcc for windows (MinGW). The MinGW developer forum suggest that because of regressions they will wait until 4.0.2 at least.)

1.1 - Test your environment

- Open a "Command window" and type "gcc -v" and "strip -V"

If you get something like: "gcc version 3.4.4 (mingw special)" and "strip 2.15.94", then you have a functional MinGW + MSYS, you can skip this part.

1.2 - Install MinGW

There can be conflit if you have another gcc (for examples from cygwin).
Because I didn't need cygwin anymore I uninstalled it!

If you need cygwin, I am not sure what you must do. Because if you change the environment variable PATH, cygwin will not work anymore.
So what I suggest is to change the PATH variable WITHIN Eclipse (see point 1.4 and 4.3) and cygwin should still work normaly.


You need at least the following from the MinGW site :
binutils
w32api
mingw-runtime
gcc-core
gcc-g++
gdb

Install them in a directory (for example C:\tools\mingw).

1.3 - Install MSYS.

For example C:\tools\mysy .
CAREFUL : It must not be in the same directory as mingw (both bin directories must not be merged).

1.4 - Set the PATH variable.

If you have cygwin, you will need to replace the PATH in Eclipse (see 4.3).

If you don't have cygwin, you can simply set the environment variable PATH to point to both bin directories.
You can test you installation by doing the 1.1 part.



2 - Install Eclipse

(See the thread to see how to install Eclipse : http://www.ogre3d.org/phpBB2/viewtopic.php?t=8741 )

- Download and install : eclipse-SDK-3.1-win32.zip
- Download org.eclipse.cdt-3.0.0-RC2-win32.x86.zip (or later) and uninstall it in the Eclipse directory.
- Create shortcuts to eclipse.exe to lauch Eclipse more easily.


3 - Download and install Ogre

3.1 - Install Ogre

- Unzip ogre-win32-v1-0-3p1.zip in a new directory. I create a "C:\library\Ogre" so I got "C:\library\Ogre\ogrenew" .
- Unzip the content MinGWDependencies-1.0-pre2.tar.bz2 in "ogrenew".
- Rename the directory "mingw" in "Dependencies", you then have "ogrenew/Dependencies/bin", "ogrenew/Dependencies/include", "ogrenew/Dependencies/lib" and "ogrenew/Dependencies/share".
- Copy all .dll from "ogrenew/Dependencies/bin" in "ogrenew/Samples/Common/bin/Release"

3.2 - zlib and zziplib mess !

As of today (July 05) there is a "missing" library file (.a) to build again libzzip-0-10.dll in the MinGWDependencies tar.
Furthermore, ASFAIK, the name of these libraries .a are not following naming conventions... its confusing.

We need to build this a .a library file.

There are two nedded libraries :
zlib1.dll -> project zlib : http://www.zlib.net/
libzzip-0-10.dll -> project zziplib : http://zziplib.sourceforge.net/

CAREFUL: Do not confuse it with this other project : zzip & zzlib : http://debin.net/zzip/ and http://debin.net/zzip/download.php#zzip


The usual way is to use pkg-config on the files provided with OgreDependencies but pkg-config is not available on Win32 except with Cygwin!
I hate to be obliged to install cygwin just for a "simple compilation".
(It makes me mad that pkg-config is advertised as a helper tool... hahaha).

So...

3.2.1 - Zlib

For zlib, we will need to compile OgreMain against libz.dll.a (which should be libzlib.a)
You need to use "g++ .... -lzziplib -lz.dll ... " instead of " -lzziplib -lzlib "

Another way would be to :

- Download zlib123-dll.zip from http://www.zlib.net/
- Uncompress it in a directory
- Open a "Command Window" in this directory and make the following command :

- dlltool --def lib\zlib.def --dllname zlib1.dll --output-lib libzlib.a

This will create the file libzlib.a that we need to compile OgreMain.

- Copy this file in "ogrenew/Dependencies/lib".


3.2.2 - Zziplib

I tried three solution only the last worked. If someone could show me a more elegant way...

3.2.2.1 - Create the .a from the dll

We SHOULD be able to generate the needed .a from the .dll (because the symbols where not stripped).
But it doesn't work. I don't know why. I will put what i did in the hope that someone will find what went wrong :

- Open a Command window in Dependencies/bin and execute the following commands :

echo EXPORTS > zzip.def
nm libzzip-0-10.dll | grep ' T _' | sed 's/.* T _//' >> zziplib.def
dlltool --def zziplib.def --dllname libzzip-0-10.dll --output-lib libzziplib.a

- Copy this libzziplib.a in Dependencies/lib and compile against it.

But the compilation stops with : ../../Dependencies/lib/libzziplib.a(dkts00027.0):: first defined here
I could not find a solution so I tried another solution.


3.2.2.2 - Compile zziplib

I tried to compile zziplib from http://sourceforge.net/project/showfile ... up_id=6389
but without unix tools I can't.
I tried to link against zzipdll.zip (version 0.10.17) but it didn't work.

Can someone show me how to do it with mingw + Msys? :-)


3.2.2.2 - Copy it from CODE::BLOCKS

Ogrenew now compiles... even if the .a is NOT from the same zziplib version !!!

- Get the Code::Blocks dependencies : Download codeblocks-dependencies-1.0.1.zip
at http://sourceforge.net/project/showfile ... _id=149087.
- Unzip the file libzziplib.a in /Dependencies/lib


We could use the dependencies from CodeBlocks but then you would need to change the path libraries a bit.



4 - Configure Eclipse for Ogre

4.1 - Launch Eclipse.

It will ask to open a Workspace (a workspace is created by opening Eclipse in the desired directory).

- Open a workspace in "ogrenew/Scripts".

(CAUTION : NOT in "ogrenew" because you would would't be able to create projects in subdirectories relative to ogrenew !!!
I lost a whole day because of this ! )


4.2 - Modify several default preferences :

- Window -> Preferences -> General -> Perspectives -> Available perspectives : set C/C++ as default.

- Window -> Preferences -> General -> Workspace -> Linked Resources : add a defined path variables : "OgreEclipse" which will contain the full path to the ogrenew directory. For example "C:\library\Ogre\ogrenew".

- Window -> Preferences -> General -> Workspace -> Build automatically : set to false. (You can let it but I found it very annoying. I prefer to build when I want).

Until the next version of CDT the indexer is extremely slow, I suggest that you disable if you only compile Ogre !

- Window -> Preferences -> C/C++ -> Indexer : set to No Indexer !!!

There is a bug, some time when you launch Eclipse again you will need to set No indexer again for each project... :-(


4.3 - Setting environment variables in Eclipse

- Window -> Preferences -> C/C++ -> Managed Build -> Environment : define a new "User Variables" by
selecting the PATH variable and Prepend the value : C:\tools\mingw\bin;C:\tools\mysy\bin; (Don't put it in "" ).

I used only "Managed build project" but you can also do this for "Make Project"
Set it in Window -> Preferences -> C/C++ -> Make -> New Make Project -> Environment.

CAREFUL : For those with Cygwin, it will NOT work because during the first run of Eclipse,
the path to the cygwin bin will be kept somwhere and automatically prepended to the PATH environment !
This means that for EACH project you will need to prepend the correct MinGW bin path to the PATH variable.
See 5.4.2. If you find another solution, let me know !

To be safe, quit and launch Eclipse again.


5 - Compile Ogre with Eclipse

TODO : I will try to make a .zip containing all needed eclipse project files. So that you only need to unzip and click compile !

But until then I will only explain how to compile Ogre to run the sample Demo_BezierPatch.
To run it, we need at least OgreMain.dll, OgrePlatform.dll, Plugin_ParticleFX.dll and RenderSystem_Direct3D9.dll (or RenderSystem_GL.dll).

You will need to work a bit to compile the rest :-)


5.1 - Demo_BezierPatch project : compile Demo_BezierPatch.exe

This executable needs OgreMain.dll to compile but OgreMain is big and the compilation is about 20 min on my pc.
So, to verify if we set up correctly Eclipse we will first try with a small project in Release mode.
It's nearly the same for the Debug but its to see if we can compile.


5.1.1 - Create a new "Managed Make C++ Project" with :

- File -> New -> Managed Make C++ Project :
- Project Name : Demo_BezierPatch
- Project contents -> Directory : OgreEclipse/Samples/BezierPatch (do not use the default one ! OgreEclipse is the variable you set before)
- Click Finish.

If Eclipse ask to open the C/C++ perspective, I recommand that Eclipse remembers your decision.
You can change perspective by clicking on the small icon in the top right of the ide.
Know you should see the files contained in the directory that appear in your Navigator.


5.1.2 - Open the properties of your project.

(Right click on the Demo_BezierPatch folder icon).

- C/C++ Build -> Active configuration -> Configuration : select Release.
- C/C++ Build -> Build Settings -> Buil Command : replace "make -k" by "mingw32-make -k". Click Apply to save it.
It's a "Managed Make" so you can't change the default command... :-/

- C/C++ Build -> Tool Settings -> Preprocessor -> Defined Symbols : add WIN32, NDEBUG and _WINDOWS
- C/C++ Build -> Tool Settings -> Directories -> Include paths : add ../include, ../../Common/include and ../../../OgreMain/include

- C/C++ Build -> Tool Settings -> Libraries -> Libraries : add OgreMain
- C/C++ Build -> Tool Settings -> Libraries -> Library search path : add ../../../OgreMain/Release
- C/C++ Build -> Tool Settings -> Miscellaneous -> Linker flags : -Wl,--enable-runtime-pseudo-reloc
(Do not put a space after the comma it creates a link error difficult to find).

- C/C++ Build -> Build Steps -> Post-build step : put the following line in the Command field and "copy & strip" in the Description field
cp Demo_BezierPatch.exe "../../Common/Bin/Release" ; strip "../../Common/Bin/Release/Demo_BezierPatch.exe"

For Cygwin see 4.2


5.1.3 - Build the project

(You can stop the compilation by clicking on the icon in the bottom right of the ide).

- Build the project, it should exit with the following error :
"..\..\mingw32\bin\ld.exe: cannot find -lOgreMain"

Success! You correctly set up your Eclipse + MinGW + Ogre environment.
If you don't have this there is a problem somewhere !

Now. To compile this sample we need OgreMain.dll.


5.2 - OgreMain project : compiling OgreMain

This will be fairly similar to the last project.

- File -> New -> Managed Make C++ Project :
- Project Name : OgreMain
- Project contents -> Directory : OgreEclipse/OgreMain
- Click next
- Project Type : Shared Library
- Click Finish

Project properties :

- C/C++ Build -> Active configuration -> Configuration : select Release.
- C/C++ Build -> Build Settings -> Buil Command : replace "make -k" by "mingw32-make -k". Click Apply to save it.
- C/C++ Build -> Tool Settings -> Preprocessor -> Defined Symbols : add WIN32, NDEBUG, _USRDLL, _MT, OGRE_NONCLIENT_BUILD
- C/C++ Build -> Tool Settings -> Directories -> Include paths : add ../include, ../../Dependencies/include and ../../Dependencies/include/freetype2
- C/C++ Build -> Tool Settings -> Libraries -> Libraries : add kernel32, user32, z.dll, zziplib, libfreetype, IL, ILU and ILUT
(See point 3.2 if you have a z/zzip/zziplib library compile error)
- C/C++ Build -> Tool Settings -> Libraries -> Library search path : add ../../Dependencies/lib
- C/C++ Build -> Tool Settings -> Miscellaneous -> Linker flags : nothing !
- C/C++ Build -> Build Steps -> Post-build step : put the following line in the Command field and "copy & strip" in the Description field
cp OgreMain.dll "../../Samples/Common/Bin/Release" ; strip "../../Samples/Common/Bin/Release/OgreMain.dll"; cp OgreMain.dll "../../Tools/Common/bin/Release"; strip "../../Tools/Common/bin/Release/OgreMain.dll"

- (Re)Build the project and wait 20 minutes...

There will be 100 warnings, ignore them (or submit a patch :-) )
Take a break and a double wiskey, if you have "Build complete for project OgreMain"


5.2.2 - Rebuild Demo_BezierPatch again.

It should build.


5.3 - Build PlatformManager_Win32

5.3.1 - Managed Make

- File -> New -> Managed Make C++ Project :
- Project Name : PlatformManager_Win32
- Project contents -> Directory : OgreEclipse/PlatformManagers/Win32
- Click next
- Project Type : Shared Library
- Click Finish

Project properties :

- C/C++ Build -> Active configuration -> Configuration : select Release.
- C/C++ Build -> Build Settings -> Buil Command : replace "make -k" by "mingw32-make -k". Click Apply to save it.
- C/C++ Build -> Tool Settings -> Preprocessor -> Defined Symbols : add WIN32, NDEBUG, _WINDOWS, _USRDLL, PLATFORMMANAGER_WIN32_EXPORTS
- C/C++ Build -> Tool Settings -> Directories -> Include paths : add ../include, ../../OgreMain/include, ../misc and ../../Dependencies/include
- C/C++ Build -> Tool Settings -> Libraries -> Libraries : add OgreMain, dxguid, dinput8 and dinput
- C/C++ Build -> Tool Settings -> Libraries -> Library search path : add ../../../OgreMain/Release, ../../../Dependencies/lib
- C/C++ Build -> Tool Settings -> Miscellaneous -> Linker flags : -Wl,--enable-runtime-pseudo-reloc
- C/C++ Build -> Build Steps -> Post-build step : put the following line in the Command field and "copy & strip" in the Description field
cp PlatformManager_Win32.dll "../../../Samples/Common/Bin/Release/OgrePlatform.dll" ; strip "../../../Samples/Common/Bin/Release/OgrePlatform.dll"

- (Re)Build the project...

There will be about 9 warnings... ignore them.


5.3.2 - Compiling win32 resources (OgreWin32Resources.rc)

There is a catch ! OgreWin32Resources.rc must be compiled with windres.

If you execute ogrenew/Samples/Common/bin/Release/Demo_BezierPatch.exe ,
and you get the following message appears, you need to compile the win32 resource .rc :

Code: Select all

Error #: 1812
   Function: Win32ConfigDialog::display
- In Eclipse right-click on OgreWin32Resources.rc
- Open the C/C++ Build view :
- Exclude from build must not be set.
- Configuration : Release
- Custom Build Step Applicability : Apply Custom Build Step Overriding Other Tools
- Output file name(s) : OgreWin32Resources.o
- Command : windres -o "./misc/OgreWin32Resources.o" -I"../misc" -I"../include" "../misc/OgreWin32Resources.rc"
- Description : Win32 Resources Compilation
- Project Properties :
- C/C++ Build -> Linker -> Miscellaneous -> Other objects : ./misc/OgreWin32Resources.o

- (Re)build the project.

5.3.3 - Plugins.cfg

- Open ogrenew/Samples/Common/bin/Release/Plugins.cfg (it define which plugin will be loaded by ogre)
- Modified it (for this project) as follow :

Code: Select all

      # Defines plugins to load
   
      # Define plugin folder
      PluginFolder=.
   
      # Define plugins
      #Plugin=RenderSystem_Direct3D7
      Plugin=RenderSystem_Direct3D9
      #Plugin=RenderSystem_GL
      Plugin=Plugin_ParticleFX
      #Plugin=Plugin_BSPSceneManager
      #Plugin=Plugin_OctreeSceneManager
      #Plugin=Plugin_CgProgramManager
- Run Demo_BezierPatch.exe, it should complain that the library RenderSystem_Direct3D9 is missing.


5.4 - Build RenderSystem_Direct3d9

- File -> New -> Managed Make C++ Project :
- Project Name : RenderSystem_Direct3D9
- Project contents -> Directory : OgreEclipse/RenderSystems/Direct3D9
- Click next
- Project Type : Shared Library
- Click Finish

Project properties :

- C/C++ Build -> Active configuration -> Configuration : select Release.
- C/C++ Build -> Build Settings -> Buil Command : replace "make -k" by "mingw32-make -k". Click Apply to save it.
- C/C++ Build -> Tool Settings -> Preprocessor -> Defined Symbols : add WIN32, NDEBUG, _WINDOWS, _USRDLL, OGRE_NONCLIENT_BUILD, OGRED3ENGINEDLL_EXPORTS
- C/C++ Build -> Tool Settings -> Directories -> Include paths : add ../include, ../../OgreMain/include and ../../Dependencies/include
- C/C++ Build -> Tool Settings -> Libraries -> Libraries : add OgreMain, gdi32, d3d9, d3dx9d, dxerr9, dxguid
- C/C++ Build -> Tool Settings -> Libraries -> Library search path : add ../../../OgreMain/Release, ../../../Dependencies/lib
- C/C++ Build -> Tool Settings -> Miscellaneous -> Linker flags : -Wl,--enable-runtime-pseudo-reloc
- C/C++ Build -> Build Steps -> Post-build step : put the following line in the Command field and "copy & strip" in the Description field
cp RenderSystem_Direct3D9.dll "../../../Samples/Common/Bin/Release" ; strip "../../../Samples/Common/Bin/Release/RenderSystem_Direct3D9.dll"

- (Re)Build the project... There will be warnings... ignore them.

- Run Demo_BezierPatch.exe. The option window should open.
- Select the only rendery system you have : direct3d9
- Set full screen to No (for now) and click ok.

An exception will occur : Error #: 4 : Cannot find requested emitter type.


5.5 - Build Plugin_ParticleFX

- File -> New -> Managed Make C++ Project :
- Project Name : Plugin_ParticleFX
- Project contents -> Directory : OgreEclipse/Plugins/ParticleFX
- Click next
- Project Type : Shared Library
- Click Finish

Project properties :

- C/C++ Build -> Active configuration -> Configuration : select Release.
- C/C++ Build -> Build Settings -> Buil Command : replace "make -k" by "mingw32-make -k". Click Apply to save it.
- C/C++ Build -> Tool Settings -> Preprocessor -> Defined Symbols : add WIN32, NDEBUG, _WINDOWS, _USRDLL, PLUGIN_ParticleFX_EXPORTS
- C/C++ Build -> Tool Settings -> Directories -> Include paths : add ../include, ../../OgreMain/include and ../../Dependencies/include
- C/C++ Build -> Tool Settings -> Libraries -> Libraries : add OgreMain
- C/C++ Build -> Tool Settings -> Libraries -> Library search path : add ../../../OgreMain/Release, ../../../Dependencies/lib
- C/C++ Build -> Tool Settings -> Miscellaneous -> Linker flags : -Wl,--enable-runtime-pseudo-reloc
- C/C++ Build -> Build Steps -> Post-build step : put the following line in the Command field and "copy & strip" in the Description field
cp Plugin_ParticleFX.dll "../../../Samples/Common/Bin/Release" ; strip "../../../Samples/Common/Bin/Release/Plugin_ParticleFX.dll"

- (Re)Build the project... There will be about 58 warnings... ignore them.

5.6 - Running Demo_BezierPatch.exe

You can either :

- Go in the ogremain/Samples/bin/Release
- Run Demo_BezierPatch.exe. The option window should open.
- Select the only rendery system you have : direct3d9
- If not already done, make the change in Plugins.cfg (see 5.3.3)
- Set full screen to No (for now) and click ok.

Or in Eclipse :

- Run -> Run... : will open a option panel to "Create, manage and run configurations"
- Create a new "C/C++ Local Application"
- Main -> C/C++ Application : Browse to find the executable in /Samples/Common/bin/Release
- Click run
- Select the only rendery system you have : direct3d9
- If not already done, make the change in Plugins.cfg (see 5.3.3)
- Set full screen to No (for now) and click ok.


Congratulations... you have compiled a sample of Ogre.
Last edited by steven on Tue Aug 16, 2005 2:40 pm, edited 5 times in total.
User avatar
Yavin
Bronze Sponsor
Bronze Sponsor
Posts: 140
Joined: Wed Mar 02, 2005 3:41 pm
Location: Lake Constance, Germany
Contact:

Post by Yavin »

Nice, I will give it a try if I get the time :wink:

I think this tutorial should be located in the wiki too. Which debugger do you use?
Last edited by Yavin on Fri Jul 29, 2005 11:18 am, edited 1 time in total.
User avatar
steven
Gnoll
Posts: 657
Joined: Mon Feb 28, 2005 1:53 pm
Location: Australia - Canberra (ex - Switzerland - Geneva)
Contact:

Post by steven »

Nice, but I think this tutorial should be located in the wiki too. Which debugger do you use?
Firstly, I would prefer to have some feedback before adding such a long text to wiki. I will just add in wiki a link to this thread.

Secondly, I asked :wumpus: if he could merge the "CodeBlocks dependencies" and the "MinGW dependencies", this way the settings of both IDE would be largely similar. The settings here would need small modifications. (However, it was on a private message perhaps I should ask it in the developer forum.)


I am using GNU gdb 6.3 which comes with the Mingw.
User avatar
Yavin
Bronze Sponsor
Bronze Sponsor
Posts: 140
Joined: Wed Mar 02, 2005 3:41 pm
Location: Lake Constance, Germany
Contact:

Post by Yavin »

steven wrote:Firstly, I would prefer to have some feedback before adding such a long text to wiki. I will just add in wiki a link to this thread.
The advantage of a Wiki is that users with feedback can adjust the article on their own. At the moment only you are able to edit the text. A wiki article hasn't to be perfect and the functions of the wiki are better to discuss and to improve such articles/tutorials.

And another point is text formatting. Wiki articles are better to read. Give it a try ...
User avatar
sachem
Gnoblar
Posts: 2
Joined: Sun Jul 31, 2005 6:23 pm

Post by sachem »

Hi I'm trying your tutorial...
I work with Eclipse 3.1.0 (build I20050627-1435) & CDT 2.1.1 (build 200503221222)

I'm a newbie in using Eclipse with CDT (but I've work a little with Eclipse+Java), so maybe some of my questions will be a little stupid...

(note : and I'm not an english native speaker, sorry for possible mistakes)

Part 4.2
- Window -> Preferences -> C/C++ -> Indexer : set to No Indexer !!!
By this do you mean setting the "indexer timout" to 0ms in "Window -> Preferences -> C/C++ -> Search" ?
because I don't find any "Window -> Preferences -> C/C++ -> Indexer".

In the same way, I don't find :
"Window -> Preferences -> C/C++ -> Managed Build -> Environment"
and
"Window -> Preferences -> C/C++ -> Make -> New Make Project -> Environment."
...
I've made a screenshot of my Windows/Preferences window...
Image

maybe I'm blind, but I don't find "Managed Build" in my Eclipse... :(
User avatar
steven
Gnoll
Posts: 657
Joined: Mon Feb 28, 2005 1:53 pm
Location: Australia - Canberra (ex - Switzerland - Geneva)
Contact:

Post by steven »

(note : and I'm not an english native speaker, sorry for possible mistakes)
I am swiss french so my english is probably as bad as yours :wink:

I work with Eclipse 3.1.0 (build I20050627-1435) & CDT 2.1.1 (build 200503221222)

I'm a newbie in using Eclipse with CDT (but I've work a little with Eclipse+Java), so maybe some of my questions will be a little stupid...

(note : and I'm not an english native speaker, sorry for possible mistakes)

Part 4.2
Quote:
- Window -> Preferences -> C/C++ -> Indexer : set to No Indexer !!!

By this do you mean setting the "indexer timout" to 0ms in "Window -> Preferences -> C/C++ -> Search" ?
because I don't find any "Window -> Preferences -> C/C++ -> Indexer".

In the same way, I don't find :
"Window -> Preferences -> C/C++ -> Managed Build -> Environment"
and
"Window -> Preferences -> C/C++ -> Make -> New Make Project -> Environment."
...
I've made a screenshot of my Windows/Preferences window...


maybe I'm blind, but I don't find "Managed Build" in my Eclipse...
You couldn't find this options because they are pretty new !

There was a lot of changes in CDT since 2.1.1.

The actual version is 3.0.0 RC2 and in about 10 days there should release the "final release candidate".

Bye
User avatar
sachem
Gnoblar
Posts: 2
Joined: Sun Jul 31, 2005 6:23 pm

Post by sachem »

Ok,
now I know why it dosen't work :D

But just a suggestion, you should write just down the title, the version of Eclipse/CDT you're using... (you do it for gcc and Ogre, so why not for CDT ?)
Because if we have a " functional Eclipse with MinGW" and we go directly to part 3, we never read that we need an unstable version of CDT...
But this is just for few next day, since CDT 3.0.0 become the stable version.

thanks for your help !
I am swiss french so my english is probably as bad as yours Wink
J'aurai dû m'en douter en regardant ta localisation :D
Tu sais s'il existe une communauté francophone pour Ogre ? (un peu comme pour Blender)
User avatar
steven
Gnoll
Posts: 657
Joined: Mon Feb 28, 2005 1:53 pm
Location: Australia - Canberra (ex - Switzerland - Geneva)
Contact:

Post by steven »

Tu sais s'il existe une communauté francophone pour Ogre ? (un peu comme pour Blender)
http://www.ogre-fr.net/
User avatar
:wumpus:
OGRE Retired Team Member
OGRE Retired Team Member
Posts: 3067
Joined: Tue Feb 10, 2004 12:53 pm
Location: The Netherlands
x 1

Post by :wumpus: »

Looks very useful, this, please wiki it :)

About the codeblocks and MinGW dependencies: isn't it possible to just use the Code::Blocks deps instead of mine? At least they're newer.
User avatar
steven
Gnoll
Posts: 657
Joined: Mon Feb 28, 2005 1:53 pm
Location: Australia - Canberra (ex - Switzerland - Geneva)
Contact:

Post by steven »

Looks very useful, this, please wiki it Smile
I will do when I find some time... I hope this month.
About the codeblocks and MinGW dependencies: isn't it possible to just use the Code::Blocks deps instead of mine? At least they're newer.
Yes, it's possible. I prefered to make this help based on the "official" downloads, this is way I didn't use the CB dependencies.
Last edited by steven on Sun Aug 07, 2005 12:13 pm, edited 1 time in total.
-ben-
Gnoblar
Posts: 10
Joined: Tue Apr 19, 2005 2:20 pm
Location: Paris, France

Re: Eclipse 3.1 + CDT 3.0.0 + Gcc 3.4 (MinGW+MYSys) + Ogre 1

Post by -ben- »

steven wrote:Eclipse 3.1 + CDT 3.0.0 RC2 + Gcc 3.4 (MinGW + MYSys) + Ogre 1.0.3

3.2.2 - Zziplib

I tried three solution only the last worked. If someone could show me a more elegant way...


3.2.2.2 - Copy it from CODE::BLOCKS

Ogrenew now compiles... even if the .a is NOT from the same zziplib version !!!
Hum, I wish it did ...

Actually I have the following link errors:

Code: Select all

../../Dependencies/lib/libzziplib.a * undefined reference to `inflate'  undefined reference to `inflateInit2_'
../../Dependencies/lib/libzziplib.a * undefined reference to `inflateEnd'  undefined reference to `inflateInit2_'
../../Dependencies/lib/libzziplib.a * undefined reference to `inflateInit2_'  undefined reference to `inflate'
../../Dependencies/lib/libzziplib.a * undefined reference to `inflateInit2_'  undefined reference to `zError'
I used the one from CB, and I use Eclipse 3.1 with CDT 3.0.0 RC2 if it helps ....
User avatar
steven
Gnoll
Posts: 657
Joined: Mon Feb 28, 2005 1:53 pm
Location: Australia - Canberra (ex - Switzerland - Geneva)
Contact:

Re: Eclipse 3.1 + CDT 3.0.0 + Gcc 3.4 (MinGW+MYSys) + Ogre 1

Post by steven »

-ben- wrote:

Code: Select all

../../Dependencies/lib/libzziplib.a * undefined reference to `inflate'  undefined reference to `inflateInit2_'
../../Dependencies/lib/libzziplib.a * undefined reference to `inflateEnd'  undefined reference to `inflateInit2_'
../../Dependencies/lib/libzziplib.a * undefined reference to `inflateInit2_'  undefined reference to `inflate'
../../Dependencies/lib/libzziplib.a * undefined reference to `inflateInit2_'  undefined reference to `zError'
I used the one from CB, and I use Eclipse 3.1 with CDT 3.0.0 RC2 if it helps ....

Sic... I feared that something like this would happen :(

I had the feelings that the "official" dependencies would cause problems, especially this libzziplib.a.
This is way I prefered to wait a bit before adding it to wiki.

The easiest solution would be to use only the dependencies from CodeBlocks (you will need to change the library's paths a little).

Or try to build the .a lib (see point 3.2.2.1), perhaps it will work for you even if it didn't work for me.


I should perhaps make this help relative to the CodeBlocks dependencies but I would prefer that it becomes first the "official" Ogre dependencies.

What do you think?


In fact... if your are not obliged to use Eclipse : CodeBlocks is much easier!

Sorry if this doesn't help you much! I also had difficulties with this library but not the sameone.
-ben-
Gnoblar
Posts: 10
Joined: Tue Apr 19, 2005 2:20 pm
Location: Paris, France

Re: Eclipse 3.1 + CDT 3.0.0 + Gcc 3.4 (MinGW+MYSys) + Ogre 1

Post by -ben- »

steven wrote:
The easiest solution would be to use only the dependencies from CodeBlocks (you will need to change the library's paths a little).
Hum, actually I replaced every official lib for the ones in CodeBlocks and it still doesn't work.
steven wrote: Or try to build the .a lib (see point 3.2.2.1), perhaps it will work for you even if it didn't work for me.

I should perhaps make this help relative to the CodeBlocks dependencies but I would prefer that it becomes first the "official" Ogre dependencies.

What do you think?
Well, I guess it would be a good solution if it works (I didn't manage to)
steven wrote: In fact... if your are not obliged to use Eclipse : CodeBlocks is much easier!
CodeBlocks may be easier but I don't think it's as powerful as Eclipse. (Well, powerful if you know how to use it ;) )
User avatar
steven
Gnoll
Posts: 657
Joined: Mon Feb 28, 2005 1:53 pm
Location: Australia - Canberra (ex - Switzerland - Geneva)
Contact:

Re: Eclipse 3.1 + CDT 3.0.0 + Gcc 3.4 (MinGW+MYSys) + Ogre 1

Post by steven »

-ben- wrote:

Code: Select all

../../Dependencies/lib/libzziplib.a * undefined reference to `inflate'  undefined reference to `inflateInit2_'
../../Dependencies/lib/libzziplib.a * undefined reference to `inflateEnd'  undefined reference to `inflateInit2_'
../../Dependencies/lib/libzziplib.a * undefined reference to `inflateInit2_'  undefined reference to `inflate'
../../Dependencies/lib/libzziplib.a * undefined reference to `inflateInit2_'  undefined reference to `zError'
I used the one from CB, and I use Eclipse 3.1 with CDT 3.0.0 RC2 if it helps ....
:oops: I didn't look correctly at the error messages.

The linker doesn't find zlib functions.

It's not the zzipib library you need to check put zlib (see point 3.2.1).
User avatar
steven
Gnoll
Posts: 657
Joined: Mon Feb 28, 2005 1:53 pm
Location: Australia - Canberra (ex - Switzerland - Geneva)
Contact:

Post by steven »

== WIKIED ==


UPDATE August 05 : A newer version of this guide has been put on wiki. See http://www.ogre3d.org/wiki/index.php/Bu ... se_And_GCC

TODO : Linux version ! Any help appreciated.

Bye
jabbadude
Gnoblar
Posts: 5
Joined: Tue Aug 23, 2005 2:35 am

MinGW Gcc 3.2, MSys 1.0.10, Ogre 1.0.4

Post by jabbadude »

I had the same linker error until I switched zlib and zziplib in the linker prefs. "..., zlib, zziplib, ..." should be "..., zziplib, zlib, ...". Just use the up or down arrow.

I think your wiki tutorial is great. I have build OgreMain and the Demo using Eclipse 3.1, CDT 3.0.0 RC2, MinGW (Gcc 3.2[stable], MSys 1.0.10) and the new Ogre 1.0.4!

You might want to know that I didn't use 'mingw32-make'. I used the default, which is 'make', which comes with MSys... 'mingw32-make' simply just don't exist in my configuration... (se below for which mingw files I installed from)

A bit off topic... How do I tell Eclipse not to "make CLEAN all" every time I tell it to build..? I must have been compiling OgreMain for several hours tonight just to try to track down the linker problem.

Regards


The MinGW install files
binutils-2.15.91-20040904-1.tar.gz
gcc-core-3.4.2-20040916-1.tar.gz
gcc-g++-3.4.2-20040916-1.tar.gz
gdb-5.2.1-1.exe
mingw-runtime-3.8.tar.gz
MSYS-1.0.10.exe
w32api-3.3.tar.gz
User avatar
steven
Gnoll
Posts: 657
Joined: Mon Feb 28, 2005 1:53 pm
Location: Australia - Canberra (ex - Switzerland - Geneva)
Contact:

Post by steven »

I had the same linker error until I switched zlib and zziplib in the linker prefs. "..., zlib, zziplib, ..." should be "..., zziplib, zlib, ...". Just use the up or down arrow.
You are right. It's also what I have in my settings. I will make the change in wiki.
I think your wiki tutorial is great. I have build OgreMain and the Demo using Eclipse 3.1, CDT 3.0.0 RC2, MinGW (Gcc 3.2[stable], MSys 1.0.10) and the new Ogre 1.0.4!
Thanks :D Good to know it compile 1.0.4!
You might want to know that I didn't use 'mingw32-make'. I used the default, which is 'make', which comes with MSys... 'mingw32-make' simply just don't exist in my configuration... (se below for which mingw files I installed from)
Again you are right. The first time I tried the compilation it didn't work with make... so I posted what worked for me. When I compile 1.0.4 I will try using make.
A bit off topic... How do I tell Eclipse not to "make CLEAN all" every time I tell it to build..? I must have been compiling OgreMain for several hours tonight just to try to track down the linker problem.
AFAIK, you can't.

I remember a CDT forum topic about this issue. They will, perhaps, address this issue in a next point release... IMO the "Managed Make C++ Project" impose to much and needs to be redone.

It would be great if a make-expert could create a new tool chain plugin. See chapter 5 :
http://dev.eclipse.org/viewcvs/index.cg ... ls_Project

Sic... if only Eclipse was an Ogre project. :wink:
darkkeeper
Gnoblar
Posts: 2
Joined: Thu Aug 25, 2005 1:37 am
Location: Magdeburg
Contact:

Post by darkkeeper »

first of all, thank you a lot for this great guide

for me, who is totally new to ogre :oops: and also CDT for Eclipse it was well understanding
after quite some time i got most of the stuff compiled
but there is still a problem:
when i build a demo it creates two ".exe" files
one in:
ogrenew\Samples\Demo\Release\Demo.exe

the other one in:
ogrenew\Samples\Common\bin\Release\Demo.exe

when i run the first one (which is also displayed in eclipse under project binaries) it tells me it can't find the OgreMain.dll
when i run the second one it throws an exception by not finding the media sources (models, materials...)

what do i do wrong? is there any references missing?!
darkkeeper
Gnoblar
Posts: 2
Joined: Thu Aug 25, 2005 1:37 am
Location: Magdeburg
Contact:

Post by darkkeeper »

apologies, for my (too early) post
i was tired (still am ;) and frustrated so i overlooked the error 1812 issue. it works fine now

thank you
User avatar
Yavin
Bronze Sponsor
Bronze Sponsor
Posts: 140
Joined: Wed Mar 02, 2005 3:41 pm
Location: Lake Constance, Germany
Contact:

Post by Yavin »

darkkeeper wrote:one in:
ogrenew\Samples\Demo\Release\Demo.exe
This is the build directory of your Project "Demo". Here will the linker output the exe.
darkkeeper wrote: the other one in:
ogrenew\Samples\Common\bin\Release\Demo.exe
This is the common runtime directory of Ogre. It contains all necessary dlls to run a OgreApp.

To start your Demo you have to execute your exe in the second dir or copy all necessary dlls to your build dir and execute it there.
Glen
Gnoblar
Posts: 1
Joined: Tue Sep 06, 2005 3:26 pm

Post by Glen »

Just been playing with this, it's been a long while since I did and C++ and that was very basic, but.

I actually had problems using mingw32-make, had to find it in the mingw file list on sourceforge, but it seems to have a problem reading some file or other.

I got some thing about "src/OgreAnimation.d:1 invalid seperator Stop"
I can't remeber exactly but once I changed to use make in Msys it went away.

I had a go compiling with cygwin, couldn't get it to work, kept linking to the cygwin1.dll and dying because it couldn't allocate enough memory. So I eventually killed off cygwin.

Hope this helps someone else.
User avatar
steven
Gnoll
Posts: 657
Joined: Mon Feb 28, 2005 1:53 pm
Location: Australia - Canberra (ex - Switzerland - Geneva)
Contact:

Post by steven »

Glen wrote:I actually had problems using mingw32-make, had to find it in the mingw file list on sourceforge, but it seems to have a problem reading some file or other.

I got some thing about "src/OgreAnimation.d:1 invalid seperator Stop"
I can't remeber exactly but once I changed to use make in Msys it went away.
It is true that using the Msys make is the correct way.

But on the opposite to you, I had problem with the Msys make... !

Mysys make calls mingw32-make (with some settings/behaviors unknown of me) hence I used mingw32-make directly ;-)

In fact I was waiting that experimented mingw users could convince me that make is sufficient... and then update the wiki. 8)
(Perhaps with a note that in case of problems the other make should be tried).
I had a go compiling with cygwin, couldn't get it to work, kept linking to the cygwin1.dll and dying because it couldn't allocate enough memory. So I eventually killed off cygwin.
The following Ogre thread comparing Cygwin and Mingw explains that both can be used to compile ogre with pure native win32 code: by passing ‘-mno-cygwin’ to the gcc supplied by Cygwin, this compiler generates Mingw code!. See :
http://www.ogre3d.org/phpBB2/viewtopic. ... sus+cygwin

With this parameter you should be independent of cygwin1.dll.
Baalzamon
Gnoblar
Posts: 16
Joined: Sun Nov 27, 2005 11:23 am

Post by Baalzamon »

Hi Folks,

first of all, thanks for that great step-by-step guide.

Anyway I can't build the PlatformManager_Win32.dll and RenderSystem_Direct3D9.dll.

I pointed the problem out in this ( http://www.ogre3d.org/phpBB2/viewtopic.php?t=15482 ) thread, maybe anyone can help me?

I think when I solve the problem concerning the PlatformManager the other one eill be easily solved too.

Regards,
Baalzamon
User avatar
steven
Gnoll
Posts: 657
Joined: Mon Feb 28, 2005 1:53 pm
Location: Australia - Canberra (ex - Switzerland - Geneva)
Contact:

Post by steven »

I will give you my answer in the thread you mentionned.

http://www.ogre3d.org/phpBB2/viewtopic.php?t=15482
The_Narf
Gnoblar
Posts: 11
Joined: Fri Mar 17, 2006 3:53 pm

Post by The_Narf »

Hi,
great guide ^^

It's the first time i use eclipse with c++, i followed all the guide but in the end i have an error.

I don't have any idea from where it comes.

I launch the Demo_BezierPatch.exe and the windows appear without problem:
Image

but when i click ok i have a Windows error with those details:
Image

It seems to come from Ogremain.dll

Do you have any idea?
Oh and i used

ogre-win32-v1-2-0RC1.zip
codeblocks-dependencies-2.0.1.zip

org.eclipse.cdt.sdk-3.0.2-win32.x86.zip
Last edited by The_Narf on Fri Mar 17, 2006 5:25 pm, edited 1 time in total.
Post Reply