|
From: Harley L. <los...@gm...> - 2016-02-11 08:45:36
|
$ make
rm -f example.elf
kos-cc -o example.elf testdraw2.o -lSDL2
testdraw2.o: In function `DrawPoints':
/usr/local/dc/kos-ports/SDL2-test/build/SDL2-2.0.4/test/testdraw2.c:79:
undefined reference to `_SDL_RenderGetViewport'
...
/usr/local/dc/kos-ports/SDL2-test/build/SDL2-2.0.4/test/testdraw2.c:299:
undefined reference to `_SDL_atoi'
collect2: error: ld returned 1 exit status
Makefile:28: recipe for target 'example.elf' failed
make: *** [example.elf] Error
$ sh-elf-nm $KOS_PORTS/lib/libSDL2.a | grep -E "(RenderGetViewport|atoi)"
U _SDL_atoi_REAL
U _SDL_atoi_REAL
U _SDL_atoi_REAL
U _SDL_atoi_REAL
U _SDL_atoi_REAL
00000000 T _SDL_RenderGetViewport_REAL
U _atoi
00000000 T _SDL_atoi_REAL
U _SDL_atoi_REAL
$ grep -Er "(RenderGetViewport_REAL|SDL_atoi_REAL)"
src/dynapi/SDL_dynapi_overrides.h:#define SDL_RenderGetViewport
SDL_RenderGetViewport_REAL
src/dynapi/SDL_dynapi_overrides.h:#define SDL_atoi SDL_atoi_REAL
From what I can tell, SDL2 wants SDL_dynapi defined for all platforms.
On 02/10/2016 08:13 AM, Luke Benstead wrote:
> Thanks OK, I just wanted to make sure that what I was doing in the
> makefile wasn't obviously wrong... I'll keep digging! Thanks!
>
> On 10 February 2016 at 15:34, Lawrence Sebald <blu...@gm...
> <mailto:blu...@gm...>> wrote:
>
> Unfortunately, I have no idea why you’d be having that particular
> issue off the top of my head. It looks like you’re compiling in
> the SDL_render.c file into your library, which is where those
> functions are implemented, so I don’t really know…
>
> The only thing I can guess is that somehow you’re picking up an
> old version of the library where you didn’t compile that in or
> something? Try rebuilding the entire library and then the program
> again?
>
> I really know next to nothing about SDL2, which I suppose doesn’t
> help here...
>
>> On Feb 10, 2016, at 4:03 AM, Luke Benstead <ka...@gm...
>> <mailto:ka...@gm...>> wrote:
>>
>> Hi there!
>>
>> I've managed to get the SDL 2 port to a state where it compiles,
>> but is untested. My SD card adapter just arrived so I figured I'd
>> try to compile one of the SDL 2 sample applications to test the port.
>>
>> I added the following target to the KOSMakefile.mk file:
>>
>>
>> defaultall: replacefiles $(OBJS) subdirs linklib buildsamples
>>
>> TESTDRAW2_SRCS = $(CURDIR)/test/testdraw2.c
>> TESTDRAW2_OBJS = $(CURDIR)/test/testdraw2.o
>> TESTDRAW2_TARGET = testdraw2.elf
>>
>> buildsamples:
>> $(KOS_CC) $(CFLAGS) -Iinclude -c $(TESTDRAW2_SRCS) -o
>> $(TESTDRAW2_OBJS)
>> $(KOS_CC) $(KOS_CFLAGS) $(KOS_LDFLAGS) -L$(CURDIR) -Iinclude
>> -o $(TESTDRAW2_TARGET) $(KOS_START) $(TESTDRAW2_OBJS) $(KOS_LIBS)
>> -lSDL2
>>
>> No matter what incantation I use to build the source file, I
>> still end up with undefined references to the SDL 2 functions. e.g.
>>
>> /home/lukeb/Dreamcast/kos-ports/SDL2/build/SDL2-2.0.4/test/testdraw2.o:
>> In function `_DrawPoints':
>> testdraw2.c:(.text+0x1a0): undefined reference to
>> `_SDL_RenderGetViewport'
>> testdraw2.c:(.text+0x1b8): undefined reference to
>> `_SDL_SetRenderDrawColor'
>> testdraw2.c:(.text+0x1c4): undefined reference to
>> `_SDL_RenderDrawPoint'
>>
>>
>> Am I missing something obvious? Grepping for those functions does
>> find them in libSDL2.a which I'm linking to. I've tried changing
>> the order of the GCC args, and also tried just compiling the
>> source file directly rather than to an object file first.
>>
>> I'd appreciate any suggestions you might have!
>>
>> Thanks,
>>
>> Luke.
>>
>> ------------------------------------------------------------------------------
>> Site24x7 APM Insight: Get Deep Visibility into Application
>> Performance
>> APM + Mobile APM + RUM: Monitor 3 App instances at just $35/Month
>> Monitor end-to-end web transactions and take corrective actions now
>> Troubleshoot faster and improve end-user experience. Signup Now!
>> http://pubads.g.doubleclick.net/gampad/clk?id=272487151&iu=/4140_______________________________________________
>> cadcdev-kallistios mailing list
>> cad...@li...
>> <mailto:cad...@li...>
>> https://lists.sourceforge.net/lists/listinfo/cadcdev-kallistios
>
>
> ------------------------------------------------------------------------------
> Site24x7 APM Insight: Get Deep Visibility into Application Performance
> APM + Mobile APM + RUM: Monitor 3 App instances at just $35/Month
> Monitor end-to-end web transactions and take corrective actions now
> Troubleshoot faster and improve end-user experience. Signup Now!
> http://pubads.g.doubleclick.net/gampad/clk?id=272487151&iu=/4140
> _______________________________________________
> cadcdev-kallistios mailing list
> cad...@li...
> <mailto:cad...@li...>
> https://lists.sourceforge.net/lists/listinfo/cadcdev-kallistios
>
>
>
>
> ------------------------------------------------------------------------------
> Site24x7 APM Insight: Get Deep Visibility into Application Performance
> APM + Mobile APM + RUM: Monitor 3 App instances at just $35/Month
> Monitor end-to-end web transactions and take corrective actions now
> Troubleshoot faster and improve end-user experience. Signup Now!
> http://pubads.g.doubleclick.net/gampad/clk?id=272487151&iu=/4140
>
>
> _______________________________________________
> cadcdev-kallistios mailing list
> cad...@li...
> https://lists.sourceforge.net/lists/listinfo/cadcdev-kallistios
|