Author Topic: [SOLVED] Need help compiling OXC Extended (Meridian's mod) on Linux  (Read 4410 times)

Offline joemaro

  • Squaddie
  • *
  • Posts: 4
    • View Profile
Hello!

i need help with compiling the OpenXCom-Extended Source (Meridian's mod) on Linux (Manjaro Linux which is based on arch)

I was doing these steps:
Code: [Select]
* cd Downloads/OpenXcom-oxce3.0-plus-proto/
* mkdir build
* ./configure --prefix=/usr --without-docs
* cmake -DCMAKE_BUILD_TYPE=Release .. -Wno-dev
* make
and i get the following errors:
https://hastebin.com/ozokaxugas.pas

OpenXCom 1.0 did compile just perfectly from AUR and i wonder why this build isn't.

(The goal is to play x-piratez.)

Very thankful for help & lots of thanks for all your combined work on this beautiful game!!!
« Last Edit: October 12, 2016, 02:46:54 pm by joemaro »

Offline Arthanor

  • Commander
  • *****
  • Posts: 2488
  • XCom Armoury Quartermaster
    • View Profile
Re: Need help compiling OXC Extended (Meridian's mod) on Linux
« Reply #1 on: October 11, 2016, 04:53:30 pm »
Provided you don't have weird dependency issues, I've found the cmake instructions here very reliable:

https://www.ufopaedia.org/index.php/Compiling_with_CMake_(OpenXcom)#End-to-end_example

Offline ohartenstein23

  • Commander
  • *****
  • Posts: 1931
  • Flamethrowers fry cyberdisk circuits
    • View Profile
Re: Need help compiling OXC Extended (Meridian's mod) on Linux
« Reply #2 on: October 11, 2016, 05:24:06 pm »
Code: [Select]
In file included from src/Basescape/CraftArmorState.cpp:19:0:
src/Basescape/CraftArmorState.h: In constructor ‘OpenXcom::CraftArmorState::CraftArmorState(OpenXcom::Base*, size_t)’:
src/Basescape/CraftArmorState.h:53:9: error: ‘OpenXcom::CraftArmorState::_craft’ will be initialized after [-Werror=reorder]
  size_t _craft, _savedScrollPosition;
         ^~~~~~
src/Basescape/CraftArmorState.h:51:25: error:   ‘std::vector<OpenXcom::Soldier*> OpenXcom::CraftArmorState::_origSoldierOrder’ [-Werror=reorder]
  std::vector<Soldier *> _origSoldierOrder;
                         ^~~~~~~~~~~~~~~~~
src/Basescape/CraftArmorState.cpp:54:1: error:   when initialized here [-Werror=reorder]
 CraftArmorState::CraftArmorState(Base *base, size_t craft) : _base(base), _craft(craft), _origSoldierOrder(*_base->getSoldiers()), _savedScrollPosition(0)
 ^~~~~~~~~~~~~~~
cc1plus: all warnings being treated as errors

The error code you're getting is from just declaring variables in a different order between the .h and .cpp files - but it should be just passed as a warning, I've gotten it to compile just fine on Ubuntu despite the mismatched variable order.  The issue is probably that you have -Werror=reorder set in the compiler flags somewhere, and would have to remove it to compile as is.  The other option would to going through file by file and fixing the variable order... but that's not going to be fun.

edit:  Based on this, maybe try adding -Wno-error=reorder to CXXFLAGS or change
Code: [Select]
cmake -DCMAKE_BUILD_TYPE=Release .. -Wno-dev to
Code: [Select]
cmake -DCMAKE_BUILD_TYPE=Release .. -Wno-dev -Wno-error=reorder?
« Last Edit: October 11, 2016, 05:28:16 pm by ohartenstein23 »

Offline joemaro

  • Squaddie
  • *
  • Posts: 4
    • View Profile
Re: Need help compiling OXC Extended (Meridian's mod) on Linux
« Reply #3 on: October 11, 2016, 08:41:37 pm »
hey thanks a lot!

Sorry, i think i made a mistake while explaining which commands i run and the errors they bring up.
Here's the more complete story:

when running
Code: [Select]
cmake .., it already fails and i get this:

Code: [Select]
CMake Error at CMakeLists.txt:809 (install):
   install TARGETS given no RUNTIME DESTINATION for executable target
   "openxcom".



 CMake Error at CMakeLists.txt:824 (target_link_libraries):
   The "optimized" argument must be followed by a library.

Same happens with ccmake, so i looked into src/CMakeLists.txt, but it seems fine to my amateur eye :P
I compared them to the version i successfully compiled with AUR, but don't understand why these errors come up.

I assume that the 1.0 of OXC and Meridians mod share the same dependencies?

Would love to get this working <3

Offline Arthanor

  • Commander
  • *****
  • Posts: 2488
  • XCom Armoury Quartermaster
    • View Profile
Re: Need help compiling OXC Extended (Meridian's mod) on Linux
« Reply #4 on: October 11, 2016, 08:53:31 pm »
Silly check, but since it's missing in the steps you describe: Do you change directory into the build directory?

You list:

Code: [Select]
cd Downloads/OpenXcom-oxce3.0-plus-proto/
* mkdir build
* ./configure --prefix=/usr --without-docs
* cmake -DCMAKE_BUILD_TYPE=Release .. -Wno-dev
* make

but you need to be in build when you run cmake .. because otherwise you're trying to use cmake in Downloads and that'll do nothing. You need to make build, then cd into it, then cmake .. like in the wiki article I linked.

Offline joemaro

  • Squaddie
  • *
  • Posts: 4
    • View Profile
Re: Need help compiling OXC Extended (Meridian's mod) on Linux
« Reply #5 on: October 11, 2016, 10:42:08 pm »
Yes, i'm sorry for forgetting to list the command...

I actually followed the wiki instructions exactly when i tried it.

Offline R1dO

  • Colonel
  • ****
  • Posts: 437
    • View Profile
Re: Need help compiling OXC Extended (Meridian's mod) on Linux
« Reply #6 on: October 12, 2016, 01:47:54 am »
...
Code: [Select]
...
* ./configure --prefix=/usr --without-docs
* cmake -DCMAKE_BUILD_TYPE=Release .. -Wno-dev
...
Why are you trying to combine 2 different build systems?

As far as i know it is either (starting from the repository root)
Code: [Select]
./configure [all your desired flags]
make

or
Code: [Select]
mkdir build
cd build
cmake [all your desired cmake flags] ..
make

Combining both will most likely create quite a mess ;)

Furthermore, you add " -Wno-dev" at the end of the cmake command. I'm not sure if that is a valid option (especially after the path specification "..").

Hope this helps a bit.

Offline joemaro

  • Squaddie
  • *
  • Posts: 4
    • View Profile
Re: Need help compiling OXC Extended (Meridian's mod) on Linux
« Reply #7 on: October 12, 2016, 02:46:29 pm »
Hey R1do!

Thanks a lot! Your recommendation helped me. I hadn't used cmake before so i didn't know how to correctly configure.

without configure it worked!

THANKS TO ALL OF YOU!!!!

joe