You have those lines in your source code:

Wt::WWidget *menuHome();
Wt::WWidget *menuAbout();

They are declarations of methods; you're telling the compiler, these will be
'defined' at some other place in the program in the end.

In the object file (.o) that c++ compiles for that source file, it'll have
two big tables; symbols I need to make a complete program, and symbols I
provide. Because you're telling the compiler "these methods exist
somewhere", it'll put those methods in the 'symbols I need' table. The
linker (that sticks all the .o's together into an executable) is expecting
you to link in another .o file that provides them.

Further explanation of the process
http://stackoverflow.com/questions/6264249/how-does-the-compilation-linking-process-work

I recommend this book to learn a good c++ foundation. Linking is covered in
detail in there:
http://www.amazon.com/C-Programming-Language-Special/dp/0201700735/ref=sr_1_2?ie=UTF8&qid=1312575972&sr=8-2

Also, please take this completely constructively, I came across this blog
post yesterday and it has some good lessons for all of us, which I believe
you could apply to your C++ and Wt work:
http://jinfiesto.posterous.com/how-to-seem-good-at-everything-stop-doing-stu

Kind Regards,
Matthew Sherborne



On Fri, Aug 5, 2011 at 7:38 PM, PARVINDER RAJPUT <[email protected]> wrote:

> Source code of another application
> http://paste.ubuntu.com/659157/
> error please check out
> CMakeFiles/test.wt.dir/test.C.o: In function
> `WtApplication::WtApplication(Wt::WEnvironment const&)':
> test.C:(.text+0x3b5): undefined reference to `WtApplication::menuHome()'
> test.C:(.text+0x49c): undefined reference to `WtApplication::menuAbout()'
> collect2: ld returned 1 exit status
> please help me
>
>
> ------------------------------------------------------------------------------
> BlackBerry&reg; DevCon Americas, Oct. 18-20, San Francisco, CA
> The must-attend event for mobile developers. Connect with experts.
> Get tools for creating Super Apps. See the latest technologies.
> Sessions, hands-on labs, demos & much more. Register early & save!
> http://p.sf.net/sfu/rim-blackberry-1
> _______________________________________________
> witty-interest mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/witty-interest
>
------------------------------------------------------------------------------
BlackBerry&reg; DevCon Americas, Oct. 18-20, San Francisco, CA
The must-attend event for mobile developers. Connect with experts. 
Get tools for creating Super Apps. See the latest technologies.
Sessions, hands-on labs, demos & much more. Register early & save!
http://p.sf.net/sfu/rim-blackberry-1
_______________________________________________
witty-interest mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/witty-interest

Reply via email to