Skip to main content
GameDev.net gamedev.net
🔒 Locked

Odd linker problem. (C++, VS6)

Started by buffalothunder Jan 10, 2003 at 3:36 PM 4 replies 250+ views
Original Post
buffalothunder
buffalothunder
Forgive me if this is actually pretty simple (and I''ve got this feeling that it may be), but I''m not programming C++ very long, only about four or five months. The code compiles fine; but the linker barfs with the following message: Class.obj : error LNK2001: unresolved external symbol "private: void __thiscall Class::method(float *,float,float,int,int)" (?method@Class@@AAEXPAMMMHH@Z) Which is cryptic to say the least. I would have thought it a library problem, but it references my own code, Class::method, which was declared simply as ''void method( etc... )'' in both the .h and .cpp files. Any pointers? Thanks.
buffalothunder
buffalothunder
I''m afraid that isn''t the issue - my class is set up properly (much as your example is), and the .h file is sentried. Thanks anyway.
Pyabo
Pyabo
Are the method declaration and definition exactly the same? When you call the method are you providing the correct parameter list that matches this declaration? Are you sure the .cpp file that contains this code is being compiled and linked with the .cpp that contains the call?
buffalothunder
buffalothunder
Got it. The declaration is the same as the above, but the definition wasn''t Class::method... Do I feel dumb. I''ll chalk it up to learning experience. I never thought to check (again), as I would''ve put that down to a compiler issue. Makes sense in hindsight though. Thanks again.

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.