> OK - so it sounds like it is the GPU driver bug then. Do you have another machines (with a different GPU!) that you could try things out on too?
yes, I have another machine, it would take me a while install Linux with dual boot on it, but I will test it.
> What sort of things are you trying to do?
The PPP book has 27 chapters, each chapter has ~ 20 exercises.
I have 27 folders, one for each chapter
and inside each folder I have the exercises for that chapter
for ex: 13.3_lines.cpp, 13.12_circle.cpp and so on.
And I have a separate folder with Dr.S library, to be used by all exercises.
(.o files I think they should be created inside this separate folder, next to the source files or in a subfolder)
I'm thinking to have only one Makefile for each chapter, where I would add the build commands for each exercise.
and run "make 13.12_circle.bin" to build the executable to the exercise 13.12
and "make 13.13_xxx.bin" for exercise 13.13 and so on.
Here's my Makefile when all the files are in the same folder (13.12_circle.cpp and Graph_lib files).
Thank you all again for your help!
Feels good to move forward :)
################ template makefile ##############
# We don't know what compiler to use to build fltk on this machine - but fltk-config does...
CXX = $(shell fltk-config --cxx)
# Set the flags for compiler: fltk-config knows the basic settings, then we can add our own...
CXXFLAGS = $(shell fltk-config --cxxflags) -w -Wall -std=c++14 -O3 -I/other/include/paths...
# We don't know what libraries to link with: fltk-config does...
LINKFLTK = $(shell fltk-config --ldstaticflags)
LINKFLTK_GL = $(shell fltk-config --use-gl --ldstaticflags)
LINKFLTK_IMG = $(shell fltk-config --use-images --ldstaticflags)
# Define what your target application is called
all: 13.12_circle.bin
# Define how to build the various object files...
Graph.o: Graph.cpp Graph.H
$(CXX) -c $< $(CXXFLAGS)
Window.o: Window.cpp Window.H
$(CXX) -c $< $(CXXFLAGS)
GUI.o: GUI.cpp GUI.H
$(CXX) -c $< $(CXXFLAGS)
Simple_window.o: Simple_window.cpp Simple_window.H
$(CXX) -c $< $(CXXFLAGS)
13.12_circle.o: 13.12_circle.cpp
$(CXX) -c $< $(CXXFLAGS)
# Now define how to link the final app - let's assume it needs image and OpenGL support
13.12_circle.bin: Graph.o Window.o GUI.o Simple_window.o 13.12_circle.o
$(CXX) -o $@ Graph.o Window.o GUI.o Simple_window.o 13.12_circle.o $(LINKFLTK) $(LINKFLTK_GL) $(LINKFLTK_IMG)
clean:
rm -rf *.o
############### end #################
On Friday, April 23, 2021 at 10:59:38 PM UTC+2 Ian MacArthur wrote:
On 23 Apr 2021, at 18:46, ken williams wrote:
>
> I added Albrecht's code and with width 0 I still have incomplete circles but with width 1 they are full !
OK - so it sounds like it is the GPU driver bug then. Do you have another machines (with a different GPU!) that you could try things out on too?
> With 2 the line is just wider indeed.
> See attach.
> And it solves the problem for both PPP code and Kevin's code.
> Thanks Albrecht!
>
> That means my FLTK install (1.4.x from Git) is ok?
Yes, probably.
> Indeed I uninstalled the tarball 1.4.x before installing the Git version.
OK - FWIW, I never bother to actually *install* fltk at all, I just build it and leave it in the build tree: it works perfectly well like that, and means it never clashes with any system libs the machine might have.
(It also means I can have a half-dozen different fltk variants on the go for testing, too, which is handy, but maybe not something you’d need just now!)
>
> And I managed to create a Makefile and it works.
> Thanks Ian for the link and Greg for the detailed explanation!
Makefiles are a very ancient and somewhat arcane syntax, but they do make a lot of things easier once you get the knack of them!
>
> Now I try to figure out how to do the Makefile if the files are in different folders.
> Is VPATH useful for this?
VPATH (or vpath - the different case means something subtly different, in some make variants; see what I mean about arcane syntax...) can help, but if it's a simple thing, and you *know* the path to the files or folders, it is often simpler to just path things explicitly.
What sort of things are you trying to do?