SourceForge logo
SourceForge logo
Menu

Re: [KOS] Problems compiling SDL 2 samples

From: Luke B. <ka...@gm...> - 2016年02月11日 10:06:16
Thank you! I've disabled DYNAMIC_API on the DC, and I realized that
__DREAMCAST__ is not what I should be checking for, but _arch_dreamcast
(facepalm).
Now I'm down to a couple of atomic-related SDL references, and stuff like
this:
/home/lukeb/Dreamcast/kos-ports/SDL2/build/SDL2-2.0.4/libSDL2.a(SDL_getenv.o):
In function `SDL_getenv':
/home/lukeb/Dreamcast/kos-ports/SDL2/build/SDL2-2.0.4/src/stdlib/SDL_getenv.c:182:
undefined reference to `_getenv'
/home/lukeb/Dreamcast/kos-ports/SDL2/build/SDL2-2.0.4/libSDL2.a(SDL_stdlib.o):
In function `SDL_atan2':
/home/lukeb/Dreamcast/kos-ports/SDL2/build/SDL2-2.0.4/src/stdlib/SDL_stdlib.c:48:
undefined reference to `_atan2'
Which I'm guessing is down to me not linking a KOS library or something?
I'll take a look later when I find time. Thanks again!
On 11 February 2016 at 08:45, Harley Laue <los...@gm...>
wrote:
> $ 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...> 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...> 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...
>> 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
>>
>>
>
>
> ------------------------------------------------------------------------------
> 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 lis...@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
>
>

View entire thread

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.
Thanks for helping keep SourceForge clean.
X





Briefly describe the problem (required):
Upload screenshot of ad (required):
Select a file, or drag & drop file here.
Screenshot instructions:

Click URL instructions:
Right-click on the ad, choose "Copy Link", then paste here →
(This may not be possible with some types of ads)

More information about our ad policies

Ad destination/click URL:

AltStyle によって変換されたページ (->オリジナル) /