Should it be like this?
debug::debug(int a)
{
x = a;
}
Dave Sinkula
long time no c
5,058 posts since Apr 2004
Reputation Points: 2,780
Solved Threads: 314
Is "debug.cpp" part of the project?
Dave Sinkula
long time no c
5,058 posts since Apr 2004
Reputation Points: 2,780
Solved Threads: 314
Dave Sinkula
long time no c
5,058 posts since Apr 2004
Reputation Points: 2,780
Solved Threads: 314
A header should have declarations and allow all modules to compile. But a definition is needed to successfully link. This is where you are having problems. You tell the linker to expect a definition to be found, but then don't tell it where to find it.
I'm not sure if you looked at the picture I added to my previous reply in the edit, but your project ought to look something like that.
Dave Sinkula
long time no c
5,058 posts since Apr 2004
Reputation Points: 2,780
Solved Threads: 314
This is between you and the linker. Look at the project pane. See the two modules listed.
[edit]And stop messing with the code. The error is not there.
Dave Sinkula
long time no c
5,058 posts since Apr 2004
Reputation Points: 2,780
Solved Threads: 314
No.
::deep breath::
For multi-module coding, you need to have more than one module in the project. To do this you add files to the project.
Here. Go to Project->Add to Project->Files... and then add debug.cpp to your project. Then rebuild.
[edit]It ought to look like this.
[IMG]http://img30.exs.cx/img30/9715/untitled49ut.jpg[/IMG]
[/edit]
Dave Sinkula
long time no c
5,058 posts since Apr 2004
Reputation Points: 2,780
Solved Threads: 314
>what compiler you using?
Usually BC5.5 command line; sometimes MSVC6; sometimes Dev-C++. And ICCAVR for my current project.
Dave Sinkula
long time no c
5,058 posts since Apr 2004
Reputation Points: 2,780
Solved Threads: 314