Author Topic: Misadventures in compiling  (Read 379 times)

Offline voskhod

  • Zombie Food
  • *
  • Posts: 87
    • View Profile
Misadventures in compiling
« on: October 01, 2016, 12:27:22 AM »
After checking both the guide on this subforum (which is now outdated) as well as COMPILING.md in the game's source code, I've made a bit of progress towards building Cataclysm successfully, but I've run into a roadblock. After getting all of the LUA and SDL libraries working in Code Blocks, I've been unable to compile two of the last libraries needed to build Cataclysm (specifically gettext-0.19.4 and libiconv-1.14), and all attempts to compile said libraries have resulted in failure. As a result of this (or at least, I THINK as a result of this) attempting to build Cataclysm results in things grinding to a halt somewhere around computer.cpp and bionics.cpp

https://puu.sh/rtq0Z/0dad086f55.png

I'd like to know what I'm doing wrong at this point because I can't figure it out. What IDE do you folks use to develop Cataclysm anyways? Visual Studios?

Offline Coolthulhu

  • Contributor
  • Survivor
  • ****
  • Posts: 3484
    • View Profile
Re: Misadventures in compiling
« Reply #1 on: October 01, 2016, 06:38:39 AM »
Compile a minimal example first, don't try to go for the full build.

Drop features from your build until it compiles.
Or even better: start with just a console release build.
If you're only using it to test new features not related to tiles, you don't need anything more.

I'm pretty sure the pure release build compiles just fine under fresh install of CodeBlocks with MinGW. Adding new files can break it.

Offline voskhod

  • Zombie Food
  • *
  • Posts: 87
    • View Profile
Re: Misadventures in compiling
« Reply #2 on: October 01, 2016, 02:20:01 PM »
Compile a minimal example first, don't try to go for the full build.

Drop features from your build until it compiles.
Or even better: start with just a console release build.
If you're only using it to test new features not related to tiles, you don't need anything more.

I'm pretty sure the pure release build compiles just fine under fresh install of CodeBlocks with MinGW. Adding new files can break it.

I am compiling with a pure release build though, see above on the screenshot. I've also tried using other builds such as LUA, SDL, Localized, and all result in failure to build. I've attempted it with no additional libraries, as well as all of the suggested libraries. I've attempted it with C++11 interpretation enabled and disabled. I've even tried different versions of MinGw. Still no dice.

Using a fresh install of Codeblocks with Mingw results in more progress being made than before, but it still grinds to a halt, this time around actions.cpp

https://puu.sh/ru4wI/0480ca1b7a.png

I should point out that the compiler is capable of building all of the object and lua files, but after that is where it encounters error after error

After checking the compiling.md again I've found a bundled bunch of libraries for 64-bit SDL \ Tiles \ Sound \ Lua \ Localization at http://dev.narc.ro/cataclysm/cdda-win64-codeblocks.7z
Any idea how to use this?

Edit: Somehow, through some form of black magic that I still don't understand, I managed to get Cataclysm to compile successfully now. I'm not even sure what I did to make it work.
« Last Edit: October 01, 2016, 03:30:35 PM by voskhod »

Offline The13thRonin

  • Zombie Food
  • *
  • Posts: 21
    • View Profile
Re: Misadventures in compiling
« Reply #3 on: October 10, 2016, 09:16:39 PM »
Compile a minimal example first, don't try to go for the full build.

Drop features from your build until it compiles.
Or even better: start with just a console release build.
If you're only using it to test new features not related to tiles, you don't need anything more.

I'm pretty sure the pure release build compiles just fine under fresh install of CodeBlocks with MinGW. Adding new files can break it.

I am compiling with a pure release build though, see above on the screenshot. I've also tried using other builds such as LUA, SDL, Localized, and all result in failure to build. I've attempted it with no additional libraries, as well as all of the suggested libraries. I've attempted it with C++11 interpretation enabled and disabled. I've even tried different versions of MinGw. Still no dice.

Using a fresh install of Codeblocks with Mingw results in more progress being made than before, but it still grinds to a halt, this time around actions.cpp

https://puu.sh/ru4wI/0480ca1b7a.png

I should point out that the compiler is capable of building all of the object and lua files, but after that is where it encounters error after error

After checking the compiling.md again I've found a bundled bunch of libraries for 64-bit SDL \ Tiles \ Sound \ Lua \ Localization at http://dev.narc.ro/cataclysm/cdda-win64-codeblocks.7z
Any idea how to use this?

Edit: Somehow, through some form of black magic that I still don't understand, I managed to get Cataclysm to compile successfully now. I'm not even sure what I did to make it work.

Hey could you explain how you got even to this stage? I am trying to do the same thing and can't seem to get anywhere. Thank you.

Offline Coolthulhu

  • Contributor
  • Survivor
  • ****
  • Posts: 3484
    • View Profile
Re: Misadventures in compiling
« Reply #4 on: October 11, 2016, 08:11:29 AM »
For me it worked like this:

  • Get codeblocks, the one with MinGW. Install that somewhere.
  • Get DDA code from github
  • Start the codeblocks file (the one with .cbp extension)
  • Configure codeblocks to use the GCC compiler. Just select it and go with defaults, it doesn't need specific settings.
  • Set the build type to release
  • Press build and run button, wait ~30 minutes

There was a tiny bit more to that actually, because by the time I did that the code was not working with GCC-4.8 or so (the one codeblocks ships with), but that is what should be working.
If doing that leads to errors during build, that can be an error on our side. Unless you did something above wrong.

Offline The13thRonin

  • Zombie Food
  • *
  • Posts: 21
    • View Profile
Re: Misadventures in compiling
« Reply #5 on: October 11, 2016, 09:26:34 AM »
For me it worked like this:

  • Get codeblocks, the one with MinGW. Install that somewhere.
  • Get DDA code from github
  • Start the codeblocks file (the one with .cbp extension)
  • Configure codeblocks to use the GCC compiler. Just select it and go with defaults, it doesn't need specific settings.
  • Set the build type to release
  • Press build and run button, wait ~30 minutes

There was a tiny bit more to that actually, because by the time I did that the code was not working with GCC-4.8 or so (the one codeblocks ships with), but that is what should be working.
If doing that leads to errors during build, that can be an error on our side. Unless you did something above wrong.

I can compile Cataclysm.

I just can't compile SDL Cataclysm (tiles).

Offline Zanos

  • Zombie Food
  • *
  • Posts: 28
    • View Profile
Re: Misadventures in compiling
« Reply #6 on: November 28, 2016, 02:55:25 AM »
For me it worked like this:

  • Get codeblocks, the one with MinGW. Install that somewhere.
  • Get DDA code from github
  • Start the codeblocks file (the one with .cbp extension)
  • Configure codeblocks to use the GCC compiler. Just select it and go with defaults, it doesn't need specific settings.
  • Set the build type to release
  • Press build and run button, wait ~30 minutes

There was a tiny bit more to that actually, because by the time I did that the code was not working with GCC-4.8 or so (the one codeblocks ships with), but that is what should be working.
If doing that leads to errors during build, that can be an error on our side. Unless you did something above wrong.
The above works fine, but I've been trying to compile with LUA to load one of my modded worlds on an older version, and I get this error when I compile in codeblocks:


Any idea what that's about?