On 28 Jul 2003 10:30:44 -0700
brianj774@gmx.net (Brian J. Ackermann) wrote:
[color=blue]
> Hi everybody,
>
> I'm new to c++, and I'm working on this simple little application,
> which ought to compile just fine, but I'm missing something. The
> program has 4 file, 2 headers, and 2 cpp files. All files exist in
> the same directory. The files compile fine, but when linking, I get
> all these undefined references. The routines exist in
> AboutDialog.cpp, and are declared in AboutDialog.h. Main.h references
> AboutDialog.h, and Main.cpp references Main.h...
>
> I can't see why it thinks the class is undefined, or whatever...I'm
> sure its quite simple....
>
> project1_main.o(.text+0x1166): In function
> `ZN7MyFrame7OnAboutER14wxCommandEvent':
> C:/WORK/P2/main.cpp:88: undefined reference to
> `AboutDialog::AboutDialog(wxWindow*)'
> project1_main.o(.text+0x11d7):C:/WORK/P2/main.cpp:89: undefined
> reference to `AboutDialog::SetText(wxString const&)'
> project1_main.o(.text+0x122e):C:/WORK/P2/main.cpp:90: undefined
> reference to `AboutDialog::SetText2(wxString const&)'
> make: *** [project1.exe] Error 1
>
> Can anybody offer a suggestion? Thanks[/color]
Does main.cpp #include AboutDialog.h? If so, does AboutDialog.h define
such functions (note, not just functions with the same name, but
taking the type and number of arguments you've supplied in the
function call in main())? If so are you linking the files correctly -
see your compiler documentation for more info on that.
Hope this helps,
Matt.