Having Trouble Compiling GUI Example Code PPP2

I tried to compile GUI example code listing from Chapter 12, Section 12.3. Showing the output from the Build attempt will make the post go over the maximum number of allowed characters, so I'll try to post it in another post.

For now, here's the code I tried to compile:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
// 12_3_gui_example1.cpp : Defines the entry point for the console application.
// Osman Zakir
// 3 / 16 / 2017
// Bjarne Stroustrup: Programming: Principles and Practice Using C++ 2nd Edition
// Chapter 12 Section 12.3
// First GUI Example Code Listing

#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

	Graph_lib::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 did get the example code from the support website for the book, but yeah.

Edit: I got a whole bunch of errors and warnings. Not so many that it would say so and end the process prematurely like it does when there are too many errors, but still. I can't post them without making the post too long, even in a new post and taking out the extra information that isn't needed.

Anyway, someone please help me. I really want to get this compiled.

Edit2: Okay, I think I'll post the first three warnings and the first error that I have:

1>c:\users\osman\programming\projects\programming_principles_practice_using_c++\12_3_gui_example1\12_3_gui_example1\packages\fltk.1.3.3.33\build\native\include\fl\fl_widget.h(576): warning C4312: 'type cast': conversion from 'long' to 'void *' of greater size
1>c:\users\osman\programming\projects\programming_principles_practice_using_c++\12_3_gui_example1\12_3_gui_example1\packages\fltk.1.3.3.33\build\native\include\fl\fl_widget.h(598): warning C4312: 'type cast': conversion from 'long' to 'void *' of greater size
1>c:\users\osman\programming\projects\programming_principles_practice_using_c++\12_3_gui_example1\12_3_gui_example1\packages\fltk.1.3.3.33\build\native\include\fl\fl_widget.h(848): warning C4312: 'type cast': conversion from 'long' to 'void *' of greater size
1>c:\users\osman\programming\projects\programming_principles_practice_using_c++\graph.h(88): error C2059: syntax error: '<'


I'll post the other stuff as needed later when asked. And I'll post the other code, like from the header files, in other posts, as well.
Last edited on
Topic archived. No new replies allowed.