FLTK logo

Re: [fltk.general] incomplete Circle drawn with classes from PPP

FLTK matrix user chat room
(using Element browser app)   FLTK gitter user chat room   GitHub FLTK Project   FLTK News RSS Feed  
  FLTK Apps      FLTK Library      Forums      Links     Login 
 All Forums  |  Back to fltk.general  ]
 
Previous Message ]New Message | Reply ]Next Message ]

Re: incomplete Circle drawn with classes from PPP ken williams Apr 25, 2021  
 
I just tested on a different machine, Manjaro KDE fresh install and FLTK 1.3.5 installed via the package manager and IT WORKED!
The circle was full. I chose to install FLTK because because that's how I know to do it.

I wanted to hurry and post that it works but then I tested FLTK 1.4.x, just to be sure.
I also installed it - but this time the circle is fragmented
So the problem might be with installing it not with the graphics driver. 

Then I come back to my original machine, uninstalled FLTK 1.4.x and planned to use it from the build folder.
But I'm still figuring out Makefiles, because my initial method of compiling doesn't find the build files
Even if I added these links to the VSCode's default.includePath

/run/media/repos/fltk-1.4.x/                        -> has the FL folder
/run/media/repos/fltk-1.4.x/build/             -> has the FL folder with "abi-version.h"
/run/media/repos/fltk-1.4.x/build/lib/       -> has the libs

VSCode's default.includePath, where I have now:

    "C_Cpp.default.includePath": [
        "${workspaceFolder}//**",
        "/usr/include/c++/10.2.0/**",
        "/usr/include/",
        "/usr/lib/",
        "/usr/local/include/",
        "/usr/local/lib/",
        "/run/media/repos/fltk-1.4.x/",
        "/run/media/repos/fltk-1.4.x/build/",
        "/run/media/repos/fltk-1.4.x/build/lib/"
        
But when compiling I get the include errors...


In file included from ../../Graph_lib/Graph.H:9,
                 from ../../Graph_lib/Graph.cpp:1:
../../Graph_lib/fltk.H:4:10: fatal error: FL/Fl.H: No such file or directory
    4 | #include "FL/Fl.H"
      |          ^~~~~~~~~
compilation terminated.
In file included from ../../Graph_lib/Window.H:4,
                 from ../../Graph_lib/Window.cpp:1:
../../Graph_lib/fltk.H:4:10: fatal error: FL/Fl.H: No such file or directory
    4 | #include "FL/Fl.H"
      |          ^~~~~~~~~
      
      

On Saturday, April 24, 2021 at 4:03:02 PM UTC+2 ken williams wrote:
> 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?



--
You received this message because you are subscribed to the Google Groups "fltk.general" group.
To unsubscribe from this group and stop receiving emails from it, send an email to fltkgeneral+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/fltkgeneral/c6022192-9008-416a-9351-a56e4662d621n%40googlegroups.com.
Direct Link to Message ]
 
     
Previous Message ]New Message | Reply ]Next Message ]
 
 

Comments are owned by the poster. All other content is copyright 1998-2024 by Bill Spitzak and others. This project is hosted by The FLTK Team. Please report site problems to 'erco@seriss.com'.