Jump to content

  • Log In with Google      Sign In   
  • Create Account

Banner advertising on our site currently available from just $5!


1. Learn about the promo. 2. Sign up for GDNet+. 3. Set up your advert!


Mixing tuts


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
5 replies to this topic

#1 Prod   Members   -  Reputation: 134

Like
Likes
Like

Posted 23 September 2001 - 01:19 PM

I was trying to Mix Nehe''s Lesson35 with gametutorials.com camera part 2 tutorial... Well i went the wrong direction and tried to add the camera code to nehe''s instead of putting the drawing code in the camera tut. So i got these wierd errors doing it lesson35.obj : error LNK2001: unresolved external symbol "public: __thiscall CCamera::CCamera(void)" (??0CCamera@@QAE@XZ) Lesson35.obj : error LNK2001: unresolved external symbol "public: void __thiscall CCamera:ositionCamera(float,float,float,float,float,float,float,float,float)" (?PositionCamera@CCamera@@QAEXMMMMMMMMM@Z) Lesson35.obj : error LNK2001: unresolved external symbol "public: void __thiscall CCamera::RotateView(float,float,float)" (?RotateView@CCamera@@QAEXMMM@Z) Lesson35.obj : error LNK2001: unresolved external symbol "public: void __thiscall CCamera::MoveCamera(float)" (?MoveCamera@CCamera@@QAEXM@Z) Debug/lesson35.exe : fatal error LNK1120: 4 unresolved externals If i went the other way i dont think i would get these errors, but i want to find out how to fix them for learning reasons Any help would be nice =)

Sponsor:

#2 masonium   Members   -  Reputation: 118

Like
Likes
Like

Posted 23 September 2001 - 02:48 PM

all of those are like errors, which I get all the time. You might have accidentally misspelled the functions when you wrote them or called them with too many parameters or the wrong ones or something like that.



#3 Anonymous Poster_Anonymous Poster_*   Guests   -  Reputation:

Likes

Posted 23 September 2001 - 03:00 PM

No, if he had misspelled the function names or passed too many (or too few parameters) he would have had compilation errors. These are linking errors.

Unresolved external means the linker can''t find the code for an entity, be it a structure/class declaration, a variable intialization or a function body. Check that you''ve included all the necessary implementation (.cpp) and library files. Also make sure you''re linking with the correct versions of the libraries if you have multiple versions.

These are generic issues that I respond to. Someone more familiar with OpenGL, NeHe''s code and the other tutorials will probably give you more info.

#4 Prod   Members   -  Reputation: 134

Like
Likes
Like

Posted 23 September 2001 - 03:28 PM

well i figured it out, but cant figure out how to fix it

the compiler is complaining that im using

BYTE g_HeightMap[MAP_SIZE*MAP_SIZE];
// Holds The Height Map Data

in more than one file, if i try and put it in a header file and just add the header file to each cpp file i need it, it says something along the lines of "all ready declared in..."

#5 Oluseyi   Staff Emeritus   -  Reputation: 1735

Like
Likes
Like

Posted 23 September 2001 - 03:39 PM

In every file other than the one you want to "own" the array, declare it extern. For example, put
extern BYTE g_HeightMap; 
in your header file and include that everywhere. Then in your main source file (the one that contains your main()/WinMain()):
BYTE g_HeightMap[MAP_SIZE * MAP_SIZE]; 

That should clear things up.

#6 Prod   Members   -  Reputation: 134

Like
Likes
Like

Posted 23 September 2001 - 04:19 PM

thanks for the help all!




Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS