Sign in to follow this  
pex22

including libraries to GCC project in a makefile

Recommended Posts

Hi. this is my make.bat:
path=c:\devkitadv\bin
gcc -o %1.elf %1 -lm c:\pex\gbademo\gba.a
objcopy -O binary %1.elf %1.gba
c:\visualboy\VisualBoyAdvance.exe %1.gba
where %1 is main.c im trying to create the main.c.gba but GCC says "undefined reference to 'drawSquare'" in Dev-Cpp, when i wrote in Project Options->Parameters->Linker: –lm ../GBAEngine/GBAEngine.a (its the same library) i dont get an error at all, so i copy-pasted –lm and i find out that the -lm in make.bat is a simple - but the -lm in Dev-Cpp uses a longer -, which i cant use in DOS. when i use the longer - in make.bat, i get following error: "gcc: ulm: No such file or directory" where u is some europian u with a triangle on it. what should i write? thanks, pex. [Edited by - pex22 on December 3, 2004 3:24:44 PM]

Share this post


Link to post
Share on other sites
Quote:
Original post by pex22
Hi.
this is my make.bat:
path=c:\devkitadv\bin
gcc -o %1.elf %1 -lm c:\pex\gbademo\gba.a
objcopy -O binary %1.elf %1.bin
c:\visualboy\VisualBoyAdvance.exe %1.gba

where %1 is main.c
im trying to create the main.c.gba but GCC says "undefined reference to 'drawSquare'"
in Dev-Cpp, when i wrote in Project Options->Parameters->Linker:
–lm ../GBAEngine/GBAEngine.a
(its the same library)
i dont get an error at all, so i copy-pasted –lm and i find out that the -lm in make.bat is a simple -
but the -lm in Dev-Cpp uses a longer -, which i cant use in DOS.
when i use the longer - in make.bat, i get following error:
"gcc: ulm: No such file or directory"
where u is some europian u with a triangle on it.
what should i write?

thanks,
pex.
Okay I want to help you, but I need to get some things clear first. So you're using a tool set called devkitadv for GBA development. It includes a port of GCC with various libraries and other programs. You've written a batch script to compile your game, and you're getting a rather classic compilation error. Is that correct?

Share this post


Link to post
Share on other sites
Quote:
Original post by pex22
yep
i use the GCC from devkitadv and drawSquare is inside GBAEngine.a
Sorry for the long wait.

From your sample batch script, you're not linking with GBAEngine.a. You only state gba.a, and I can only assume these are separate libraries. Try linking with both.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this