Problem compiling

Please support our C++ advertiser: Intel Parallel Studio Home
Reply

Join Date: Sep 2007
Posts: 56
Reputation: curt22 is an unknown quantity at this point 
Solved Threads: 0
curt22 curt22 is offline Offline
Junior Poster in Training

Problem compiling

 
0
  #1
Dec 4th, 2007
Hello, I'm following this tutorial http://fox-toolkit.net/cgi-bin/wiki...._Simple_Window
To learn how to make gui programs using the fox toolkit, but I can't get it to compile.
This is what I have in main.cpp
  1. #include <fx.h>
  2.  
  3. #include "mywindow.h"
  4.  
  5. FXDEFMAP(MyWindow) MyWindowMap[]={0
  6.  
  7. };
  8.  
  9. FXIMPLEMENT(MyWindow,FXMainWindow,MyWindowMap,ARRAYNUMBER(MyWindowMap));
  10.  
  11. int main(int argc,char ** argv) {
  12.  
  13.  
  14.  
  15. FXApp application("Tutorial #1","FOX Tutorials");
  16.  
  17.  
  18.  
  19. application.init(argc,argv);
  20.  
  21.  
  22.  
  23. new MyWindow(&application);
  24.  
  25.  
  26.  
  27. application.create();
  28.  
  29.  
  30.  
  31. return application.run();
  32.  
  33. }
This is what I have in mywindow.h
  1. class MyWindow : public FXMainWindow {
  2.  
  3. FXDECLARE(MyWindow)
  4.  
  5. private:
  6.  
  7. MyWindow() {}
  8.  
  9. public:
  10.  
  11. MyWindow(FXApp *);
  12.  
  13. virtual ~MyWindow();
  14.  
  15. virtual void create();
  16.  
  17. };
  18.  
  19. void MyWindow::create(){
  20.  
  21. FXMainWindow::create();
  22.  
  23. show(PLACEMENT_SCREEN);
  24.  
  25. }
But I'm getting these errors
  1. objs\main.o:main.cpp:(.text+0x376): undefined reference to `MyWindow::MyWindow(FX::FXApp*)'
  2.  
  3. objs\main.o:main.cpp:(.rdata$_ZTV8MyWindow[vtable for MyWindow]+0x20): undefined reference to `MyWindow::~MyWindow()'
  4.  
  5. objs\main.o:main.cpp:(.rdata$_ZTV8MyWindow[vtable for MyWindow]+0x24): undefined reference to `MyWindow::~MyWindow()'
  6.  
  7. collect2: ld returned 1 exit status
  8.  
I've searched ,but I can't figure out the answer.

I'm using windows with codeblocks and mingw.
Last edited by curt22; Dec 4th, 2007 at 5:14 pm.
Reply With Quote Quick reply to this message  
Join Date: Aug 2005
Posts: 15,398
Reputation: Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute 
Solved Threads: 1466
Team Colleague
Featured Poster
Ancient Dragon's Avatar
Ancient Dragon Ancient Dragon is offline Offline
Still Learning

Re: Problem compiling

 
0
  #2
Dec 4th, 2007
the link you posted doesn't go to a tutorial. Did you download the precompiled package or the source code and compile it yourself ?
Don't PM me with questions -- you might get a nasty PM in response. If you have a question then post it in one of the forums.
Reply With Quote Quick reply to this message  
Join Date: Sep 2007
Posts: 56
Reputation: curt22 is an unknown quantity at this point 
Solved Threads: 0
curt22 curt22 is offline Offline
Junior Poster in Training

Re: Problem compiling

 
0
  #3
Dec 4th, 2007
sorry. Here is the link:
http://fox-toolkit.net/cgi-bin/wiki...._Simple_Window
Also I copyed and pasted the example code like it said to.
Reply With Quote Quick reply to this message  
Join Date: Aug 2005
Posts: 15,398
Reputation: Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute 
Solved Threads: 1466
Team Colleague
Featured Poster
Ancient Dragon's Avatar
Ancient Dragon Ancient Dragon is offline Offline
Still Learning

Re: Problem compiling

 
0
  #4
Dec 4th, 2007
My guess is that you are not linking with the fox libraries. I tried to download it but only got errors that page cannot be displayed.
Don't PM me with questions -- you might get a nasty PM in response. If you have a question then post it in one of the forums.
Reply With Quote Quick reply to this message  
Join Date: Sep 2007
Posts: 56
Reputation: curt22 is an unknown quantity at this point 
Solved Threads: 0
curt22 curt22 is offline Offline
Junior Poster in Training

Re: Problem compiling

 
0
  #5
Dec 4th, 2007
I am linking with C:\fox\fox-1.6.31\lib\libFOXD-1.6.a.
Also the download is working for me you can get it here:
http://www.fox-toolkit.org/download.html
(I am using version 1.6.31)
Reply With Quote Quick reply to this message  
Join Date: Sep 2007
Posts: 56
Reputation: curt22 is an unknown quantity at this point 
Solved Threads: 0
curt22 curt22 is offline Offline
Junior Poster in Training

Re: Problem compiling

 
0
  #6
Dec 5th, 2007
Could someone please help.
Reply With Quote Quick reply to this message  
Join Date: Dec 2005
Posts: 5,850
Reputation: Salem has a reputation beyond repute Salem has a reputation beyond repute Salem has a reputation beyond repute Salem has a reputation beyond repute Salem has a reputation beyond repute Salem has a reputation beyond repute Salem has a reputation beyond repute Salem has a reputation beyond repute Salem has a reputation beyond repute Salem has a reputation beyond repute Salem has a reputation beyond repute 
Solved Threads: 749
Team Colleague
Salem's Avatar
Salem Salem is offline Offline
Void main'ers are DOOMed

Re: Problem compiling

 
0
  #7
Dec 5th, 2007
So do you have a mywindow.cpp which implements the rest of the functionality of your class in mywindow.h ?
Reply With Quote Quick reply to this message  
Join Date: Sep 2007
Posts: 56
Reputation: curt22 is an unknown quantity at this point 
Solved Threads: 0
curt22 curt22 is offline Offline
Junior Poster in Training

Re: Problem compiling

 
0
  #8
Dec 5th, 2007
Originally Posted by Salem View Post
So do you have a mywindow.cpp which implements the rest of the functionality of your class in mywindow.h ?
I only have two files main.cpp & mywindow.h like the tutorial said. They are attached to this post.
Attached Files
File Type: cpp main.cpp (387 Bytes, 1 views)
File Type: h mywindow.h (286 Bytes, 2 views)
Reply With Quote Quick reply to this message  
Join Date: Dec 2005
Posts: 5,850
Reputation: Salem has a reputation beyond repute Salem has a reputation beyond repute Salem has a reputation beyond repute Salem has a reputation beyond repute Salem has a reputation beyond repute Salem has a reputation beyond repute Salem has a reputation beyond repute Salem has a reputation beyond repute Salem has a reputation beyond repute Salem has a reputation beyond repute Salem has a reputation beyond repute 
Solved Threads: 749
Team Colleague
Salem's Avatar
Salem Salem is offline Offline
Void main'ers are DOOMed

Re: Problem compiling

 
0
  #9
Dec 6th, 2007
Well they need to be implemented SOMEWHERE.

My guess is since you've prefixed it with 'my', then it's your responsibility to implement it.
Reply With Quote Quick reply to this message  
Join Date: Aug 2005
Posts: 15,398
Reputation: Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute 
Solved Threads: 1466
Team Colleague
Featured Poster
Ancient Dragon's Avatar
Ancient Dragon Ancient Dragon is offline Offline
Still Learning

Re: Problem compiling

 
0
  #10
Dec 6th, 2007
curt22: if you re-read that tutorial you will see where it talks about mywindow.cpp, located about 3/4th down in the tutorial.
The only thing left to do, is to implement our "MyWindow" class ...
Don't PM me with questions -- you might get a nasty PM in response. If you have a question then post it in one of the forums.
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:


Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC