PLEASE HELP!!!! - It's the same olde question!

Started by
4 comments, last by fallingbrickwork 22 years, 7 months ago
When I try to compile Texture mapping Tutorial (6) I get the following errors, Linking... lesson06.obj : error LNK2001: unresolved external symbol "void __cdecl tgaLoad(char *,struct image_t *,unsigned int)" (? tgaload@@YAXPADPAUimage_t@@l@Z) Debug/lesson06.exe : fatal error LNK1120: 1 unresolved externals Error executing link.exe. lesson06.exe - 2 error(s), 0 warning(s) (The above has been cut & paste from Microsoft Visual C++ 6.0) I have tried other examples of texture mapping, some which use a bmpload.h instead of the tgaload.h to read in a file, but I get a similar error. I am using Visual C++ and GLUT 3.7.4 I my project is linked to opengl32.lib glu32.lib glut32.lib Cheers.
Advertisement
Are you letting the compiler build a default workspace? As it builds a console application as default... this can cause the LINK2001 Error.

You need to start a new project as Win32 app include all the files and then build.
Thanks for the info..

I created a new Project as you said. After I''d added the header files and source files etc and re-built the project it found a different LINK2001 error and a LINK1120 error.

--------------------Configuration: Test - Win32 Debug--------------------
Linking...
LIBCD.lib(wincrt0.obj) : error LNK2001: unresolved external symbol _WinMain@16
Debug/Test.exe : fatal error LNK1120: 1 unresolved externals
Error executing link.exe.

Test.exe - 2 error(s), 0 warning(s)


Please Help again...
hmmm... I dont have a compiler at work... I''ll check it out later when I get home.
Your first error means that the compiler hasn''t found the ''external'' function TGALOAD etc..
Either way you''d have to refer to that function, e.g where is it, and whats it prototype.
e.g you got your .cpp file and that function in it.
So, you create .h file with same name as .cpp,
Include .h file in .cpp file .
and then in file where you using that TGALOAD function, just include the .h file.
That''s it.
For example:

// blah.cpp file

#include "blah.h"

bool LoadTGA(char *filename)
{
etc..
return TRUE;
}

// blah.h

bool LoadTGA(char *);


// file where using LoadTGA

#include "blah.h"

bool result=LoadTGA("theparticle.tga");
you should look into DevIL

openil.sourceforge.net
www.EberKain.comThere it is, Television, Look Listen Kneel Pray.

This topic is closed to new replies.

Advertisement