Larry
2010-01-14 11:35:28 UTC
Hi,
I have coded a class basically made up of 2 file: myclass.h, myclass.cpp I
would like to use this class in one of my project. So I created a new empty
project with a main.cpp file that looks like this:
#include <stdio.h>
#include "myclass.h"
int main()
{
myclass* C = new myclass();
(...)
delete C;
return 0;
}
Actually, in the "solution explorer" I did not add those existing items as I
thought it'd fine for them to be just in the the same dir where the main.cpp
file is:
.../Visual Studio 2008/Projects/myproject/myproject/main.cpp, myclass.h,
myclass.cpp and Debug folder along with a file USER.
Now, when I debug the code I showed above I get this error: "unresolved
external symbol" regarding both the constructor and destructor, obiviously.
what am I doing wrong? Also, I tried the same with an. obj file (created
from myclass.cpp file) and I get the same error...
can anyone point me in the right direction, please?
thanks
I have coded a class basically made up of 2 file: myclass.h, myclass.cpp I
would like to use this class in one of my project. So I created a new empty
project with a main.cpp file that looks like this:
#include <stdio.h>
#include "myclass.h"
int main()
{
myclass* C = new myclass();
(...)
delete C;
return 0;
}
Actually, in the "solution explorer" I did not add those existing items as I
thought it'd fine for them to be just in the the same dir where the main.cpp
file is:
.../Visual Studio 2008/Projects/myproject/myproject/main.cpp, myclass.h,
myclass.cpp and Debug folder along with a file USER.
Now, when I debug the code I showed above I get this error: "unresolved
external symbol" regarding both the constructor and destructor, obiviously.
what am I doing wrong? Also, I tried the same with an. obj file (created
from myclass.cpp file) and I get the same error...
can anyone point me in the right direction, please?
thanks