#### Archived

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

# Mixing tuts

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

## Recommended Posts

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 =)

##### Share on other sites
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.

##### Share on other sites
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.

##### Share on other sites
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..."

##### Share on other sites
In every file other than the one you want to "own" the array, declare it extern. For example, put
extern BYTE g_HeightMap;
BYTE g_HeightMap[MAP_SIZE * MAP_SIZE];

That should clear things up.

##### Share on other sites
thanks for the help all!

1. 1
2. 2
3. 3
frob
14
4. 4
5. 5
Rutin
12

• 12
• 9
• 57
• 14
• 15
• ### Forum Statistics

• Total Topics
632112
• Total Posts
3004176

×