Problem for compile the source code

What is a Uzebox? How can I get one? Check here!
Post Reply
RmBeer
Posts: 2
Joined: Wed Feb 07, 2018 10:09 am

Problem for compile the source code

Post by RmBeer » Wed Feb 07, 2018 10:16 am

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?

User avatar
Jubatian
Posts: 1190
Joined: Thu Oct 01, 2015 9:44 pm
Location: Hungary
Contact:

Re: Problem for compile the source code

Post by Jubatian » Wed Feb 07, 2018 4:54 pm

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)

RmBeer
Posts: 2
Joined: Wed Feb 07, 2018 10:09 am

Re: Problem for compile the source code

Post by RmBeer » Thu Feb 08, 2018 10:29 pm

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....

User avatar
Jubatian
Posts: 1190
Joined: Thu Oct 01, 2015 9:44 pm
Location: Hungary
Contact:

Re: Problem for compile the source code

Post by Jubatian » Fri Feb 09, 2018 6:21 am

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).

User avatar
Jubatian
Posts: 1190
Joined: Thu Oct 01, 2015 9:44 pm
Location: Hungary
Contact:

Re: Problem for compile the source code

Post by Jubatian » Sat Feb 10, 2018 5:24 pm

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).

Halamix2
Posts: 16
Joined: Mon Jun 06, 2016 10:04 pm

Re: Problem for compile the source code

Post by Halamix2 » Wed Jun 20, 2018 12:47 pm

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)

Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests