Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  
Pages: 1 ... 3 4 [5]

Author Topic: LCS Compiling Issues  (Read 27107 times)

zaimoni

  • Bay Watcher
    • View Profile
Re: LCS Compiling Issues
« Reply #60 on: August 31, 2017, 01:39:14 am »

As my C intuition says nothing should be defined in H file. Only declarations.
Enlightenment awaits your untrained intuition.

C things that must be declared in headers to implement Once And Only Once: preprocessor macros, enums.

C++ things that must be declared in headers to work at all: templates.  (ISO gave up on the export keyword...it was simply too difficult for the major compilers to implement.  Repurposing is planned.)
Logged

Rolan7

  • Bay Watcher
  • [GUE'VESA][BONECARN]
    • View Profile
Re: Code::Blocks "Easy Mode" compile doesn't give the latest LCS Version?
« Reply #61 on: September 04, 2017, 10:55:36 am »

I had an embarrassing amount of trouble compiling with Code::Blocks today, so I'm bringing up the helpful answers from this thread, and providing a tidy summary.
I managed to compile under Windows with the latest version of Code::Blocks (without the bundled MinGW), plus the latest TDM-GCC (http://tdm-gcc.tdragon.net/download, first bundle installer) and changing the project build setting where it says -lncurses for -lpdcurses (the only actual change to the files I got from Git). Which apparently works with or without the c++11 flag, as it is enabled in the debug but disabled in the release profile, and both compiled fine.

Trying to use MINGW or Visual Studio Express 2010, or the bundled-MinGW version of Code::Blocks just ended with failure and disappointment.
Shouldn't the Code::Blocks workspace file be updated?  I still had to change -lncurses to -lpdcurses with the most recent from https://github.com/Kamal-Sadek/Liberal-Crime-Squad

Other than that, things went pretty okay once I followed the advice here:
It's under linker settings tab (don't select Debug or Release but the parent node "Liberal Crime Squad").

Also the TDM setup should work fine if you uncheck "check for updated files".

No idea if it will compile in 64 bit, let us know if it works.
Code Blocks claims the 64-bit TDM install is "invalid", so I guess it doesn't.

Here's a summary of the process to build with Code::Blocks
  • Install TDM-32 from first installer (second installer works too, you just choose 32-bit) http://tdm-gcc.tdragon.net/download
  • Install Code::Blocks *without mingw*, or go into Settings->Compile->Toolchain Executables and point it at your TDM-32 directory.  The individual filenames still say mingw, but were fine as is for me.  It seemed to auto-detect TDM-32 correctly when installed without bundled mingw.
  • Open the "workspaces" directory, open game.cbp in Code::Blocks.
  • Go to Project->Build Options->Linker Settings.  Edit "-lncurses" to "-lpdcurses".
  • Do the build (:
  • Final bit of weirdness...  Hitting run, it will claim the project hasn't been built.  You have to decline to build it, then it will actually run.  If you say yes, it'll build, then ask again...  Which is bizarre but useful.

Maybe related to that last thing, the built .exe is found in the src directory, but it won't work there.  Has to be copied up a level so it can find the .dlls (and various assets I assume).  Seems like that it would be easy to leave in the correct directory instead, but I'm pretty clueless with workspaces and Makefiles and C++ in general.  It's weird to me that the IDE somehow runs it at all, temporary environment variables I guess.
Logged
She/they
No justice: no peace.
Quote from: Fallen London, one Unthinkable Hope
This one didn't want to be who they was. On the Surface – it was a dull, unconsidered sadness. But everything changed. Which implied everything could change.
Pages: 1 ... 3 4 [5]