I am trying to compile an fltk file with g++. The solution in this thread does not work for me -
http://ubuntuforums.org/showthread.php?t=176994
The problem I am having is that the file will compile seemingly okay, but when I run it, there are no widgets.
The solution here -
http://www3.telus.net/public/robark/
does not work because I do not have the X11R6 libraries. I tried converting those to just the X11 folders, but that would not even compile.
Some other thing I have tried -
Code:
g++ -o go guiwindow.cpp -L/home/sterling/Downloads/fltk-1.3.x-r8695/FL -lfltk -lXext -lX11 -lm
g++ $(fltk-config --compile) -o go guiwindow.cpp -L/home/sterling/Downloads/fltk-1.3.x-r8695/FL -lfltk -lXext -lX11 -lm
g++ -L/home/sterling/Dtownloads/fltk-1.3.x-r8695/FL -lfltk -lXext -lX11 -lm -o go guiwindow.cpp
These are just the first ones I have in the terminal history. I have tried many more combinations. This is the code for what I am doing -
Code:
void GUIWindow::cb_stop(Fl_Widget* o, void* v) {
Fl_Button* b = (Fl_Button*)o;
b->label("Good Job");
b->resize(50,75,100,50);
b->redraw();
}
GUIWindow::GUIWindow(int w, int h, const char* title) : Fl_Window(w, h, title) {
begin();
stop = new Fl_Button(50, 75, 70, 30, "Stop");
stop->callback(cb_stop, this);
drive = new Fl_Button(150, 75, 70, 30, "Test");
end();
resizable(this);
show();
}
GUIWindow::~GUIWindow() {}
int main() {
GUIWindow w(300,200,"Testing");
return Fl::run();
}
fltk-config --compile guiwindow.cpp works for just one file, but I need to use this one file with other files in a project. Thats what I am trying to use g++. What does the fltk-config --compile do differently that my g++ scripts aren't? If anyone could help me, I would extremely grateful.
Bookmarks