• We’re currently investigating an issue related to the forum theme and styling that is impacting page layout and visual formatting. The problem has been identified, and we are actively working on a resolution. There is no impact to user data or functionality, this is strictly a front-end display issue. We’ll post an update once the fix has been deployed. Thanks for your patience while we get this sorted.

Linking error in Visual Studio 2003

snoopdoug1

Platinum Member
Hello,

I'm trying to build a project which links in many other libraries(all of which are built in the same solution). During the linking stage, I get one error that I'm having trouble figuring out. As I said, this is in Visual Studio 2003(C++).

error LNK2001: unresolved external symbol "public: virtual class std::basic_string<char, struct std::char_traits<char>, class std::allocator<char> > __thiscall myMsg::GetClassNameA(void) const...<bunch of garbled txt>

myMsg is a class in one of my other libraries... Any ideas as to what this may be?

I really appreciate any insight you can provide!
 
GetGlassName is #define macro and I bet that it is casuing the problem. Either rename the function or put #undef GetClassName at the top of your header file.
 
ok, I'll give that a shot. You're talking about the header in my myMsg class?

Btw, I see this is your first post. Thanks a lot for signing up to help!
 
You're welcome. Glad it worked.

For your reference most of the Win32 functions that take string parameters are actaully #define macros. They look something like this:

#ifdef UNICODE
#define GetClassName GetClassNameW (unicode version)
#else
#define GetClassName GetClassNameA (ansi version)
#endif

That's why your linker error actually had an "A" at the end of the function name.

 
Back
Top