[FIXED] SDL not linking properly (kos-ports)

If you have any questions on programming, this is the place to ask them, whether you're a newbie or an experienced programmer. Discussion on programming in general is also welcome. We will help you with programming homework, but we will not do your work for you! Any porting requests must be made in Developmental Ideas.
Post Reply
User avatar
Corbin
DC Developer
DC Developer
Posts: 121
https://www.artistsworkshop.eu/meble-kuchenne-na-wymiar-warszawa-gdzie-zamowic/
Joined: Fri Dec 14, 2007 1:56 am
Location: California
Has thanked: 0
Been thanked: 0

[FIXED] SDL not linking properly (kos-ports)

Post by Corbin »

Okay, made this in the other thread but it was probably not an appropriate place.

Trying to build my program, it almost goes through the process until I get an issue at the linker phase when it links against my program:
/resample.o obj_dc/timidity/tables.o obj_dc/timidity/timidity.o -lm -Wl,--warn-common -lgl -lpng -ljpeg -lz -ltremor -lSDL -lm -lstdc++ -Wl,--start-group -lkallisti -lc -lgcc -Wl,--end-group
/usr/local/dc/kos/lib/dreamcast/libkallisti.a(thread.o): warning: common of `_jiffies' overridden by definition
/usr/local/dc/kos/lib/dreamcast/libkallisti.a(irq.o): warning: defined here
/usr/local/dc/kos/../kos-ports/lib/libSDL.a(SDL_audio.o): In function `SDL_AudioInit':
/cygdrive/d/cygwin/usr/local/dc/kos-ports/sdl/build/SDL-1.2.15/src/audio/SDL_audio.c:382: undefined reference to `_DISKAUD_bootstrap'
/usr/local/dc/kos/../kos-ports/lib/libSDL.a(SDL_audio.o):(.rodata.bootstrap+0x0): undefined reference to `_DISKAUD_bootstrap'
/usr/local/dc/kos/../kos-ports/lib/libSDL.a(SDL_audio.o):(.rodata.bootstrap+0x4): undefined reference to `_DUMMYAUD_bootstrap'
/usr/local/dc/kos/../kos-ports/lib/libSDL.a(SDL_video.o):(.rodata.bootstrap+0x4): undefined reference to `_DUMMY_bootstrap'

collect2: error: ld returned 1 exit status
As I said in the other thread, not sure what exactly is happening here. Any suggestions?
Last edited by Corbin on Sun Jan 10, 2016 11:16 pm, edited 1 time in total.
User avatar
bogglez
Moderator
Moderator
Posts: 578
Joined: Sun Apr 20, 2014 9:45 am
Has thanked: 0
Been thanked: 0

Re: SDL not linking properly (kos-ports)

Post by bogglez »

I only found this http://comments.gmane.org/gmane.comp.lib.sdl/21736 (reinstalling cygwin fixed it)
So maybe you tried some things to get KOS working and that botched the installation? Sometimes people update either kos or kos-ports but not the other and that leads to binary incompatibility.
Are you using the current versions of both kos and kos-ports from git?

Can you try a fresh start on kos-ports so we can exclude any issues there?

Code: Select all

. /opt/toolchains/dc/kos/environ.sh
cd kos-ports
git reset HEAD --hard
sh utils/build-all.sh
Wiki & tutorials: http://dcemulation.org/?title=Development
Wiki feedback: viewtopic.php?f=29&t=103940
My libgl playground (not for production): https://bitbucket.org/bogglez/libgl15
My lxdream fork (with small fixes): https://bitbucket.org/bogglez/lxdream
User avatar
Corbin
DC Developer
DC Developer
Posts: 121
Joined: Fri Dec 14, 2007 1:56 am
Location: California
Has thanked: 0
Been thanked: 0

Re: SDL not linking properly (kos-ports)

Post by Corbin »

I just deleted the kos-ports and downloaded the github copy again - copy/pasted, ran build-all, same issue. The command git reset HEAD --hard didn't work for some reason so I just did it through Explorer.

I did have to install an additional file to libjpeg (jerror) but that's all. I don't think I had to do anything to KOS, other than deleting the original folder when I had some issues and downloading the github copy, pasting it in the directory, and re-installing it.

So yes, both copies are from Github.

Other than that, I suppose I could try re-installing Cygwin but it installed without a hitch the first time, so I don't think it has to do with that.

any other ideas?
User avatar
BlueCrab
The Crabby Overlord
The Crabby Overlord
Posts: 5663
Joined: Mon May 27, 2002 11:31 am
Location: Sailing the Skies of Arcadia
Has thanked: 9 times
Been thanked: 69 times
Contact:

Re: SDL not linking properly (kos-ports)

Post by BlueCrab »

It's entirely possible SDL is broken, as I did update it with the new kos-ports work. I never tried using sound or anything, so it's probably something I did. I'll take a look when I get a chance to see what's wrong.
User avatar
BlueCrab
The Crabby Overlord
The Crabby Overlord
Posts: 5663
Joined: Mon May 27, 2002 11:31 am
Location: Sailing the Skies of Arcadia
Has thanked: 9 times
Been thanked: 69 times
Contact:

Re: SDL not linking properly (kos-ports)

Post by BlueCrab »

SDL should link properly now. Or, at least it does for the new example I just added to the KOS examples tree...

Make sure to pull an updated copy of kos-ports and do a "make uninstall install clean" on SDL in the kos-ports tree to pick up the changes that I made to the SDL code.
User avatar
Corbin
DC Developer
DC Developer
Posts: 121
Joined: Fri Dec 14, 2007 1:56 am
Location: California
Has thanked: 0
Been thanked: 0

Re: SDL not linking properly (kos-ports)

Post by Corbin »

Thanks Lawrence! That worked perfectly! I just uninstalled the copy, modified the SDL_config_dreamcast header myself to match your changes, re-installed, and re-built my program - success!

Thanks so much again for being quick! ;-)
User avatar
BlueCrab
The Crabby Overlord
The Crabby Overlord
Posts: 5663
Joined: Mon May 27, 2002 11:31 am
Location: Sailing the Skies of Arcadia
Has thanked: 9 times
Been thanked: 69 times
Contact:

Re: [FIXED] SDL not linking properly (kos-ports)

Post by BlueCrab »

No problem. I'm glad that it was pretty easy to fix, after all (especially since I pretty much blindly updated the SDL version quite a bit). :wink:
User avatar
Corbin
DC Developer
DC Developer
Posts: 121
Joined: Fri Dec 14, 2007 1:56 am
Location: California
Has thanked: 0
Been thanked: 0

Re: [FIXED] SDL not linking properly (kos-ports)

Post by Corbin »

Don't beat yourself up, I super appreciate it! Sometimes I do that on the engine I work on, and forget overlooked errors like that can happen under specific circumstances according to what the end-user is doing/wanting out of it. Usually because I get really excited and my brain kind of explodes ;-)

Much obliged again! =]
Post Reply