This is my first post so I'll try to make it brief
I am currently on chapter 12 of Stroustrup's PPP book, I installed FLTK as they did on this youtube video https://www.youtube.com/watch?v=0eSOPWQ1n6U
Downloaded the header files from Stroustrup's website already and I am trying to make the first example exercise with the GUI where you make a red triangle
code:
#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
}
I have been trying for days different things but I keep getting hit to a wall, this is the error I am getting from the code now after installing everything I know of
1>------ Build started: Project: hello world5, Configuration: Debug Win32 ------
1> main.cpp
1>c:\users\kenzo\onedrive\documentos\visual studio 2015\gui.h(107): warning C4018: '<': signed/unsigned mismatch
1>c:\users\kenzo\onedrive\documentos\visual studio 2015\gui.h(112): warning C4018: '<': signed/unsigned mismatch
1>c:\users\kenzo\onedrive\documentos\visual studio 2015\gui.h(117): warning C4018: '<': signed/unsigned mismatch
1>c:\users\kenzo\onedrive\documentos\visual studio 2015\simple_window.h(13): error C2440: '<function-style-cast>': cannot convert from 'initializer list' to 'Graph_lib::Point'
1> c:\users\kenzo\onedrive\documentos\visual studio 2015\simple_window.h(13): note: No constructor could take the source type, or constructor overload resolution was ambiguous
1>c:\users\kenzo\onedrive\documentos\visual studio 2015\simple_window.h(13): error C2661: 'Graph_lib::Button::Button': no overloaded function takes 4 arguments
1>c:\users\kenzo\onedrive\documentos\visual studio 2015\projects\hello world5\hello world5\main.cpp(9): error C2440: 'initializing': cannot convert from 'initializer list' to 'Graph_lib::Point'
1> c:\users\kenzo\onedrive\documentos\visual studio 2015\projects\hello world5\hello world5\main.cpp(9): note: No constructor could take the source type, or constructor overload resolution was ambiguous
1>c:\users\kenzo\onedrive\documentos\visual studio 2015\projects\hello world5\hello world5\main.cpp(12): error C2872: 'Polygon': ambiguous symbol
1> c:\program files (x86)\windows kits\8.1\include\um\wingdi.h(4997): note: could be 'BOOL Polygon(HDC,const POINT *,int)'
1> c:\users\kenzo\onedrive\documentos\visual studio 2015\graph.h(230): note: or 'Graph_lib::Polygon'
1>c:\users\kenzo\onedrive\documentos\visual studio 2015\projects\hello world5\hello world5\main.cpp(12): error C2146: syntax error: missing ';' before identifier 'poly'
1>c:\users\kenzo\onedrive\documentos\visual studio 2015\projects\hello world5\hello world5\main.cpp(12): warning C4551: function call missing argument list
1>c:\users\kenzo\onedrive\documentos\visual studio 2015\projects\hello world5\hello world5\main.cpp(12): error C2065: 'poly': undeclared identifier
1>c:\users\kenzo\onedrive\documentos\visual studio 2015\projects\hello world5\hello world5\main.cpp(14): error C2065: 'poly': undeclared identifier
1>c:\users\kenzo\onedrive\documentos\visual studio 2015\projects\hello world5\hello world5\main.cpp(14): error C2228: left of '.add' must have class/struct/union
1> c:\users\kenzo\onedrive\documentos\visual studio 2015\projects\hello world5\hello world5\main.cpp(14): note: type is 'unknown-type'
1>c:\users\kenzo\onedrive\documentos\visual studio 2015\projects\hello world5\hello world5\main.cpp(14): error C2440: '<function-style-cast>': cannot convert from 'initializer list' to 'Graph_lib::Point'
1> c:\users\kenzo\onedrive\documentos\visual studio 2015\projects\hello world5\hello world5\main.cpp(14): note: No constructor could take the source type, or constructor overload resolution was ambiguous
1>c:\users\kenzo\onedrive\documentos\visual studio 2015\projects\hello world5\hello world5\main.cpp(15): error C2065: 'poly': undeclared identifier
1>c:\users\kenzo\onedrive\documentos\visual studio 2015\projects\hello world5\hello world5\main.cpp(15): error C2228: left of '.add' must have class/struct/union
1> c:\users\kenzo\onedrive\documentos\visual studio 2015\projects\hello world5\hello world5\main.cpp(15): note: type is 'unknown-type'
1>c:\users\kenzo\onedrive\documentos\visual studio 2015\projects\hello world5\hello world5\main.cpp(15): error C2440: '<function-style-cast>': cannot convert from 'initializer list' to 'Graph_lib::Point'
1> c:\users\kenzo\onedrive\documentos\visual studio 2015\projects\hello world5\hello world5\main.cpp(15): note: No constructor could take the source type, or constructor overload resolution was ambiguous
1>c:\users\kenzo\onedrive\documentos\visual studio 2015\projects\hello world5\hello world5\main.cpp(16): error C2065: 'poly': undeclared identifier
1>c:\users\kenzo\onedrive\documentos\visual studio 2015\projects\hello world5\hello world5\main.cpp(16): error C2228: left of '.add' must have class/struct/union
1> c:\users\kenzo\onedrive\documentos\visual studio 2015\projects\hello world5\hello world5\main.cpp(16): note: type is 'unknown-type'
1>c:\users\kenzo\onedrive\documentos\visual studio 2015\projects\hello world5\hello world5\main.cpp(16): error C2440: '<function-style-cast>': cannot convert from 'initializer list' to 'Graph_lib::Point'
1> c:\users\kenzo\onedrive\documentos\visual studio 2015\projects\hello world5\hello world5\main.cpp(16): note: No constructor could take the source type, or constructor overload resolution was ambiguous
1>c:\users\kenzo\onedrive\documentos\visual studio 2015\projects\hello world5\hello world5\main.cpp(17): error C2065: 'poly': undeclared identifier
1>c:\users\kenzo\onedrive\documentos\visual studio 2015\projects\hello world5\hello world5\main.cpp(17): error C2228: left of '.set_color' must have class/struct/union
1> c:\users\kenzo\onedrive\documentos\visual studio 2015\projects\hello world5\hello world5\main.cpp(17): note: type is 'unknown-type'
1>c:\users\kenzo\onedrive\documentos\visual studio 2015\projects\hello world5\hello world5\main.cpp(19): error C2065: 'poly': undeclared identifier
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
Please what shall I do? To be honest i was really looking forward to be messing around with graphic stuff after the first half of the book being so intense and serious
kind regards,
Kenzo