• Advertisement
Sign in to follow this  

including libraries to GCC project in a makefile

This topic is 4793 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

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
Advertisement
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
yep
i use the GCC from devkitadv and drawSquare is inside GBAEngine.a

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
Sign in to follow this  

  • Advertisement