Help | Site Map
Connecting Tech Pros Worldwide
 
 
LinkBack Thread Tools
  #1  
Old July 19th, 2005, 04:49 PM
Brian J. Ackermann
Guest
 
Posts: n/a
Default Problem Linking Simple App

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
  #2  
Old July 19th, 2005, 04:49 PM
Matthew Burgess
Guest
 
Posts: n/a
Default Re: Problem Linking Simple App

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.
 

Bookmarks

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over network members.
Post your question now . . .
It's fast and it's free

Popular Articles