Experiencing complicated issues when trying to compile with X/FreeBSD

I am having some serious problems with the creation of windows in Xlib, as many must know the clang compiler doesn't link to X11/Xlib.h, well that can be circumvented by using gcc, but when I use it instead of clang it always give me symbol errors with the definitions of the functions, structs, etc, anyways code from the Xlib.h file. When I manage to produce an object file and try to link it I can't because of some problem with main in the /usr/bin/ld file. So my question is there is something I'm doing bad?, maybe I'm the one wrong, but if not what are the steps I must take in order to run my programs, please I'm currently stuck, any help will be highly appreciated, if you are willing I will write a book and give you credit ;).
 
First learn to crawl, then to walk. Running comes later.

Clang does not link to anything. It is a compiler. Xlib.h is a header file, you include that and don't link it. There you need to set an include path. And later add a library search path at the link stage, and add the libx11 to the linked libs. First learn how to do these steps and what they mean. Then the rest is easy.
 
Oh thanks, I didn't knew that, sounds complicated, well a screenshot, I just want to find a solution to a problem that I think is not solved with clang as a simple command in the terminal will fail, but gcc is successful, and I will annoy further asking must we do X11, XCB or Wayland?.
ksnip_20240724-203554.png
 
That's because GCC is patched on FreeBSD to search /usr/local/include for headers and /usr/local/lib for libraries by default.
clang does not have that peculiarity, so you have to use -I and -L to add those paths.
 
That's because GCC is patched on FreeBSD to search /usr/local/include for headers and /usr/local/lib for libraries by default.
clang does not have that peculiarity, so you have to use -I and -L to add those paths.
We should patch clang too, because we're misuing a lot.
I prefer XCB over libx11. Performance is smoother but some nice features of libx11 you must do yourself. I've barely touched wayland.
I've been doing some research on drinterface, drmanager, also that package have been added during the installation config, dunno, maybe that's what we should focus.
 
That's because GCC is patched on FreeBSD to search /usr/local/include for headers and /usr/local/lib for libraries by default.
clang does not have that peculiarity, so you have to use -I and -L to add those paths.
Must be patched, we're missing a lot, and somebody else will ask the same question over and over.
I prefer XCB over libx11. Performance is smoother but some nice features of libx11 you must do yourself. I've barely touched wayland.
I think dri and drm is the way to send code to the proprietary hardware, just like 3Dfx did or glide.
 
Must be patched, we're missing a lot, and somebody else will ask the same question over and over.

I think dri and drm is the way to send code to the proprietary hardware, just like 3Dfx did or glide.
No, it needs no patching. You need to add the flags to the makefile, the less magic behind the scenes is done the better.

And before you try to argue about drm and 3Dfx, please read the first reply to this thread. We can help the one who wants to learn, we will not do the learning for you.
 
Back
Top