Page 1 of 1

Problem for compile the source code

Posted: Wed Feb 07, 2018 10:16 am
by RmBeer
I download from the github...
After installing avr-libc and avr-gcc, I find that it has problems to compile demos/GameOfLife/videoMode/videoMode.s, this is the error:

Code: Select all

./demos/GameOfLife/videoMode/videoMode.s: Mensajes del ensamblador:
./demos/GameOfLife/videoMode/videoMode.s:53: Error: attempt to store non-zero value in section `.bss'
./demos/GameOfLife/videoMode/videoMode.s:54: Error: attempt to store non-zero value in section `.bss'
./demos/GameOfLife/videoMode/videoMode.s:55: Error: attempt to store non-zero value in section `.bss'
make[1]: *** [Makefile:75: uzeboxVideoEngineCore.o] Error 1
make: *** [Makefile:133: demos/GameOfLife/default] Error 2
What should I do next?

Re: Problem for compile the source code

Posted: Wed Feb 07, 2018 4:54 pm
by Jubatian
RmBeer wrote:
Wed Feb 07, 2018 10:16 am
What should I do next?
Checkout again. I just fixed this bug, it should now compile :)

(This is a lefover from long ago when lots of allocations were improperly declared as ".byte 1" instead of ".space 1". I thought these were all fixed by now, the avr-gcc versions we are using don't halt on this error, so nobody noticed it)

Re: Problem for compile the source code

Posted: Thu Feb 08, 2018 10:29 pm
by RmBeer
Now have other problem for compiling:

Code: Select all

MegaSokoban.o: En la función `sokoban':
./demos/MegaSokoban/default/../MegaSokoban.c:677: referencia a `sokoban_move' sin definir
./demos/MegaSokoban/default/../MegaSokoban.c:682: referencia a `sokoban_is_level_cleared' sin definir
collect2: error: ld returned 1 exit status
is strange, i can see that is defined...

==============EDIT

i send a PM for you....

Re: Problem for compile the source code

Posted: Fri Feb 09, 2018 6:21 am
by Jubatian
What compiler, and which version of it are you using? (If it is avr-gcc, then "avr-gcc -v" should give the version number)

I seriously don't understand why these are errors, and why the patch you proposed could fix them. Normally if the function is declared or defined before usage, it is fine, and the codebase is full of such constructs (functions only having definitions, being used later down in the code). It is completely valid by the specification of C (and I can't even remember for example the MISRA-C coding guidelines saying anything against this).

Of course that particular game might have something else in it which makes it invalid, but it is not apparent for me at first glance. I will examine the code later this day.

Does your compiler compile these?

Code: Select all

int test(void){
 return 1;
}

int main(void){
 return test();
}

Code: Select all

inline int test(void){
 return 1;
}

int main(void){
 return test();
}

Code: Select all

inline int test(){
 return 1;
}

int main(void){
 return test();
}
The last one is somewhat fishy for me, in C this would mean unspecified number of arguments (no "void"), possibly people coming with C++ background forget it and make the mistake of omitting the "void". I don't know for sure how the compiler should react to this (I rarely see this construct).

Re: Problem for compile the source code

Posted: Sat Feb 10, 2018 5:24 pm
by Jubatian
Could you somehow switch the compiler to English and try it that way? (I don't need a translation, rather the exact phrase which the compiler would output if it was english as I want to conduct some search for the exact error message). I am really clueless as normally gcc shouldn't work this way (and I can't even get my compiler to produce even any warning on this issue, I have avr-gcc 4.9.2).

Re: Problem for compile the source code

Posted: Wed Jun 20, 2018 12:47 pm
by Halamix2
executing export

Code: Select all

LANG=C
should revert language of all comments in that terminal to English (or whatever built-in default language there is)