CTurt / dsgmLib

MIT License
35 stars 6 forks source link

Tons of "declared but never defined" errors #5

Closed nicklausw closed 8 years ago

nicklausw commented 8 years ago

(I'm not a C expert, so excuse me if this is stupid)

dsgmLib fails to build, and I couldn't find a reason for this (under Cygwin, as cmd won't work and msys crashes):

In file included from C:/devkitPRO/dsgmLib/include/DSGM.h:40:0,
                 from C:/devkitPRO/dsgmLib/source/DGM_wireless.c:1:
C:/devkitPRO/dsgmLib/include/DSGM_quaternion.h:52:19: warning: inline function 'Quaternion_fromEuler' declared but never defined
 inline Quaternion Quaternion_fromEuler(int32 roll, int32 pitch, int32 yaw);
                   ^
In file included from C:/devkitPRO/dsgmLib/include/DSGM.h:11:0,
                 from C:/devkitPRO/dsgmLib/source/DGM_wireless.c:1:
C:/devkitPRO/libnds/include/dsgmDSWiFi.h:12:13: warning: inline function 'setWirelessMode' declared but never defined
 inline void setWirelessMode(enum WIRELESS_MODE mode);

This error seems to be there for every single function. I looked up the error but the only solution was to remove "static" which isn't there to begin with.

nicklausw commented 8 years ago

Note: I know it's actually a warning, but it becomes an error when building an example.

nicklausw commented 8 years ago

Update: the errors go away with the use of --std=gnu89.

CTurt commented 8 years ago

Should probably be using --std=c11 instead, but I'm glad that it works for you.

nicklausw commented 8 years ago

Do you think this has something to do with devkitPro's updates? A few months ago I didn't have this problem at all.

CTurt commented 8 years ago

Could well be. I'm not currently able to investigate this further, but I'm glad you solved the problem. Have fun with the library!

nicklausw commented 8 years ago

Never got around to mentioning that -fgnu89-inline works perfectly.

https://gcc.gnu.org/gcc-5/porting_to.html

GCC 5 defaults to gnu11 rather than gnu89, causing a change in how inline functions are handled.

Fewnity commented 3 years ago

I don't understand how can I use the "--std=c11" thing :/ Someone can help me?

aerglass commented 2 years ago

alright, I ported the thing to not use inline function which i think i ported it to gnu11.

I don't understand how can I use the "--std=c11" thing :/ Someone can help me?

You should modify the makefile to add the --std=c11 However c11 have the declared but never defined errors.

Modify the Lib Makefile and add the CFlag -fgnu89-inline.

However even if you do this it wouldnt even work, multiple definition errors.