I'm studying Principles and Practices using C++ and am having issues linking to the proper architecture I'm currently using an Apple computer, my compiler is gcc version 4.2.1 (Based on Apple Inc. build 5658) (LLVM build 2336.1.00), when I
file /usr/lib/libffi.dylib
/usr/lib/libffi.dylib: Mach-O universal binary with 2 architectures
/usr/lib/libffi.dylib (for architecture x86_64): Mach-O 64-bit dynamically linked shared library x86_64
/usr/lib/libffi.dylib (for architecture i386): Mach-O dynamically linked shared library i386
in which I have both architectures/libraries available here's what I'm using to compile my program
g++ -Wall chapter.12.3.cpp -o chapter.12.3
In file included from GUI.h:11,
from Simple_window.h:10,
from chapter.12.3.cpp:7:
Graph.h: In constructor ‘Graph_lib::Color::Color(Graph_lib::Color::Color_type)’:
Graph.h:56: warning: ‘Graph_lib::Color::c’ will be initialized after
Graph.h:55: warning: ‘char Graph_lib::Color::v’
Graph.h:45: warning: when initialized here
Graph.h: In constructor ‘Graph_lib::Color::Color(Graph_lib::Color::Color_type, Graph_lib::Color::Transparency)’:
Graph.h:56: warning: ‘Graph_lib::Color::c’ will be initialized after
Graph.h:55: warning: ‘char Graph_lib::Color::v’
Graph.h:46: warning: when initialized here
Graph.h: In constructor ‘Graph_lib::Color::Color(int)’:
Graph.h:56: warning: ‘Graph_lib::Color::c’ will be initialized after
Graph.h:55: warning: ‘char Graph_lib::Color::v’
Graph.h:47: warning: when initialized here
Graph.h: In constructor ‘Graph_lib::Color::Color(Graph_lib::Color::Transparency)’:
Graph.h:56: warning: ‘Graph_lib::Color::c’ will be initialized after
Graph.h:55: warning: ‘char Graph_lib::Color::v’
Graph.h:48: warning: when initialized here
Graph.h: In constructor ‘Graph_lib::Rectangle::Rectangle(Point, int, int)’:
Graph.h:211: warning: ‘Graph_lib::Rectangle::w’ will be initialized after
Graph.h:210: warning: ‘int Graph_lib::Rectangle::h’
Graph.h:194: warning: when initialized here
Graph.h: In constructor ‘Graph_lib::Rectangle::Rectangle(Point, Point)’:
Graph.h:211: warning: ‘Graph_lib::Rectangle::w’ will be initialized after
Graph.h:210: warning: ‘int Graph_lib::Rectangle::h’
Graph.h:200: warning: when initialized here
In file included from Simple_window.h:10,
from chapter.12.3.cpp:7:
GUI.h: In member function ‘virtual void Graph_lib::Menu::show()’:
GUI.h:107: warning: comparison between signed and unsigned integer expressions
GUI.h: In member function ‘virtual void Graph_lib::Menu::hide()’:
GUI.h:112: warning: comparison between signed and unsigned integer expressions
GUI.h: In member function ‘virtual void Graph_lib::Menu::move(int, int)’:
GUI.h:117: warning: comparison between signed and unsigned integer expressions
Graph.h: In destructor ‘Graph_lib::Vector_ref<T>::~Vector_ref() [with T = Graph_lib::Button]’:
GUI.h:96: instantiated from here
Graph.h:130: warning: comparison between signed and unsigned integer expressions
Undefined symbols for architecture x86_64:
"Simple_window::Simple_window(Point, int, int, String const&)", referenced from:
_main in ccarbqNp.o
"Graph_lib::Polygon::add(Point)", referenced from:
_main in ccarbqNp.o
"Simple_window::wait_for_button()", referenced from:
_main in ccarbqNp.o
"Graph_lib::Shape::Shape()", referenced from:
Graph_lib::Open_polyline::Open_polyline()in ccarbqNp.o
"vtable for Graph_lib::Open_polyline", referenced from:
Graph_lib::Open_polyline::Open_polyline()in ccarbqNp.o
"vtable for Graph_lib::Open_polyline", referenced from:
Graph_lib::Open_polyline::Open_polyline()in ccarbqNp.o
Graph_lib::Open_polyline::~Open_polyline()in ccarbqNp.o
NOTE: a missing vtable usually means the first non-inline virtual member function has no definition.
"vtable for Graph_lib::Closed_polyline", referenced from:
Graph_lib::Closed_polyline::Closed_polyline()in ccarbqNp.o
Graph_lib::Closed_polyline::~Closed_polyline()in ccarbqNp.o
NOTE: a missing vtable usually means the first non-inline virtual member function has no definition.
"vtable for Graph_lib::Polygon", referenced from:
Graph_lib::Polygon::Polygon()in ccarbqNp.o
Graph_lib::Polygon::~Polygon()in ccarbqNp.o
NOTE: a missing vtable usually means the first non-inline virtual member function has no definition.
"vtable for Graph_lib::Shape", referenced from:
Graph_lib::Shape::~Shape()in ccarbqNp.o
NOTE: a missing vtable usually means the first non-inline virtual member function has no definition.
"vtable for Graph_lib::Button", referenced from:
Graph_lib::Button::~Button()in ccarbqNp.o
NOTE: a missing vtable usually means the first non-inline virtual member function has no definition.
"vtable for Graph_lib::Window", referenced from:
Graph_lib::Window::~Window()in ccarbqNp.o
NOTE: a missing vtable usually means the first non-inline virtual member function has no definition.
"Fl_Window::~Fl_Window()", referenced from:
Graph_lib::Window::~Window()in ccarbqNp.o
"Graph_lib::Window::draw()", referenced from:
vtable for Simple_windowin ccarbqNp.o
"Fl_Window::handle(int)", referenced from:
vtable for Simple_windowin ccarbqNp.o
"Fl_Window::resize(int, int, int, int)", referenced from:
vtable for Simple_windowin ccarbqNp.o
"Fl_Window::show()", referenced from:
vtable for Simple_windowin ccarbqNp.o
"Fl_Window::hide()", referenced from:
vtable for Simple_windowin ccarbqNp.o
"Fl_Window::flush()", referenced from:
vtable for Simple_windowin ccarbqNp.o
"typeinfo for Graph_lib::Window", referenced from:
typeinfo for Simple_windowin ccarbqNp.o
ld: symbol(s) not found for architecture x86_64
collect2: ld returned 1 exit status
Compilation exited abnormally with code 1 at Fri Oct 21 12:48:23
it seems as though the library that I'm using libbookgui.a isn't compiled to the proper architecture but I could be incorrect.
when I check what the architecture the lib file is built I get:
/usr/local/lib/libbookgui.a: current ar archive random library