aliens

Author Topic: Advice for choosing the compilation way  (Read 16079 times)

Offline Xtendo-com

  • Colonel
  • ****
  • Posts: 118
    • View Profile
Advice for choosing the compilation way
« on: April 09, 2016, 07:30:51 pm »
In UFOpaedia there are several ways to compile openxcom. As windows user, you can use an IDE Visual Studio or a compiler MinGW with some batch scripts or use a virtual machine with GNU/Linux distributive. As I understand developers of OXC uses a visual studio 2010 or 2013, but OXCE or OXCE+ a visual studio 2015.

Questions:
Q) Is there are any advantage to use complicated MinGW way to compile? Or complicated way like compile window binary in GNU/Linux?
A) Yes, that way compiles a executable file with less dependencies and less additional files than visual studio. More details
I tried to make compile environment process of window binary less complicated in GNU/Linux using Xubuntu 14.04 LTS. You can download scripts here.

Q) Is there are a reason to use a newest version of VS if an old version can complete a task?
A) In order to compile OXC there are no special reason to use newest version, but you can't compile OXCE or OXCE+ without rewriting the code.

Q) If I want to compile OXCE or OXCE+ without spending time to re-adaptation to VS 2010 I need a visual studio 2015?
A) Yes, because VS2015 supports C++11 that is used in these forks.

Q) In UFOpaedia there are no precompiled dependencies for VS2015
A) Check this. Read carefully, because these dependencies are not enough to make a successfully build.
« Last Edit: April 11, 2016, 07:10:54 pm by 404_user_not_found »

Online Meridian

  • Global Moderator
  • Commander
  • *****
  • Posts: 9089
    • View Profile
Re: Advice for choosing the compilation way
« Reply #1 on: April 09, 2016, 07:42:31 pm »
OXCE and OXCE+ cannot be compiled on visual studio 2010 or 2013 anymore, because they don't support C++11, which is required.

Compilation under something else than visual studio 2015 has the advantage that it (the result) works for everyone, not only for 98% of people.

If it however works for you, feel free to compile on visual studio 2015... I do that for myself too; and only compile differently when I want to share it publicly.

Offline yrizoud

  • Commander
  • *****
  • Posts: 1014
    • View Profile
Re: Advice for choosing the compilation way
« Reply #2 on: April 09, 2016, 08:35:53 pm »
Mingw is completely free and open.
Visual Studio is expensive, so you can either find a special offer (I heard it can be free for students) or get the "Express" version which has some limitations - I don't know which ones, I work as a developer and my employer pays for the full versions.

Offline Yankes

  • Global Moderator
  • Commander
  • *****
  • Posts: 3350
    • View Profile
Re: Advice for choosing the compilation way
« Reply #3 on: April 09, 2016, 09:06:52 pm »
Mingw is completely free and open.
Visual Studio is expensive, so you can either find a special offer (I heard it can be free for students) or get the "Express" version which has some limitations - I don't know which ones, I work as a developer and my employer pays for the full versions.
Express is now community edition that is exactly same as normal paid version. IIRC up to 5 developer VS is free, after that you need buy it normally.

Offline Xtendo-com

  • Colonel
  • ****
  • Posts: 118
    • View Profile
Re: Advice for choosing the compilation way
« Reply #4 on: April 09, 2016, 09:35:34 pm »
Now I understand that I need VS2010 or VS2013 for OXC and VS2015 for OXCE or OXCE+ if I don't want to spend hours and days in order to setup a compilation system that works fine with current project and forks. We can download a community edition of VS2010 and VS2015, so there are no reason to use a complicated GNU/Linux way to compile a windows binary.

and only compile differently when I want to share it publicly.
What a difference you mean? Is it a code changes or project setting that provides maximum running compatibility with old OS like WinXP?

Online Meridian

  • Global Moderator
  • Commander
  • *****
  • Posts: 9089
    • View Profile
Re: Advice for choosing the compilation way
« Reply #5 on: April 09, 2016, 09:43:49 pm »
What a difference you mean?

When I compile under vs2015... I get:
1. one EXE
2. and a bunch of DLLs
3. and a prerequisite for MSVC++15 32-bit which people have to download and install
4. and even then it doesn't work for everyone...

When I compile under Mingw, I get one single EXE and nothing else... that's it... and it works for everyone so far.

Offline Xtendo-com

  • Colonel
  • ****
  • Posts: 118
    • View Profile
Re: Advice for choosing the compilation way
« Reply #6 on: April 09, 2016, 10:17:57 pm »
When I compile under Mingw, I get one single EXE and nothing else... that's it... and it works for everyone so far.
From this point of view MinGW looks more interesting. Do you apply any code changes to source when you try to compile the code with MinGW after working in VS2015?

Online Meridian

  • Global Moderator
  • Commander
  • *****
  • Posts: 9089
    • View Profile
Re: Advice for choosing the compilation way
« Reply #7 on: April 09, 2016, 10:33:55 pm »
From this point of view MinGW looks more interesting. Do you apply any code changes to source when you try to compile the code with MinGW after working in VS2015?

No, the source code is exactly the same.

Offline Xtendo-com

  • Colonel
  • ****
  • Posts: 118
    • View Profile
Re: Advice for choosing the compilation way
« Reply #8 on: April 10, 2016, 10:24:57 am »
Modified a main post with question answered.

Offline Xtendo-com

  • Colonel
  • ****
  • Posts: 118
    • View Profile
Re: Advice for choosing the compilation way
« Reply #9 on: April 11, 2016, 06:25:52 am »
A method where Yankes or Meridian uses Makefile.mxe in order to build windows binary in GNU/Linux also works with usually OXC without source code modifications, if you downgrade yaml-cpp to 0.5.1 and include boost library (current version 1.60.0 works fine).
Also since the only reason to use C++11 was yaml-cpp, I think that by downgrading yaml-cpp to 0.5.1 you can compile OXCE and OXCE+ in old visual studio.
« Last Edit: April 11, 2016, 02:30:50 pm by 404_user_not_found »

Online Meridian

  • Global Moderator
  • Commander
  • *****
  • Posts: 9089
    • View Profile
Re: Advice for choosing the compilation way
« Reply #10 on: April 11, 2016, 10:24:53 am »
Also since the only reason to use C++11 was yaml-cpp, I think that by downgrading yaml-cpp to 0.5.1 you can compile OXCE and OXCE+ in old visual studio.

Why do you think it's only yaml-cpp?
OXCE uses C++11 too...

Offline Xtendo-com

  • Colonel
  • ****
  • Posts: 118
    • View Profile
Re: Advice for choosing the compilation way
« Reply #11 on: April 11, 2016, 02:29:48 pm »
Why do you think it's only yaml-cpp?
OXCE uses C++11 too...
Just blind belief after reading about yaml-cpp updates (fixed my post to prevent mislead), but I didn't check that since I only preparing compile environment in xubuntu and I didn't tried to compile with visual studio.

Later I will attach some scripts that automatically prepares compile environment in xubuntu 14.04 LTS (download sources, prepares necessary packages and etc). May work in other editions like ubuntu, kubuntu and etc, since the only difference is desktop environment, but I didn't check. Includes OXC, OXCE and OXCE+ and you can compile windows binary from the start.
« Last Edit: April 11, 2016, 02:33:02 pm by 404_user_not_found »

Offline Xtendo-com

  • Colonel
  • ****
  • Posts: 118
    • View Profile
Re: Advice for choosing the compilation way
« Reply #12 on: April 11, 2016, 07:05:30 pm »
Later I will attach some scripts that automatically prepares compile environment in xubuntu 14.04 LTS (download sources, prepares necessary packages and etc). May work in other editions like ubuntu, kubuntu and etc, since the only difference is desktop environment, but I didn't check. Includes OXC, OXCE and OXCE+ and you can compile windows binary from the start.
1) Scripts has comments inside. Read them.
2) Execute script with terminal in order to see output.
3) Output directory - %your home directory%/Project

Offline Yankes

  • Global Moderator
  • Commander
  • *****
  • Posts: 3350
    • View Profile
Re: Advice for choosing the compilation way
« Reply #13 on: April 11, 2016, 07:34:50 pm »
btw, default configuration of sdl_mixer in mxe don't have enabled flat file formats, if someone want it I have commit that enable it:
https://github.com/Yankes/mxe

Offline Xtendo-com

  • Colonel
  • ****
  • Posts: 118
    • View Profile
Re: Advice for choosing the compilation way
« Reply #14 on: April 11, 2016, 10:42:46 pm »
btw, default configuration of sdl_mixer in mxe don't have enabled flat file formats, if someone want it I have commit that enable it:
https://github.com/Yankes/mxe
Usually open source software don't include formats like mp3 by default but this something new... flac is open source... strange.

Also... I forget to thank everybody who payed attention to my posts. Now I will try to fork but no sure what. OXC or extended? Not sure. My aim is to include more advanced options that already implemented by community but never used, like advanced scanner, throw trajectory, manual control of civilians and etc. So you will get tons of experimental user decide options.