cxong / cdogs-sdl

Classic overhead run-and-gun game
https://cxong.github.io/cdogs-sdl/
GNU General Public License v2.0
891 stars 114 forks source link

Compilation issue, unable to build for linux, unable to cross-compile #273

Closed DavidKnight247 closed 10 years ago

DavidKnight247 commented 10 years ago

Hi, I am trying to cross compile c-dogs for gcw0 using a toolchain. I have run into a major issue which appears to be due to the buildscript. I am running this on Ubuntu 14.04 virtual machine with all sdl1.2-dev libraries. Cmake correctly finds correct compiler and all libraries but cannot complete config file due to no CMakeLists.txt files, http://pastebin.com/Svvq1JTW. I have attempted to compile for linux as well as cross-compile, I get the same errors in both cases. I have tried previous releases and get similar issues with cbehave. Can you suggest a workaround?

cxong commented 10 years ago

Please refer to the getting started guide: https://github.com/cxong/cdogs-sdl/wiki/Developer-Getting-Started:-Linux

There are recursive submodules in this repo, so you may not have pulled in the files in the cbehave submodule. Try running this command from the root of the project: git submodule init; git submodule update --init --recursive; git submodule update --recursive

DavidKnight247 commented 10 years ago

Many thanks, makefile now builds successfully.

On Sun, Jul 13, 2014 at 8:26 AM, Cong notifications@github.com wrote:

Please refer to the getting started guide: https://github.com/cxong/cdogs-sdl/wiki/Developer-Getting-Started:-Linux

There are recursive submodules in this repo, so you may not have pulled in the files in the cbehave submodule. Try running this command from the root of the project: git submodule init; git submodule update --init --recursive; git submodule update --recursive

— Reply to this email directly or view it on GitHub https://github.com/cxong/cdogs-sdl/issues/273#issuecomment-48833967.

carstene1ns commented 10 years ago

Hello, also please let us know, if you get it to work on the device. I read that SDL_ListModes may not return a valid video mode on opendingux, if you get any problem with it, try to force it to 320x240 in cdogs/grafx.c

cxong commented 10 years ago

Because this is not the first time this issue has occurred, and there's no compelling reason for having submodules, I'll remove them eventually: #275

DavidKnight247 commented 10 years ago

Hi, I revisited this tonight, got it to build and run on the gcw zero with latest source code, forced 320x240x1 by disabling sdl_list as suggested. A few buffer overload and floating point issues to deal with but it runs!

On Thu, Jul 17, 2014 at 5:02 AM, Cong notifications@github.com wrote:

Closed #273 https://github.com/cxong/cdogs-sdl/issues/273.

— Reply to this email directly or view it on GitHub https://github.com/cxong/cdogs-sdl/issues/273#event-142482842.

cxong commented 10 years ago

@DavidKnight247 Excellent! Could you please show me any changes you had to make? Maybe a pull request.

carstene1ns commented 10 years ago

Because it is a linux running on that device, I guess the easiest thing would be to add a CMake Toolchain file that sets the right tools and providing that along the opk build script and desktop file inside a build/gcw-zero folder. Let me know if you need any help with it. :hammer:

DavidKnight247 commented 10 years ago

Well I found the cause of the segfault, I had to comment out lines 295 and 297 in cdogs/src/cdogs/gamedata.c:

294 debug(D_NORMAL, "loading game music %s\n", CDOGS_GAME_MUSIC_DIR); 295// LoadSongList(&gGameSongs, CDOGS_GAME_MUSIC_DIR); 296 debug(D_NORMAL, "loading menu music %s\n", CDOGS_MENU_MUSIC_DIR); 297// LoadSongList(&gMenuSongs, CDOGS_MENU_MUSIC_DIR);

I don't unfortunately understand why it is segfaulting (see below).

The game then seems to run perfectly, just no music of course. Sound effects work fine though.

I'm not sure how to create a CMake toolchain file etc, I'm learning to code and am still at an early stage. The command I used to create the Makefile was "cmake -DCMAKE_TOOLCHAIN_FILE=/opt/gcw0-toolchain/usr/share/buildroot/toolchainfile.cmake .". I have yet to make the desktop file but will happily send it when finished probably tomorrow.

On Sun, Aug 17, 2014 at 7:58 AM, carstene1ns notifications@github.com wrote:

Because it is a linux running on that device, I guess the easiest thing would be to add a CMake Toolchain file that sets the right tools and providing that along the opk build script and desktop file inside a build/gcw-zero folder. Let me know if you need any help with it. [image: :hammer:]

— Reply to this email directly or view it on GitHub https://github.com/cxong/cdogs-sdl/issues/273#issuecomment-52415159.

carstene1ns commented 10 years ago

Please use the above referenced issue from now on, as this is not related anymore. Thanks!