0 Members and 2 Guests are viewing this topic.
#include "SDL.h"int main(void) { SDL_Init(SDL_INIT_VIDEO); return 0;}
$ nspire-gcc test.c libSDL.a -Iinclude -lc -lgccC:\Users\Hoffa\AppData\Local\Temp\ccSJ5EA5.o: In function `exit':sdl.c:(.text+0x220): undefined reference to `__crt0_savedsp'sdl.c:(.text+0x224): undefined reference to `__crt0exit'c:/program files (x86)/yagarto/bin/../lib/gcc/arm-none-eabi/4.6.2/../../../../arm-none-eabi/lib\libc.a(lib_a-exit.o): In function `exit':C:\msys\1.0\home\yagarto\newlib-build\arm-none-eabi\newlib\libc\stdlib/../../../../../newlib-1.19.0/newlib/libc/stdlib/exit.c:65: undefined reference to `_exit'c:/program files (x86)/yagarto/bin/../lib/gcc/arm-none-eabi/4.6.2/../../../../arm-none-eabi/lib\libc.a(lib_a-abort.o): In function `abort':C:\msys\1.0\home\yagarto\newlib-build\arm-none-eabi\newlib\libc\stdlib/../../../../../newlib-1.19.0/newlib/libc/stdlib/abort.c:63: undefined reference to `_exit'c:/program files (x86)/yagarto/bin/../lib/gcc/arm-none-eabi/4.6.2/../../../../arm-none-eabi/lib\libc.a(lib_a-signalr.o): In function `_kill_r':C:\msys\1.0\home\yagarto\newlib-build\arm-none-eabi\newlib\libc\reent/../../../../../newlib-1.19.0/newlib/libc/reent/signalr.c:61: undefined reference to `_kill'c:/program files (x86)/yagarto/bin/../lib/gcc/arm-none-eabi/4.6.2/../../../../arm-none-eabi/lib\libc.a(lib_a-signalr.o): In function `_getpid_r':C:\msys\1.0\home\yagarto\newlib-build\arm-none-eabi\newlib\libc\reent/../../../../../newlib-1.19.0/newlib/libc/reent/signalr.c:96: undefined reference to `_getpid'c:/program files (x86)/yagarto/bin/../lib/gcc/arm-none-eabi/4.6.2/../../../../arm-none-eabi/lib\libc.a(lib_a-sbrkr.o): In function `_sbrk_r':C:\msys\1.0\home\yagarto\newlib-build\arm-none-eabi\newlib\libc\reent/../../../../../newlib-1.19.0/newlib/libc/reent/sbrkr.c:60: undefined reference to `_sbrk'collect2: ld returned 1 exit status
$ nspire-gcc test.c libSDL.a -Iinclude -nostdlib -lgccc:/program files (x86)/yagarto/bin/../lib/gcc/arm-none-eabi/4.6.2/../../../../arm-none-eabi/bin/ld.exe: warning: cannot find entry symbol _start; defaulting to 00008000C:\Users\Hoffa\AppData\Local\Temp\ccqMjuGx.o: In function `exit':sdl.c:(.text+0x220): undefined reference to `__crt0_savedsp'sdl.c:(.text+0x224): undefined reference to `__crt0exit'libSDL.a(SDL_cursor.o): In function `SDL_MouseRect':SDL_cursor.c:(.text+0x164): undefined reference to `memcpy'libSDL.a(SDL_keyboard.o): In function `SDL_PrivateKeyboard':SDL_keyboard.c:(.text+0x390): undefined reference to `memcpy'libSDL.a(SDL_surface.o): In function `SDL_GetClipRect':SDL_surface.c:(.text+0x34c): undefined reference to `memcpy'libSDL.a(SDL_surface.o): In function `SDL_LowerBlit':SDL_surface.c:(.text+0x3e8): undefined reference to `memcpy'SDL_surface.c:(.text+0x424): undefined reference to `memcpy'libSDL.a(SDL_surface.o):SDL_surface.c:(.text+0x838): more undefined references to `memcpy' followc:/program files (x86)/yagarto/bin/../lib/gcc/arm-none-eabi/4.6.2\libgcc.a(unwind-arm.o): In function `unwind_phase2':C:\msys\1.0\home\yagarto\gcc-build\arm-none-eabi\libgcc/../../../gcc-4.6.2/libgcc/../gcc/config/arm/unwind-arm.c:698: undefined reference to `abort'c:/program files (x86)/yagarto/bin/../lib/gcc/arm-none-eabi/4.6.2\libgcc.a(unwind-arm.o): In function `__gnu_Unwind_Resume':C:\msys\1.0\home\yagarto\gcc-build\arm-none-eabi\libgcc/../../../gcc-4.6.2/libgcc/../gcc/config/arm/unwind-arm.c:885: undefined reference to `abort'C:\msys\1.0\home\yagarto\gcc-build\arm-none-eabi\libgcc/../../../gcc-4.6.2/libgcc/../gcc/config/arm/unwind-arm.c:903: undefined reference to `abort'c:/program files (x86)/yagarto/bin/../lib/gcc/arm-none-eabi/4.6.2\libgcc.a(pr-support.o): In function `_Unwind_GetDataRelBase':C:\msys\1.0\home\yagarto\gcc-build\arm-none-eabi\libgcc/../../../gcc-4.6.2/libgcc/../gcc/config/arm/pr-support.c:394: undefined reference to `abort'c:/program files (x86)/yagarto/bin/../lib/gcc/arm-none-eabi/4.6.2\libgcc.a(pr-support.o): In function `_Unwind_GetTextRelBase':C:\msys\1.0\home\yagarto\gcc-build\arm-none-eabi\libgcc/../../../gcc-4.6.2/libgcc/../gcc/config/arm/pr-support.c:400: undefined reference to `abort'collect2: ld returned 1 exit status
nspire-gcc -c test.c -Iincludenspire-ld test.o -lSDL
$ nspire-ld sdl.o libSDL.ac:/program files (x86)/yagarto/bin/../lib/gcc/arm-none-eabi/4.6.2\libgcc.a(unwind-arm.o): In function `get_eit_entry':C:\msys\1.0\home\yagarto\gcc-build\arm-none-eabi\libgcc/../../../gcc-4.6.2/libgcc/../gcc/config/arm/unwind-arm.c:614: undefined reference to `__exidx_start'C:\msys\1.0\home\yagarto\gcc-build\arm-none-eabi\libgcc/../../../gcc-4.6.2/libgcc/../gcc/config/arm/unwind-arm.c:614: undefined reference to `__exidx_end'c:/program files (x86)/yagarto/bin/../lib/gcc/arm-none-eabi/4.6.2/../../../../arm-none-eabi/lib\libc.a(lib_a-abort.o): In function `abort':C:\msys\1.0\home\yagarto\newlib-build\arm-none-eabi\newlib\libc\stdlib/../../../../../newlib-1.19.0/newlib/libc/stdlib/abort.c:63: undefined reference to `_exit'c:/program files (x86)/yagarto/bin/../lib/gcc/arm-none-eabi/4.6.2/../../../../arm-none-eabi/lib\libc.a(lib_a-signalr.o): In function `_kill_r':C:\msys\1.0\home\yagarto\newlib-build\arm-none-eabi\newlib\libc\reent/../../../../../newlib-1.19.0/newlib/libc/reent/signalr.c:61: undefined reference to `_kill'c:/program files (x86)/yagarto/bin/../lib/gcc/arm-none-eabi/4.6.2/../../../../arm-none-eabi/lib\libc.a(lib_a-signalr.o): In function `_getpid_r':C:\msys\1.0\home\yagarto\newlib-build\arm-none-eabi\newlib\libc\reent/../../../../../newlib-1.19.0/newlib/libc/reent/signalr.c:96: undefined reference to `_getpid'collect2: ld returned 1 exit status
Here is an update of the Ndless SDK for you that should fix this (r526):- Add _TINSPIRE- Add missing syscalls stub for newlib
#include <os.h>int main(void) { puts("Hello!"); return 0;}
$ nspire-gcc -nostdlib sdl.cc:/program files (x86)/yagarto/bin/../lib/gcc/arm-none-eabi/4.6.2/../../../../arm-none-eabi/bin/ld.exe: warning: cannot find entry symbol _start; defaulting to 00008000C:\Users\Hoffa\AppData\Local\Temp\ccKOUO0B.o: In function `exit':sdl.c:(.text+0x250): undefined reference to `__crt0_savedsp'sdl.c:(.text+0x254): undefined reference to `__crt0exit'collect2: ld returned 1 exit status