Question

In a current project I am constructing a Physics namespace. in the file Core.h

extern real sleepEpsilon;/* = ((real).3);*/ // typedef float real; used, and works throughout project.

then in Core.cpp

real Physics::sleepEpsilon = ((real)0.3);

though I am receiving the error, and it is referring to another class that #includes Core.h, and I even went as far as to preface Physics:: on all of them, but the LNK error still persists.

EDIT: included error

1>Body.obj : error LNK2001: unresolved external symbol "float Physics::sleepEpsilon" (?sleepEpsilon@Physics@@3MA)
1>C:\...\Physics\Debug\Physics.exe : fatal error LNK1120: 1 unresolved externals
Was it helpful?

Solution

Check if the folder which has Core.h is in your Additional Library directories under Linker->General in your project's property pages. This usually leads to LNK2001 errors.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top