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.

DS development > ndslib 'inline' problem

#37590 - josath - Sun Mar 13, 2005 8:25 pm

I was trying to compile a project with multiple .c files in the arm9/ directory, and I kept getting errors saying inline functions defined in the ndslib.h files were redefined in each object file.

After some searching, I found changing all the 'inline' functions in the .h files to 'static inline'.

hope this helps anyone else having problems.

for reference, the errors looked like:
Code:
sdl-timer.o(.text+0x0): In function `lcdSwap':
/home/davidr/ds/ndslib/include/NDS/system.h:72: multiple definition of `lcdSwap'
sdl-pcsound.o(.text+0x0):/home/davidr/ds/ndslib/include/NDS/system.h:72: first defined here
sdl-video.o(.text+0x0): In function `lcdSwap':
/home/davidr/ds/ndslib/include/NDS/system.h:72: multiple definition of `lcdSwap'
sdl-pcsound.o(.text+0x0):/home/davidr/ds/ndslib/include/NDS/system.h:72: first defined here
swasynio.o(.text+0x0): In function `lcdSwap':
/home/davidr/ds/ndslib/include/NDS/system.h:72: multiple definition of `lcdSwap'
sdl-pcsound.o(.text+0x0):/home/davidr/ds/ndslib/include/NDS/system.h:72: first defined here