очень может быть)
а как слинковать?
Пользователь решил продолжить мысль [time]10 Апрель 2015, 17:53:51[/time]:
вот!)
andreykapas@Andrew-pc:~$ g++ /home/andreykapas/fl_test/hello.cpp -L/usr/local/lib -lfltk -lXext -lX11 -lm
и всё заработало!)
Пользователь решил продолжить мысль [time]10 Апрель 2015, 18:25:44[/time]:
спасибо за помощь!
Но fltk я установил, Чтобы Страуструпа "Принципы и практику..." пробовать, так вот:
создал папку: /home/andreykapas/Strsustr/str12_3
в неё положил файлы из сорса книги: Graph.h, Simple_Window.h и т.д. ...
код:
//
// This is example code from Chapter 12.3 "A first example" of
// "Programming -- Principles and Practice Using C++" by Bjarne Stroustrup
//
#include "Simple_window.h" // get access to our window library
#include "Graph.h" // get access to our graphics library facilities
//------------------------------------------------------------------------------
int main()
{
using namespace Graph_lib; // our graphics facilities are in Graph_lib
Point tl(100,100); // to become top left corner of window
Simple_window win(tl,600,400,"Canvas"); // make a simple window
Polygon poly; // make a shape (a polygon)
poly.add(Point(300,200)); // add a point
poly.add(Point(350,100)); // add another point
poly.add(Point(400,200)); // add a third point
poly.set_color(Color::red); // adjust properties of poly
win.attach (poly); // connect poly to the window
win.wait_for_button(); // give control to the display engine
}
//------------------------------------------------------------------------------
И вот:
andreykapas@Andrew-pc:~$ g++ ./Strsustr/str12_3/chapter.12.3.cpp -L/usr/local/lib -lfltk -lXtext -lX11 -lm -o ./Strsustr/str12_3/first
In file included from /usr/include/c++/4.8/ext/hash_map:60:0,
from ./Strsustr/str12_3/std_lib_facilities.h:34,
from ./Strsustr/str12_3/Window.h:12,
from ./Strsustr/str12_3/GUI.h:10,
from ./Strsustr/str12_3/Simple_window.h:10,
from ./Strsustr/str12_3/chapter.12.3.cpp:7:
/usr/include/c++/4.8/backward/backward_warning.h:32:2: warning: #warning This file includes at least one deprecated or antiquated header which may be removed without further notice at a future date. Please use a non-deprecated interface with equivalent functionality instead. For a listing of replacement headers and interfaces, consult the file backward_warning.h. To disable this warning use -Wno-deprecated. [-Wcpp]
#warning \
^
In file included from ./Strsustr/str12_3/chapter.12.3.cpp:7:0:
./Strsustr/str12_3/Simple_window.h:17:24: error: reference to ‘Window’ is ambiguous
struct Simple_window : Window {
^
In file included from /usr/include/FL/Xutf8.h:24:0,
from /usr/include/FL/fl_utf8.h:64,
from /usr/include/FL/Fl.H:30,
from ./Strsustr/str12_3/Window.h:10,
from ./Strsustr/str12_3/GUI.h:10,
from ./Strsustr/str12_3/Simple_window.h:10,
from ./Strsustr/str12_3/chapter.12.3.cpp:7:
/usr/include/X11/X.h:96:13: note: candidates are: typedef XID Window
typedef XID Window;
^
In file included from ./Strsustr/str12_3/GUI.h:10:0,
from ./Strsustr/str12_3/Simple_window.h:10,
from ./Strsustr/str12_3/chapter.12.3.cpp:7:
./Strsustr/str12_3/Window.h:22:11: note: class Graph_lib::Window
class Window : public Fl_Window {
^
./Strsustr/str12_3/chapter.12.3.cpp: In function ‘int main()’:
./Strsustr/str12_3/chapter.12.3.cpp:28:9: error: ‘struct Simple_window’ has no member named ‘attach’
win.attach (poly); // connect poly to the window
как быть?