Re: want to compile an example code.
Alan Coopersmith <[email protected]> Sun, 4 Oct 2020 13:52:58 -0700
| Newsgroups | gmane.comp.freedesktop.xcb |
|---|---|
| Message-ID | <[email protected]> |
On 10/4/20 12:38 PM, Hans Schüren wrote: > Hello, > > i want to compile a sample code from the XCB manual. > > There are the following errors. What can i do ? > > I use FreeBSD and have XCB installed. > > barchart.c Motif/ xcbsample.c > nomad@NomadBSD ~/programmieren> gcc -Wall xcbsample.c -o xcbsample pkg-config > --cflags --libs xcb > fish: Unknown command: gcc > nomad@NomadBSD ~/programmieren [127]> cc -Wall xcbsample.c -o xcbsample > pkg-config --cflags --libs xcb > cc: error: unsupported option '--cflags' > cc: error: unsupported option '--libs' > cc: error: no such file or directory: 'pkg-config' > cc: error: no such file or directory: 'xcb' You need to put $( ) or ` ` around the pkg-config command so that the output of the pkg-config command is used as flags to the compiler: cc -Wall xcbsample.c -o xcbsample $(pkg-config --cflags --libs xcb) or cc -Wall xcbsample.c -o xcbsample `pkg-config --cflags --libs xcb` (It depends on what shell you use - the first is preferred for most shells, but some old shells like csh may require the second form.) -- -Alan Coopersmith- [email protected] Oracle Solaris Engineering - https://blogs.oracle.com/alanc _______________________________________________ Xcb mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/xcb