By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
448,965 Members | 1,457 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 448,965 IT Pros & Developers. It's quick & easy.

Problem Linking Simple App

P: n/a
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

Brian
Jul 19 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
On 28 Jul 2003 10:30:44 -0700
br*******@gmx.net (Brian J. Ackermann) wrote:
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


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.
Jul 19 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.