FLTK with Atom - error message


#1

Hey guys

I want to use FLTK with atom but I get this error message:

Undefined symbols for architecture x86_64:
“Fl_Double_Window::Fl_Double_Window(int, int, char const*)”, referenced from:
_main in test-db196f.o
“Fl::run()”, referenced from:
_main in test-db196f.o
“Fl_Group::end()”, referenced from:
_main in test-db196f.o
“Fl_Button::Fl_Button(int, int, int, int, char const*)”, referenced from:
_main in test-db196f.o
“Fl_Window::show(int, char**)”, referenced from:
Fl_Double_Window::show(int, char**) in test-db196f.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

My program looks like this:

#include <iostream>
# include <FL/Fl.H>
# include <FL/Fl_Double_Window.H>
# include <FL/Fl_Button.H>

void ok_callback(Fl_Widget*, void*) {
   std::cout << "noticed" << std::endl;
}

int main(int argc, char *argv[]) {
   Fl_Double_Window *w = new Fl_Double_Window(330, 190);
   Fl_Button *b = new Fl_Button(110, 130, 100, 35, "Okay");
   b->callback(ok_callback);
   w->end();
   w->show(argc, argv);
   return Fl::run();
}

Any Ideas? I use a mac btw.

I appreciate every single tip or help I can get. Thanks in advance :slight_smile:


#2

Based on the error message, this looks like a C++ problem. You will be most likely to find someone who can help you if you post on a forum frequented by a lot of C-family developers. This one is just for people who use the editor, and many of us work in JavaScript and Python so that we don’t have to mess with having the right symbols for a given CPU architecture.


#3

Thanks for your fast answer.

I will ask the same question on Stack Overflow, I guess.

Have a nice day,
MagJ