How to buid X11 small aplications which whoul be "binary crossplatform" at least whithin different FreeBSD wersions. In whoul be preferred to form one executable file. But also acceptable as a set file and additional libraries. (I can whrite an innstallation sh script).
I begin to code in wild unix world. In past I code microcontroller, win32, and sh. Simultaniosly I started C++ learnig.. whith some systematic approach, but my approach of learning the Unix X11 build techiques is anarhytic.
Though the coplilation I perform either if proof of comlecated envirements such as qt4, or by making not clear to me google founded patterns, and mixes of those patterns.
The fact, that the app I have buit whith qt4 in FreeBSD 7.2 dont work in 4.11 FreeBSD (do work - in 8.0) -- I expected. But the opposite fact, that the 4.11 builded application, assebled whith "pure" xlib libraries -- refuse to executes at 7.2 -- sad suprised me
.
Source(first.c)
Build command (It is not quite clear to me what I'm dooint and how I cat do it better)
Binary, i got at 7.2, on 4.11 finaly has posted the message:
Segmentation Fault
same shit if built in 4.11 I tryed to execute in 7.2
What should I use to have binary crossplatform succses in such type of Х11 applications (they must be executable in all X window managers... like blackbox)?
I begin to code in wild unix world. In past I code microcontroller, win32, and sh. Simultaniosly I started C++ learnig.. whith some systematic approach, but my approach of learning the Unix X11 build techiques is anarhytic.
Though the coplilation I perform either if proof of comlecated envirements such as qt4, or by making not clear to me google founded patterns, and mixes of those patterns.
The fact, that the app I have buit whith qt4 in FreeBSD 7.2 dont work in 4.11 FreeBSD (do work - in 8.0) -- I expected. But the opposite fact, that the 4.11 builded application, assebled whith "pure" xlib libraries -- refuse to executes at 7.2 -- sad suprised me

Source(first.c)
Code:
#include <X11/Xlib.h> // Every Xlib program must include this
#include <unistd.h> // So we got the profile for 10 seconds
#define NIL (0) // A name for the void pointer
main()
{
int blackColor = BlackPixel(dpy, DefaultScreen(dpy));
int whiteColor = WhitePixel(dpy, DefaultScreen(dpy));
Display *dpy = XOpenDisplay(NIL);
Window w = XCreateWindow(dpy, DefaultRootWindow(dpy), 0, 0,
200, 100, 0,
CopyFromParent, CopyFromParent, CopyFromParent,
NIL, 0);
XMapWindow(dpy, w);
XFlush(dpy);
sleep(10);
}
Code:
ÑÑ -o -first.aut first.c -lX11 -L/usr/X6R11/lib -I /usr/X6R11/include
Segmentation Fault
same shit if built in 4.11 I tryed to execute in 7.2
What should I use to have binary crossplatform succses in such type of Х11 applications (they must be executable in all X window managers... like blackbox)?