PDA

Voir la version compl鋈e : [無ibrary][Aide] undefined reference error


Frosty Chao
19/01/2008, 18h54
Hmm, I don't speak french, but I hope someone might help me.
I installed 無ibrary, and I'm using VC++2008 Express. I already use PALib, and it's working nicely.
But I can't get 無ibrary to work... Also tried copying manually the files.

I always get this error message when I build my project.


1>------ Build started: Project: Learning10, Configuration: Release Win32 ------
1>Performing Makefile project actions
1>main.cpp
1>Linking...
1>main.o: In function `main':
1>c:/DSProg/DSProjects/Learning10/Learning10/source/main.cpp(13): undefined reference to `ulInit'
1>c:/DSProg/DSProjects/Learning10/Learning10/source/main.cpp(15): undefined reference to `ulInitGfx'
1>c:/DSProg/DSProjects/Learning10/Learning10/source/main.cpp(17): undefined reference to `ulInitText'
1>main.o: In function `ulShowSplashScreen':
1>c:/DSProg/devkitPro/libnds/include/ulib/ulib.h(130): undefined reference to `ulShowSplashScreen1'
1>c:/DSProg/devkitPro/libnds/include/ulib/ulib.h(132): undefined reference to `ulShowSplashScreen2'
1>main.o: In function `main':
1>c:/DSProg/DSProjects/Learning10/Learning10/source/main.cpp(26): undefined reference to `ulStartDrawing2D'
1>c:/DSProg/DSProjects/Learning10/Learning10/source/main.cpp(29): undefined reference to `ulDrawString'
1>c:/DSProg/DSProjects/Learning10/Learning10/source/main.cpp(32): undefined reference to `ulEndDrawing'
1>c:/DSProg/DSProjects/Learning10/Learning10/source/main.cpp(35): undefined reference to `ulSyncFrame'
1>collect2: ld returned 1 exit status
1>make[1]: *** [/c/DSProg/DSProjects/Learning10/Learning10/Release/Learning10.elf] Error 1
1>make: *** [build] Error 2
1>Build log was saved at "file://c:\DSProg\DSProjects\Learning10\Learning10\Release \BuildLog.htm"
1>Learning10 - 0 error(s), 0 warning(s)
========== Build: 1 succeeded, 0 failed, 0 up-to-date, 0 skipped ==========


Thanks in Advance...

Frosty Chao

Brunni
19/01/2008, 22h25
These messages indicate that after linking none of these functions were found. These functions are 無ibrary's, so the cause is that you've missed to link to this library. Read the makefile carefully, you should have a section like LDFLAGS with -lpa9, -lnds, etc. and you have to include -lul, -lpng, -lz and so on (all the libraries you want to link with, you may need others).

Frosty Chao
20/01/2008, 01h30
hmm thanks for the reply ^^ I'm still new to this stuff.. so

PATH := $(DEVKITARM)/bin:$(PATH)
SUBDIRS:= `ls | egrep -v '^(CVS|tools)$$'`

################################################## ####################

all:
make -C lib/arm7
make -C lib/arm9

################################################## ####################

clean:
make clean -C lib/arm7
make clean -C lib/arm9

################################################## ####################

archive:
$(DEVKITPRO)/devkitARM/arm-eabi/bin/ar -cr lib/libpa7.a lib/arm7/build/ModFile.o lib/arm7/build/PA.o lib/arm7/build/Sound7.o
$(DEVKITPRO)/devkitARM/arm-eabi/bin/ar -cr lib/libpa9.a lib/arm9/build/gba-jpeg-decode.o lib/arm9/build/PA.o lib/arm9/build/PA_Draw.o lib/arm9/build/PA_Draw8bit.o lib/arm9/build/PA_Draw8bitEx.o lib/arm9/build/PA_Draw16bit.o lib/arm9/build/PA_Draw16bitEx.o lib/arm9/build/PA_Keys.o lib/arm9/build/PA_IO.o lib/arm9/build/PA_Math.o lib/arm9/build/PA_Reco.o lib/arm9/build/PA_Sprite.o lib/arm9/build/PA_BgTiles.o lib/arm9/build/PA_BgGetPixel.o lib/arm9/build/PA_BgLargeMap.o lib/arm9/build/PA_Mode7.o lib/arm9/build/PA_Text.o lib/arm9/build/PA_TextSpecial.o lib/arm9/build/PA_TextPrint.o lib/arm9/build/PA_Text8bit.o lib/arm9/build/PA_Interrupt.o lib/arm9/build/PA_Palette.o lib/arm9/build/PA_PaletteEx.o lib/arm9/build/Sound9.o lib/arm9/build/PA_16c.o lib/arm9/build/PA_API.o lib/arm9/build/PA_GBFS.o lib/arm9/build/PA_Gif.o lib/arm9/build/PA_GifToTex.o lib/arm9/build/PA_GifToTiles.o lib/arm9/build/keyboard.raw.o lib/arm9/build/keyboard.map.o lib/arm9/build/keyboard.pal.o lib/arm9/build/PA_Keyboard.o lib/arm9/build/PA_IA.o lib/arm9/build/PA_IA.o lib/arm9/build/PA_FS.o lib/arm9/build/PA_Video.o lib/arm9/build/PA_Sound.o lib/arm9/build/PA_SoundEx.o lib/arm9/build/PA_Motion.o lib/arm9/build/PA_Timer.o lib/arm9/build/PA_Wifi.o lib/arm9/build/PA_LeaderBoard.o lib/arm9/build/PA_SplashEyes.o lib/arm9/build/PA_SplashBlue.o lib/arm9/build/PA_BgTrans.o lib/arm9/build/PA_3D.o lib/arm9/build/PA_3DSprites.o lib/arm9/build/PA_Stuff.o lib/arm9/build/PA_RTC.o lib/arm9/build/PA_2D.o lib/arm9/build/PA_SpriteStylus.o lib/arm9/build/PA_Inits.o lib/arm9/build/dgif_lib.o lib/arm9/build/gif_err.o lib/arm9/build/gif_font.o lib/arm9/build/gifalloc.o lib/arm9/build/quantize.o

heres's my makefile

where should I change?

Brunni
20/01/2008, 01h42
It's not the right makefile, look at the makefile for your ARM9 binary.

Frosty Chao
20/01/2008, 03h09
oh sorry >< I sent the wrong file...

Is this the correct one?

EDIT: I did what you said, but got another error message (at least it's shorter):

1>------ Build started: Project: Learning10, Configuration: Release Win32 ------
1>Performing Makefile project actions
1>logo.bmp
1>logo_wifi.bmp
1>main.cpp
1>arm-eabi-g++ -g -mthumb-interwork -mno -fpu -lul -lpng -lz -L/c/DSProg/devkitPro/PAlib/lib -specs=ds_arm9.specs logo.o logo_wifi.o main.o -L/c/DSProg/devkitPro/libnds/lib -lul -lpa9 -lpng -lz -lfat -lnds9 -o build.elf
1>c:/DSProg/devkitPro/libnds/lib\libul.a(drawing.o): In function `glInit':
1>c:/devkitpro/libnds/include/nds/arm9/videoGL.h(1089): undefined reference to `glGetGlobals'
1>c:/devkitpro/libnds/include/nds/arm9/videoGL.h(1090): undefined reference to `glInit_C'
1>collect2: ld returned 1 exit status
1>make[1]: *** [/c/DSProg/DSProjects/Learning10/Learning10/Learning10.elf] Error 1
1>make: *** [build] Error 2
1>Build log was saved at "file://c:\DSProg\DSProjects\Learning10\Learning10\Release \BuildLog.htm"
1>Learning10 - 0 error(s), 0 warning(s)
========== Build: 1 succeeded, 0 failed, 0 up-to-date, 0 skipped ==========

Brunni
20/01/2008, 03h52
You probably have a too old version of the devkitpro. Try to download the latest one.

Frosty Chao
21/01/2008, 02h53
I'm using R20, which is required by PALib, since R21 doesn't work. Isn't there another way to solve the problem?

And sorry for taking your time

Thanks in Advance

Frosty Chao

Roly
25/01/2008, 14h07
I have the exact problem. Except I don't use Visual Studio.

Brunni
01/02/2008, 01h07
I'll see with the latest release when i've got some time... maybe they changed something in libnds as usual.

skyclad monkey
25/02/2008, 12h17
I have this exact same problem as well. Any solutions anyone?
I am also using R20 as PALib requires it. Which version works with 無ibrary?

ys_
01/03/2008, 01h03
I had the same problem. I could solve it just by changing

-lul -lpa9

to

-lpa9 -lul

in the Makefile.

skyclad monkey
04/03/2008, 04h00
Im not actually using PALib, I am only using ulibrary.
I cant even compile the examples without this error occuring.

ys_
05/03/2008, 17h28
Then use devkitarm r21, update libnds to 20071023 and PAlib with the community update 080203. It should work.