gbadev.org forum archive

This is a read-only mirror of the content originally found on forum.gbadev.org (now offline), salvaged from Wayback machine copies. A new forum can be found here.

Coding > AAS linker problem

#9825 - Darkain - Tue Aug 19, 2003 5:58 am

i downloaded the AAS audio library. but... i cant seem to get it linked in correctly. im using it w/ DivKitAdv. is there anything specific i should know?

i followed the directions as stated, such as making the sub-folder, and adding the carious options to the compiler and linker.

example:
CFLAGS = -c -g -O2 -mthumb-interwork -ILibAAS
CFLAGS2 = -g -O2 -mthumb-interwork -lm -LLibAAS -lAAS

error:
MB/engine.o:D:\Programming GBA\Game1/engine.cpp:35: undefined reference to `AAS_ShowLogo()'


this appears to be a simple linker error, and probably just something i overlooked... help would be nice tho, as i'm not a GCC expert.
_________________
-=- Darkain Dragoon -=-
http://www.darkain.com
DarkStar for Nintendo DS

#9827 - Darkain - Tue Aug 19, 2003 7:15 am

okies, after a while w/ talking w/ peoples... we FINALLY figured this one out too..

the darn lib was made in C and i was using C++, so a simple:
extern "C"
fixt it
_________________
-=- Darkain Dragoon -=-
http://www.darkain.com
DarkStar for Nintendo DS

#9833 - tepples - Tue Aug 19, 2003 2:57 pm

Darkain wrote:
CFLAGS = -c -g -O2 -mthumb-interwork -ILibAAS
CFLAGS2 = -g -O2 -mthumb-interwork -lm -LLibAAS -lAAS

error:
MB/engine.o:D:\Programming GBA\Game1/engine.cpp:35: undefined reference to `AAS_ShowLogo()'

Try showing all warnings. This will give you File Not Found.

More likely: It appears you're calling the program from C++, and C++ by default mangles function names. Header files that support C and C++ programs have to tell the compiler that a function uses C function name conventions. The AAS header may not have C++ support; to work around it, simply do this:
Code:
extern "C" {
#include "whatevertheaasheaderiscalled.h"
}

_________________
-- Where is he?
-- Who?
-- You know, the human.
-- I think he moved to Tilwick.

#9865 - jd - Wed Aug 20, 2003 2:44 pm

Just a quick note to let folks know that this issue has now been resolved. Header files suitable for C++ are included in the latest version which can be downloaded here:

http://www.apex-designs.net/tools_aas.html

#9911 - jd - Thu Aug 21, 2003 5:19 pm

AAS v1.03 has been released. This fixes problems that could occur when using Multiple Interrupts. As usual, you can download the latest version here:

http://www.apex-designs.net/tools_aas.html

I've also created an AAS discussion list.