Closed jackbonaguro closed 4 years ago
Seems like a compiler issue, but I don't know what version of gcc is used.
Weird error message, I think you have another GCC installation conflicting, you can try to type "gcc --version" without any path on the command line to see which one is used by default :)
Got this output:
gcc (GCC) 6.3.0
Copyright (C) 2016 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
where gcc
yields C:\sgdk\bin\gcc.exe
which gcc
yields /cygdrive/c/sgdk/bin/gcc
, since I have cygwin.
However this shouldn't be an issue, as I am never using my default gcc for SGDK.
I'm only using makefile.gen, which explicitly sets
CC= $(BIN)/gcc
,
and never explicity calls gcc otherwise.
indeed that was what i though after posting my reply, sometime just the different make can do weird behaviors. but as i can't reproduce it, i can't really understand why you obtain this. But as this is a warning, i guess it doesn't bring much troubles for compilation ?
I've had this problem myself in the past! usually due to having the wrong SGDK version installed or not rebuilding the library after an SGDK version upgrade. Have a good clean out, remove temp builds, etc
I have exactly the same issue with SGDK 1.51, even when having no other gcc version installed on my workstation.
If I comment out this line of code: sprintf(str_player_score,"%d",player_score);
The error disappears.
The version of string.c at a522d56 has the same issue.
Too bad, i was optimist about the last changes to resolve the issues. Did you rebuild the library in between as i didn't pushed last lib binaries after the change ?
Resolved.
Before:
PS C:\Users\Damian McMillan\dev\megadrive\14_tiles> d:/sgdk/bin/make -f d:\sgdk\makefile.gen
D:/sgdk/bin/mkdir -p src/boot
D:/sgdk/bin/mkdir -p out
D:/sgdk/bin/mkdir -p out/src
D:/sgdk/bin/mkdir -p out/res
echo "out/res/sprites.o out/res/tiles.o out/src/main.o" > out/cmd_
D:/sgdk/bin/gcc -BD:/sgdk/bin -n -T D:/sgdk/md.ld -nostdlib out/sega.o @out/cmd_ D:/sgdk/lib/libmd.a D:/sgdk/lib/libgc
c.a -o out/rom.out
D:/sgdk/src/string.c: In function 'sprintf.constprop':
D:/sgdk/src/string.c:640:5: warning: second parameter of 'va_start' not last named argument [-Wvarargs]
va_start(args, fmt);
^
D:/sgdk/bin/rm out/cmd_
D:/sgdk/bin/objcopy -O binary out/rom.out out/rom.bin
D:/sgdk/bin/sizebnd out/rom.bin -sizealign 131072
D:/sgdk/bin/nm --plugin=liblto_plugin-0.dll -n out/rom.out > out/symbol.txt
After:
PS C:\Users\Damian McMillan\dev\megadrive\14_tiles> d:/sgdk/bin/make -f d:\sgdk\makefile.gen
D:/sgdk/bin/mkdir -p src/boot
D:/sgdk/bin/mkdir -p out
D:/sgdk/bin/mkdir -p out/src
D:/sgdk/bin/mkdir -p out/res
echo "out/res/sprites.o out/res/tiles.o out/src/main.o" > out/cmd_
D:/sgdk/bin/gcc -BD:/sgdk/bin -n -T D:/sgdk/md.ld -nostdlib out/sega.o @out/cmd_ D:/sgdk/lib/libmd.a D:/sgdk/lib/libgc
c.a -o out/rom.out
D:/sgdk/bin/rm out/cmd_
D:/sgdk/bin/objcopy -O binary out/rom.out out/rom.bin
D:/sgdk/bin/sizebnd out/rom.bin -sizealign 131072
D:/sgdk/bin/nm --plugin=liblto_plugin-0.dll -n out/rom.out > out/symbol.txt
I had previously downloaded https://github.com/Stephane-D/SGDK/releases/download/v1.51/sgdk151.7z and followed the instructions at: https://github.com/Stephane-D/SGDK/wiki/SGDK-Installation
This time, to ensure I was using the latest configuration and libraries, I cloned the repository, and then ran build_lib.bat.
Now, when I d:/sgdk/bin/make -f d:\sgdk\makefile.gen the error is gone.
As a test, I tried running build_lib.bat from the existing directory, but the error persists.
Solution:
Yeah the fix is only available through direct repository content (not in SGDK 1.51) and it really requires rebuilding the library, still i don't understand why the build_lib.bat batch didn't made it ! At least it seems the bug is resolved :)
On Windows 10 64-bit
make a new project with only one file - main.c:
And run the command
%GDK_WIN%/bin/make -f %GDK_WIN%/makefile.gen
from the project root.I am getting the following warning:
I'm pretty sure this warning is incorrect.