Development > Newbie Coding

Compile and debug with Eclipse in Windows

(1/2) > >>

Cel123:
Im not only new to UFOAI, but also to C, so lacking even the most basic sense. What i would like to do is to run the game from Eclipse on my Windows 7 machine and then play the full campaign - I want to play the newest version, but it crashes a lot, and I thought i could maybe work out why if i ran the game in debug..

So, what i have done thus far:

1) Installed TortoiseGit from http://tortoisegit.googlecode.com/files/TortoiseGit-1.7.11.3-32bit.msi
2) With depth specified as 1, cloned git://ufoai.git.sourceforge.net/gitroot/ufoai/ufoai
3) Installed MinGW with the options of C compiler and MSYS from https://sourceforge.net/projects/mingw/files/latest/download?source=files
4) Edited PATH Environment Variable C:\MinGW\msys\1.0\bin;C:\MinGW\bin;
5) Got Eclipse CDT (Juno) from http://www.eclipse.org/downloads/download.php?file=/technology/epp/downloads/release/juno/R/eclipse-cpp-juno-win32.zip

Next steps?:
Now i dont know how to compile C code at all, so i have no idea how i should import the ufoai source code into Eclipse workspace as a project that could then be compiled by Eclipse and run in debug mode?

Mattn:
Start eclipse and go to File->New->C++ Project (maybe hidden under Other->C++)
Select the ufoai checkout dir and click import.
Right click the ufoai project and select Properties
Go to the C/C++ Build options and make sure that Generate Makefiles automatically is disabled and the default build command is make. Save the options, and hit CTRL+B (or go to Project->Build)

Cel123:
Thanks Mattn!

When i go to File->New-> C++ project i come across two issues:
6a) after choosing the checkout dir it says "I:\ufoai\ufoai overlaps the location of another project 'ufoai'" and therefore does not allow me to click next
7a) there are a number of suboptions to choose from, which one should it be anyway- screenshot attached?

So i tried the following instead and may have gotten further
6b) File->Import Project->C/C++->Existing Code as Makefile Project
7b) Hit Next, and left the default options of Languages both C and C++ ticked, and Toolchain for Indexer Settings as <none> (other options were Cross GCC, GNU Autotools Toolchain, Microsoft Visual C++, MinGW GCC)

8) After checking the project properties you mentioned, which were like you said already, i tried building but got the following two errors:

Error 1:
make: *** [debug-mingw32-i386/cgame-campaign/client/cgame/campaign/cl_game_campaign.cpp.o] Error 127   ufoai          C/C++
Error 2:
/bin/sh: git: command not found   ufoai          C/C++ Problem

What are they / how can i build successfully?

p.s. in the checkout folder i see a new dir called debug-mingw32-i386 but there is not much in there, mainly empty subdirectories
p.p.s. additional new creations in the checkout folder are the following files: .project .cproject config.h Makefile.local

Cel123:
i went back to my mingw installer and added the C++ compiler option (on top of C compiler and MSYS).
now, when i try to build in eclipse, the errors are the following:

Error 1:
/bin/sh: git: command not found   ufoai          C/C++ Problem
Error 2:
fatal error: SDL/SDL_endian.h: No such file or directory   byte.h   /ufoai/src/shared   line 31   C/C++ Problem
Error 3:
make: *** [debug-mingw32-i386/game/game/g_actor.cpp.o] Error 1   ufoai          C/C++ Problem

Mattn:
you don't have the needed libs installed - SDL is a requirement e.g. - see here for a full list.

Navigation

[0] Message Index

[#] Next page

Go to full version