gheja / gbdk

GameBoy Developer's Kit (GBDK) 2.96a from 2002 tuned so it can be compiled on a modern system (Ubuntu 18.04 LTS and 16.04 LTS).
84 stars 10 forks source link

Compilation fails on g++ 4.6.3 (ubuntu, Travis CI) #12

Closed gheja closed 8 years ago

gheja commented 10 years ago

gcc -lm -o maccer maccer.o maccer.o: In function 'output_float': maccer.c:(.text+0x95): undefined reference to 'log' maccer.c:(.text+0xa2): undefined reference to 'floor' maccer.c:(.text+0xc3): undefined reference to 'exp' collect2: ld returned 1 exit status make[1]: * [maccer] Error 1 make[1]: Leaving directory '/home/travis/build/gheja/gbdk/maccer' make: * [maccer-build] Error 2

gheja commented 10 years ago

It seems gcc 4.6.3 needs a specific order of arguments: http://stackoverflow.com/a/8671381/460571

after 942fa4926d7ef6bcd9ae7791919478a2ba22d0f9 ...

SDCC.y: In function ‘yyparse’: SDCC.y:1004:4: error: label at end of compound statement make[2]: * [SDCCy.o] Error 1 make[2]: Leaving directory '/home/travis/build/gheja/gbdk/sdcc/src' make[1]: * [sdcc-cc] Error 2 make[1]: Leaving directory '/home/travis/build/gheja/gbdk/sdcc' make: *\ [sdcc-build] Error 2

andreasjhkarlsson commented 9 years ago

For some reason adding an empty statement didn't help on gcc 4.8.2, but I add to remove the default case altogether (it's not like it did anything anyway).

Should I submit a pull request for this?

gheja commented 8 years ago

Thanks, @rotmoset. Got the pull request #16 from @electronoob to comment the block out. It looked good with gcc 4.8.2, but still fails with gcc 5.3.1 (on Ubuntu 16.04 LTS). Altough, deleting the whole block (as you suggested) is solving the problem. (I don't really get what's the difference from compiler point of view, but if this makes it happy so be it.)

gheja commented 8 years ago

For some reason the SDCC.y build fails in a clean checkout with the error above. When updating the last modification time of SDCC.y the build suceeds, so I added a touch in the Makefile to do so in 9e1b1a13db573a402b3d70a6b53cca63beaed11d

andreasjhkarlsson commented 8 years ago

Just want to add that I have since forked gbdk to use newer versions of sdcc. You can find it here: https://github.com/rotmoset/gbdk-n

gheja commented 8 years ago

Hey @rotmoset, thanks for letting me know!

Also, it sounds great that the sdcc is now supporting the GameBoy target out-of-the-box. But as I see that version lacks the support of memory banking which seems to be a considerable drawback.

andreasjhkarlsson commented 8 years ago

Yes, memory banking is a huge problem which I have tried to solve, but nearly lost my mind doing. I just cannot get the linker to resolve the adresses properly..