|
Archives
D Programming
DD.gnu digitalmars.D digitalmars.D.bugs digitalmars.D.dtl digitalmars.D.dwt digitalmars.D.announce digitalmars.D.learn digitalmars.D.debugger C/C++ Programming
c++c++.announce c++.atl c++.beta c++.chat c++.command-line c++.dos c++.dos.16-bits c++.dos.32-bits c++.idde c++.mfc c++.rtl c++.stl c++.stl.hp c++.stl.port c++.stl.sgi c++.stlsoft c++.windows c++.windows.16-bits c++.windows.32-bits c++.wxwindows digitalmars.empire digitalmars.DMDScript |
c++ - Newbie needs your help
Very basic problem, I guess...
This file compiles with no problems:
// start of main.cpp
class A
{
int n;
public:
void check();
};
void A::check()
{
n=1;
}
void main()
{
A objA;
objA.check();
}
// end of main.cpp
But when I seperate it to 3 files: header, class functions implementation and
main, the compilation fails:
// start of header file
class A
{
int n;
public:
void check();
};
// end of header file
//start of class functions implementation file
#include "A.h"
void A::check()
{
n=1;
}
// end of class functions implementation file
//start of main file
#include "A.h"
void main()
{
A objA;
objA.check();
}
//end of main file
compilation output:
link MAIN2,,,user32+kernel32/noi;
OPTLINK (R) for Win32 Release 7.50B1
Copyright (C) Digital Mars 1989 - 2001 All Rights Reserved
MAIN2.obj(MAIN2)
Error 42: Symbol Undefined ?check A QAEXXZ (void syscall A::check(void ))
--- errorlevel 1
------ Output completed (0.4 sec consumed) ------
What is my mistake?
Nov 19 2003
Are you dmc-ing both implementation files? e.g.
dmc main.cpp funcs.cpp?
It looks like all you're doing is
dmc main.cpp
"E.T." <E.T._member pathlink.com> wrote in message
news:bpfi2e$2ouk$1 digitaldaemon.com...
Nov 19 2003
|