Skip to main content
gamedev.net
🔒 Locked

Link error with static method

Started by Nox587 1 reply 1k views
Original Post
Nox587
Nox587
I have a library that i created, and just recently added a static member function to a class in the library. The library compiles fine, but when I write a simple program to use the library, the compiler tells me that the new static funciton is an unresolved external. The code for the new method is static void killApp() { mShutdownRequested = true; } mShutdownRequested is a static member... Here is the error I'm getting, I'm using VC 7.1 btw, ------ Build started: Project: ProfileApp, Configuration: Debug Win32 ------ Linking... Creating library Debug/ProfileApp.lib and object Debug/ProfileApp.exp test.obj : error LNK2001: unresolved external symbol "public: static bool theRock::rockCore::mShutdownRequested" (?mShutdownRequested@rockCore@theRock@@2_NA) Debug/ProfileApp.exe : fatal error LNK1120: 1 unresolved externals I'm not sure why I'm getting this error, if anyone knows why, please let me know
Nox587
Nox587
well, I had almost that same thing, I forgot "theRock::" to let it know the namespace, thanks for the help

Topic Locked

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

Sign in to reply to this topic.