mgerhardy / caveexpress

CaveExpress is a classic 2D platformer with physics-based gameplay and dozens of levels. CavePacker is a Sokoban game.
http://www.caveproductions.org/
Other
144 stars 20 forks source link

Building issue with GCC 4.9.2 on Linux #1

Closed akien-mga closed 9 years ago

akien-mga commented 10 years ago

Hi there,

I'm getting the following issue when building caveexpress (master, i.e. f6d54f1568) on Mageia 5 (development version) with GCC 4.9.2 (pre-release).

`In file included from src/engine/common/CommandSystem.h:3:0, from src/engine/common/IConsole.h:4, from src/engine/common/Logger.h:3, from src/engine/common/IMap.h:4, from src/engine/common/SpriteDefinition.h:8, from src/engine/common/SpriteDefinition.cpp:1: src/engine/common/ICommand.h:137:33: error: expected unqualified-id before 'new'

define bind(className, method) new CommandFunctor(this, &className::method)

                             ^

src/engine/common/ICommand.h:137:33: error: expected unqualified-id before 'new'

define bind(className, method) new CommandFunctor(this, &className::method)

                             ^

Makefile:213: recipe for target 'debug-caveexpress-linux-x86_64/cavebot/engine/common/SpriteDefinition.cpp.o' failed`

Here is a complete build log: http://paste.fedoraproject.org/134653/41106016/

akien-mga commented 10 years ago

As a side note, could you change your reference to "SDL" with "SDL2"? It's quite misleading to see the configure script searching for SDL_mixer and SDL_net when it actually wants SDL2_mixer and SDL2_net (SDL2 is the upstream name, SDL being the 1.2 branch).

mgerhardy commented 10 years ago

The problem with SDL2 is that I'm checking for SDL.h - and the header has the same name in both versions.

check_headers() { check_header_bundled "SDL.h" "sdl2" [....] }

mgerhardy commented 10 years ago

could you please compile with gcc -E and attach the output?

build/flags.mk can be modified to add the -E flag.

akien-mga commented 10 years ago

could you please compile with gcc -E and attach the output? build/flags.mk can be modified to add the -E flag.

Sorry I had forgotten about this, I'll do it asap.

akien-mga commented 10 years ago

With the -E flag, I now get a linking issue as shown in this log: http://paste.fedoraproject.org/136591/68246214

I'm not 100% sure about the way I defined the flag, I simply appended "-E" to CFLAGS, CCFLAGS and CXXFLAGS, is that the correct way?

mgerhardy commented 10 years ago

Plesse run with

make Q=

That will print out the commandlines. The additional option only executes the preprocessor. It does not compiler anything. The resulting objects now contain the final source. Plesse pastebin the generated file that produced the error in your first log.

akien-mga commented 10 years ago

Here is the BotBackend.cpp.o file that produces the error: http://dl.free.fr/piUJ0I48l (I couldn't pastebin it because it's too large).

I'll try a run with make Q= and post the log.

Edit: With make Q= I'm back to the previous error: http://paste.fedoraproject.org/136651/41171179/ i.e.

src/engine/common/ICommand.h:137:33: error: expected unqualified-id before 'new'
 #define bind(className, method) new CommandFunctor<className>(this, &className::method)
                                 ^
mgerhardy commented 10 years ago

I need this file: debug-caveexpress-linux-x86_64/cavebot/engine/common/SpriteDefinition.cpp.o

The BotBackend.cpp.o looks fine. Thanks

akien-mga commented 10 years ago

Here is the whole debug-caveexpress-linux-x86_64 directory (from the compilation with the -E flag): http://dl.free.fr/jQmxZIlhs

I'm amazed how small it is when compressed as tar.xz: 92 MB uncompressed, 600 kB compressed :-)

mgerhardy commented 9 years ago

if this is still an issue - please attach the file to this ticket. I'm not able to download the file from the hoster you linked

akien-mga commented 9 years ago

Indeed the file expired. I'll try to build current master against the embedded SDL 2.0.4-dev version, and close this ticket if it works fine.

akien-mga commented 9 years ago

I just built the debug version without issue against the embedded SDL2 version.