Crystal Space
Welcome, Guest. Please login or register.
November 18, 2017, 01:17:40 pm

Login with username, password and session length
Search:     Advanced search
9081 Posts in 2051 Topics by 80387 Members
Latest Member: Jorgecrook2872
* Home Help Search Login Register
+  Crystal Space
|-+  Crystal Space Development
| |-+  General Crystal Space Discussion
| | |-+  CS + Eclipse + MingW32 HowTo
« previous next »
Pages: [1] Print
Author Topic: CS + Eclipse + MingW32 HowTo  (Read 3074 times)
Posts: 1

View Profile
« on: February 18, 2006, 09:15:22 pm »

This is a HowTo for an external Project using CS, Eclipse IDE and MingW32.

Eclipse is, unfortunately, not easy to set up.

  • You have installed Eclipse + CDT Plugin for C/C++ Development
  • You have installed MingW32+Msys
  • You have downloaded (and unpacked) CS; and you have installed cs-win32libs package
  • You have configured and build CS (./configure && jam) in msys' shell

Now start Eclipse and choose File->"New Project".
The New Project wizard starts. Choose "C++"=>"Managed Make C++ " and then click "next".
Typ a name for the Project and click "finish". In the "Open Associated Perspective" dialog click "yes".
You have now a directory with the project name in your eclipse work directory.
Copy cs-config from CS dir to this project directory.

For a test also add simple1.cpp and simple1.h from CS/apps/tutorial/simple1 into the project directory,
so we have something that actually can be complied wink (You can delete the two when everything is set up properly.)
To make eclipse notice your files, right-click on the Project name in eclipse and choose "Refresh".
Now choose "Project->Properties" an navigate to "C/C++ Build".
You should see a dialog window "Configuration Settings", where the tab "Tool Settings" should be selected.
Select "GCC C++ Compiler"->Miscellanous. Add `../cs-config --cxxflags`to "Other flags" so it reads:
-c -fmessage-length=0 `../cs-config --cxxflags`
Notice: Use `` and not ' ' -- They have to be backticks and not apostropies (or just use copy & paste wink ).

Now select "GCC C++ Linker" ->"Miscellaneous".
Add `../cs-config --libs` to "Linker flags".

Up to now pretty this was much like any other extenal CS Project Environment Setup.

Now select "GCC C++ Linker" (one level up).
You habe (under "Expert settings:") the Command line pattern
This contains a show-stopper: It has {INPUTS} as the LAST argument. Meeep. Wrong.
The G++ linker resolves symbols from "left to right" so will always end with "unresolved symbols" when you list your *.o file last.
You must change the Command line pattern so it reads:

To make eclipse use the MingW32 gcc compiler, I also modified PATH Variable in tab Environment, sub-tab Configuration (Button New).
You will also have to add a CRYSTAL Variable there. Note that you have to use MingW32 Syntax for the CRYSTAL variable, as in

Close the Dialog with "OK".
Eclipse should now rebuild your project sucessfully.

« Last Edit: February 18, 2006, 10:02:46 pm by turboj » Logged
Pages: [1] Print 
« previous next »
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.2 | SMF © 2006-2007, Simple Machines LLC Valid XHTML 1.0! Valid CSS!
Page created in 4.151 seconds with 15 queries.