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 > "Undefined reference to" help

#119113 - ikaris - Mon Feb 19, 2007 9:15 pm

Inside my "sources" folder, I have several folders, each containing different elements, for example:

sources\fzBase (all includes)
sources\fzAnim (for animation, such as containers for animation data, etc...)
sources\fzGfx (graphics functions, mostly for rendering)
sources\fzMath (math classes)
sources\fzMesh (containing and building mesh data)

etc...

I have another folder for utilities:

sources\fzUtils

Inside this folder, at the moment I have two things:

string functions (fzString.h)

and

my own single linked list class (fzSLList.h)

I am using my string functions all over the place in my project, without any problems.

However, when I start using my list class, I get this error at compile:

Code:

1>linking fzEngine.elf

1>fzBuildMesh.o: In function `fzBuildMesh(unsigned char*, fzMesh&)':

1>c:/Projects/fuze/fzEngine/sources/fzMesh/fzBuildMesh.cpp(30): undefined reference to `fzSLList<fzVec3>::Add(fzVec3)'

1>c:/Projects/fuze/fzEngine/sources/fzMesh/fzBuildMesh.cpp(33): undefined reference to `fzSLList<fzColor>::Add(fzColor)'

1>c:/Projects/fuze/fzEngine/sources/fzMesh/fzBuildMesh.cpp(36): undefined reference to `fzSLList<fzTexCoord>::Add(fzTexCoord)'

1>c:/Projects/fuze/fzEngine/sources/fzMesh/fzBuildMesh.cpp(39): undefined reference to `fzSLList<fzVec3>::Add(fzVec3)'


Clearly, it's not being found at link time.

Originally, I thought perhaps my sources\fzUtils folder is not in the Makefile... however, here's the line from my Makefile that has ALWAYS worked before... remember, my string stuff, which works, is in the same folder as the list:

Code:
SOURCES      :=   sources/fzMath sources/fzUtils sources/fzMesh sources/fzMaterial sources/fzAnim sources/fzObject sources/fzPrimitives sources/fzGfx sources/fzBase sources/fzGame


Any ideas what I could be doing wrong ?

This only broke when I started using the list class... before I was using vector, and I wanted to replace that with the list instead.

I imagine it's because my string stuff is just functions and not a class, and my list is a class... (However, I am using lots of other classes, specifically in fzMath for vectors and matrices, without any problems...)

I am using Visual Studio 2005.

Thanks !

#119155 - OOPMan - Tue Feb 20, 2007 8:55 am

Sounds like not all the objects are being built...

Try taking a look in the build folder and see if you can find which objects files are not being built. That might help you start to work out what's wrong...
_________________
"My boot, your face..." - Attributed to OOPMan, Emperor of Eroticon VI

You can find my NDS homebrew projects here...

#119189 - ikaris - Tue Feb 20, 2007 5:29 pm

Thank you for your reply,

it seems to me that all objects are being built... and in my build folder I do find "SLList.o" and "SLList.d" and they're not 0 kilotbytes, so there's data in there.

My main.o / main.d are there, all of my math classes, BuildMesh.o / BuildMesh.d are there, which is one of the first functions that the linker trips up on...

Should I be looking for something more specific ?

Anything else it could be ?

The only thing I changed was that I started using my class instead of std::vector...