Author Topic: alternative way to setup MG in eclipse  (Read 1360 times)

titi

  • MegaGlest Team
  • Airship
  • ********
  • Posts: 4,239
    • View Profile
    • http://www.titusgames.de
alternative way to setup MG in eclipse
« on: 19 January 2013, 14:23:08 »
As I wasn't very happy with setting up an eclipse project using cmake, here is an alternative description (for linux):

step1:
Checkout MG.
run build-mg.sh and make everything work so you can compile MegaGlest

step2:
Import MG in eclipse ( via right click ):

Choose the source directory in your svn checkout.


step3:
Setup compile options in eclipse:
-  change make call to "make -j4" where 4 is the number of CPU-Cores you have.
-  set build directory to "build" in your checked out directory.


step4
Setup run configuration so you can launch MG directly form eclipse:


update:
We had some trouble to setup this for my son. All external things( from libs ) were marked as error.

To fix it we disbabled "build automatically" and made a "Project->clean" after this.

« Last Edit: 21 April 2013, 17:24:53 by titi »
Try Megaglest! Improved Engine / New factions / New tilesets / New maps / New scenarios

Omega

  • MegaGlest Team
  • Dragon
  • ********
  • Posts: 6,167
  • Professional bug writer
    • View Profile
    • Personal site
Re: alternative way to setup MG in eclipse
« Reply #1 on: 19 January 2013, 21:20:45 »
I'm curious, could this work in Windows too if we used the MinGW toolchain?
Edit the MegaGlest wiki: http://docs.megaglest.org/

My personal projects: http://github.com/KatrinaHoffert

softcoder

  • MegaGlest Team
  • Battle Machine
  • ********
  • Posts: 2,238
    • View Profile
Re: alternative way to setup MG in eclipse
« Reply #2 on: 22 January 2013, 07:31:13 »
No since we don't have a ming dependencies archive (at least not up to date).

Omega

  • MegaGlest Team
  • Dragon
  • ********
  • Posts: 6,167
  • Professional bug writer
    • View Profile
    • Personal site
Re: alternative way to setup MG in eclipse
« Reply #3 on: 22 January 2013, 20:36:46 »
Pity. I'm not a fan of visual studio, which often bugs up on me, but Eclipse is a fantastic IDE. Do these dependencies exist around the web, though? Would it be possible to manually download each one needed?
Edit the MegaGlest wiki: http://docs.megaglest.org/

My personal projects: http://github.com/KatrinaHoffert

softcoder

  • MegaGlest Team
  • Battle Machine
  • ********
  • Posts: 2,238
    • View Profile
Re: alternative way to setup MG in eclipse
« Reply #4 on: 23 January 2013, 06:22:04 »
The big question is whether all the deps compile (or are available) under mingw compiler. A while back i did this using mingw on Linux, but haven't updated it for a long while.  Nothing stops you from trying, the cmake script has the support for proably 90% of mg building in mingw, I think the script i built for that (in Linux) is in the same folder as the Linux build script but the ming script is called build-mg-win32.sh (which shows how to call cmake for using mingw)

titi

  • MegaGlest Team
  • Airship
  • ********
  • Posts: 4,239
    • View Profile
    • http://www.titusgames.de
Re: alternative way to setup MG in eclipse
« Reply #5 on: 21 April 2013, 17:23:13 »
We had some trouble to setup this for my son. All external things( from libs ) were marked as error.

To fix it we disbabled "build automatically" and made a "Project->clean" after this.


!! PLease report if you have any Problems with this!!
Try Megaglest! Improved Engine / New factions / New tilesets / New maps / New scenarios

titi

  • MegaGlest Team
  • Airship
  • ********
  • Posts: 4,239
    • View Profile
    • http://www.titusgames.de
Re: alternative way to setup MG in eclipse
« Reply #6 on: 23 July 2014, 20:33:39 »
touch
Try Megaglest! Improved Engine / New factions / New tilesets / New maps / New scenarios

Omega

  • MegaGlest Team
  • Dragon
  • ********
  • Posts: 6,167
  • Professional bug writer
    • View Profile
    • Personal site
Re: alternative way to setup MG in eclipse
« Reply #7 on: 25 July 2014, 05:28:42 »
I actually started typing up how I eventually "figured out" how to get rid of the various errors Eclipse thought I had. It was caused by the SDL_types include in shared_lib/include/platform/sdl/data_types.h. The file has a line:

Code: [Select]
#include <SDL_types.h>
which had to be changed to

Code: [Select]
#include <SDL/SDL_types.h>
But now I've got yet more errors (I'm leaving what I already typed in case it's useful for anyone else).

Honestly, getting MG to work in Eclipse has been nothing but a complete disaster for me. I've spent more than 5 hours trying to get the errors to go away. I've tried every Stackoverflow answer I could find, advice from the IRC, and more. So now I've just disabled all code analysis in Eclipse. I hope those CMake files are well configured in regard to warnings.

If anyone else needs to do this, for Eclipse 4.4 Luna, go to Project > Properties > C/C++ General > Code Analysis and switch to "Use project settings", then uncheck every box. Then go to the "Launching" subcategory and make sure both boxes are unchecked.

This keeps the index intact, so you can still use the call hierarchy (etc), but completely removes all warnings and errors in Eclipse. You'll have to compile to find warnings and errors.
Edit the MegaGlest wiki: http://docs.megaglest.org/

My personal projects: http://github.com/KatrinaHoffert

 

anything