Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

fallingbrickwork

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

This topic is 6086 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

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.

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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...

Share this post


Link to post
Share on other sites
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");

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!