I'm trying to locate ports of some of the more popular Unix/Linux utilities to other operating systems such as AIX and Windows. I find it helpful to have the same utility on all the systems I work on, not just on a few them.

Are you searching for other programs of this nature or creating other cross-platform utilities of your own? If so, please share your progress. It would be nice to add more options to this list.

cal
http://unicorn.us.com/cal.html

lsof for AIX
https://github.com/aixoss/lsof

top for Unix and AIX systems
https://sourceforge.net/projects/unixtop/

ntop for Windows
https://github.com/gsass1/NTop

lsblk like utility for Windows
https://github.com/tenox7/lsblk

simple cross-platform ping
https://github.com/sryze/ping

ps style tools for Windows
https://github.com/joeattardi/winpstools
https://github.com/katakk/pkill/

uptime
https://github.com/qwercik/uptime

experimental dd implementation for Windows
https://github.com/sryze/wdd

dd for Windows
http://www.chrysocome.net/dd

busybox-w32 has ports of several utilities that will work on Windows including dd, df, grep, ps, su and others:
https://github.com/rmyorston/busybox-w32

nano for Windows
https://github.com/lhmouse/nano-win
I also have a port of nano for Windows. It works with PDCurses.

An older version of htop was patched for AIX support and I've added a similar patch to a later version. When the htop project was contacted regarding patches they responded they were not interested in adding AIX support to the official version.

I have simple cross-platform implementations of uptime, nproc and free which I've been working on.
While I have other lists that cover a variety topics, wanted one that just had useful lightweight C programs, utilities and libraries. So, I'll be repeating some links here. However, I hope to add some new projects as well. I'd also be interested in hearing suggestions that fit the criteria of lightweight, cross-platform C projects. If you're aware of any I've left off this list, please let me know.

bard
Ebook reader with text-to-speech support using SDL and flite. I have some patches for this program to improve portability and support using SDL2.
https://github.com/festvox/bard

BearSSL
Rather secure implementation of the SSL/TLS protocol. Can be used with curl.
https://bearssl.org/

cal
Command line calendar.
http://unicorn.us.com/cal.html

cDetect
C based alternative to GNU configure/autoconf. More info at IngwiePhoenix's cDetect project ( https://github.com/IngwiePhoenix/cDetect ). Plus, I've forked the project and use it with many of my builds from source code. I've added support for cross-compiling and many, many other features. Contact me if you'd like a copy.
http://cdetect.sourceforge.net/

csvutils
CSV command utilities. Uses libcsv.
https://github.com/rgamble/csvutils

curl
Command line data transfer tool.
https://curl.se/

diction and style
Analyze documents for readability and other metrics. Find grammatical issues.
https://www.gnu.org/software/diction/

diff
diff implementation for sbase. Check the follow-up mailing list threads for further patches.
https://lists.suckless.org/dev/1601/28247.html

diffh
Works with diff and creates an easy to read display of differences between files.
https://sourceforge.net/projects/diffh/

dr_libs
Single file header audio decoding libraries.
https://github.com/mackron/dr_libs

easylzma
Public domain compression and extraction library for lzma.
https://github.com/lloyd/easylzma/tree/master

fcurl
Library to simplify working with curl.
https://github.com/curl/fcurl

BSD gettext
Older BSD gettext/libintl implementation. I have a fork of this one as well. Also, check out the BSD Citrus Project.
https://www.mmnt.net/db/0/18/ftp.khstu.ru/pub/unix/distfiles

gifsicle
GIF animator utility.
http://www.lcdf.org/gifsicle/

grafx2
Graphics editor.
http://grafx2.chez.com/

BSD gzip
BSD version of the gzip compression/decompression program. There are various forks to port this to operating systems other than BSD. I have a portable fork as well.
https://github.com/NetBSD/src/tree/trunk/usr.bin/gzip

less
Less is more than more, pager program.
https://www.greenwoodsoftware.com/less/

libcsv
ANSI C library to read and write CSV files.
https://github.com/rgamble/libcsv

libgrapheme
C99 Unicode library including encoding, decoding and line-break functionality.
https://libs.suckless.org/libgrapheme/

liblzw
Library for LZW (.Z) compression/decompression.
http://freestdf.sourceforge.net/liblzw.php

libtomcrypt
Public Domain cryptography library.
https://github.com/libtom/libtomcrypt

libutf
C89 UTF-8 library which includes an API compatible with Plan 9's libutf plus a number of improvements.
https://github.com/cls/libutf

lxsplit
Command line file split/join tool.
http://lxsplit.sourceforge.net/

man
C program to view standard man pages. Now part of Elks (elkscmd/sys_utils).
https://github.com/jbruchon/elks/blob/1b6110b73fbb123021a5a29b05d8fa9caef33235/elkscmd/sys_utils/man.c
https://github.com/rofl0r/hardcore-utils/blob/master/man.c

mandoc
BSD version of man page utilities. Uses their manpage format. Includes tools to convert to manpage format used by most man tools.
http://mandoc.bsd.lv/
https://embedeo.org/ws/doc/man_windows/

minicpio
Mini cpio compression and decompression routines.
https://github.com/rayae/minicpio

minizip library
A zip library for zlib. Useful when working with files in zip format. Code is in the contrib section of zlib.
http://zlib.net/

nanosvg
Lightweight SVG library.
https://github.com/memononen/nanosvg

ncurses hexedit
Curses based hex editor.
http://www.rogoyski.com/adam/programs/hexedit/

nemini
Lightweight SDL2 based Gemini client.
https://github.com/neonmoe/nemini

BSD patch
BSD fork of the patch program. I have a fork of this as well with some portability additions to better handle carriage return/line feed issues.
https://github.com/openbsd/src/tree/master/usr.bin/patch

pdfconcat
Concatenates PDF files.
https://github.com/pts/pdfconcat

pdftxt
Convert PDF to text. Helpful for searching PDFs with grep.
https://litcave.rudi.ir/

pdlzip
Compression/decompression for lzma format compatible with the lzip data compressor.
https://www.nongnu.org/lzip/pdlzip.html

picaxo
Graphics viewer.
http://gigi.nullneuron.net/comp/picaxo/

pkgconf
Drop in replacement for pkg-config with no circular dependencies.
https://github.com/pkgconf/pkgconf

pspg
Postgres pager provides a console based pager for PostgreSQL, MySQL, CSV and other formats. Uses ncurses (or pdcurses).
https://github.com/okbob/pspg

sbase
Efficient implementations of core base utilities.
https://core.suckless.org/sbase/

shot
Command line screenshot program.
https://github.com/rr-/shot/

sox
Sound exchange utility. Converts sound formats. Plays audio files.
http://sox.sourceforge.net/

stb
Public Domain single file header libraries. Includes stb_truetype.h, a lightweight alternative to the freetype library, which can parse, decode and rasterize characters from truetype fonts.
https://github.com/nothings/stb

TinyLZMA
Minimal LZMA compressor and decompressor.
https://github.com/WangXuan95/TinyLZMA

unarr
Decompression library for rar and other formats. Part of sumatrapdf project.
https://github.com/sumatrapdfreader/sumatrapdf/tree/master/ext/unarr
Standalone version of unarr.
https://github.com/selmf/unarr

x509cert
Generate x509 certificate requests. Works with BearSSL.
https://github.com/michaelforney/x509cert

Raylib

Jan. 20th, 2022 02:21 pm
I've covered programs designed with lightweight GUIs and text user interface libraries such as SDL, FLTK and pdcurses in previous posts. Another interesting and promising cross-platform lightweight screen library is raylib. There's a GUI for it called raygui. There's even a cross-platform audio library called raudio. Programs written with raylib have been ported to several computers including Linux, Windows and Mac. It can be used to write programs for mobile devices. The audio library works on multiple platforms including mobile devices as well.

You can find raylib and several helpful libraries you can use with it at:
https://github.com/raysan5

I haven't had a chance to check out many of the programs that are built with raylib. However, you can find a group of example games at:
https://github.com/raysan5/raylib-games
I've been trying to find a decent jigsaw puzzle game written in C. There is a photo puzzle game for raylib at:
https://github.com/klaytonkowalski/game-photo-puzzle

There's also an experimental GUI editor here:
https://github.com/Demizdor/experimental-raygui-editor

I'll add other interesting raylib examples as I find them. Feel free to share you're own as well.

FLOSS Finds

Nov. 1st, 2021 11:44 am
This is a list of some of the interesting FLOSS related C/C++ libraries and programs I've been finding more recently that may not fit under other categories in my software lists. As usual, I prefer cross-platform options that work on a variety of platforms.

Cross-platform screenshot program and library:
https://github.com/rr-/shot/

I've run across some interesting games that I've never bothered to try to build or had to build without the sound because they use a non-Free audio library. FLESSD replaces that option with a compatible API.
https://github.com/darealshinji/flessd

I typically avoid GTK+ libraries. I even removed references to any GTK+ libraries in my forked version of sdcv. However, this looks like an interesting alternative if you're stuck with a program that requires functionality from glib:
https://github.com/iglunix/glibr

Know of some other useful libraries or programs that might aid in building or porting software? Have other FLOSS suggestions? Please let me know about them.
I do a lot of Open Source development just for me. Basically, it's the philosophy of scratching an itch. If there's something I want and no one's working on it, I work on it on my own. True to Open Source philosophy, if I want something done, I do it myself. I typically assume not many other people will be interested in what I'm interested in anyway.

However, it is nice to have a community. It's helpful to have other developers to discuss designs with or other users to test out new programs or people to help find new and interesting code and resources to explore. I've asked before in various places, but I'm going to ask again here and now. If anyone knows of a FLOSS project in need of volunteers, please share information about it with me. I'd be happy to add them to my list of FLOSS projects looking for volunteers. I also really want to find a project that's a good fit with my own goals and donate some of my time and expertise.

I work a lot with lightweight, cross-platform FLOSS applications and build them from source, modify them, fix bugs, add features, etc. I've ported applications to a wide variety of platforms including more unusual operating systems. I would love to get involved with a small Linux or BSD distribution or even an original or unusual operating system and port and/or build some programs for it. I also use Windows a lot and would be happy to help out a Windows or DOS project that's involved in building FLOSS applications. I have a lot of experience porting FLOSS programs to operating systems like these. I do have my own build system/package management tools and I'm not interested in switching to another system at this time. I also have my own preferences as to which libraries I use when building applications. At this time, I'm working primarily with C and occasionally with C++. It would be fun to get involved with others interested in making their own distribution or putting together FLOSS applications to share with people.

So, if you know of a project that might need help or have a project you're working on that's in need of volunteers, please let me know. If you just want to compare notes on lightweight and/or cross-platform portable software or you want to talk about C programming in general, feel free to contact me. More contact information available here: http://www.distasis.com/connect.htm
Here are some interesting articles and tips related to the C preprocessor and to creating makefiles.


This shows how to print the value of a macro:
http://c-faq.com/ansi/stringize.html

How to use static patterns with makefiles:
https://www.gnu.org/software/make/manual/make.html#Static-Pattern


Preprocessor tips:
The second article shows how to check which include files are used by a C or C++ file.

https://mischasan.wordpress.com/2013/04/07/the-c-preprocessor-not-as-cryptic-as-youd-think/
https://mischasan.wordpress.com/2011/06/14/stupid-gcc-trick-2-finding-all-included-files-recursively/
https://mischasan.wordpress.com/2011/10/12/stupid-gcc-trick-3-list-all-built-in-gcc-define-symbols/


Make tips:
The first article has a great tip for creating directories in makfiles using "%/..:".

https://mischasan.wordpress.com/2012/07/05/two-more-cheap-gmake-tricks-creating-directories-and-printing-variables/
https://mischasan.wordpress.com/2015/03/09/gmake-cheap-trick-3/
https://mischasan.wordpress.com/2015/03/21/gmake-cheap-trick-4-for-non-recursive-make/

To see what commands make will run when invoked, you can use:
make --just-print


Nonrecursive makefile tips:

https://mischasan.wordpress.com/2013/03/30/non-recursive-make-gmake-part-1-the-basic-gnumakefile-layouts/
https://mischasan.wordpress.com/2013/03/30/non-recursive-make-gmake-part-2-rules-mk/
https://mischasan.wordpress.com/2013/04/13/non-recursive-make-part-3-a-tool-for-the-fearless/


Replacing other utilities with sed:

In case you need these in a makefile, build script or elsewhere and don't have them on your system:

https://github.com/aureliojargas/sed.sf.net/blob/master/local/docs/emulating_unix.txt


Miscellaneous compiler tips:

To stop the gnu gcc compiler after the first error use:
-Wfatal-errors

To stop the gnu gcc compiler after the N errors use:
-fmax-errors=N
So for three errors add the following to the command line when invoking gcc:
-fmax-errors=3


My favorite preprocessor tips:

You can use a C preprocessor to generate templates.
Here's an example to generate web pages using the preprocessor and templates:
http://www.distasis.com/cpp/mingw.htm#makeprograms

For my build system, I need a more functionality than the standard C preprocessor could offer.
Rather than reinventing the wheel and writing my own preprocessor, I found gpp has just enough capabilities beyond a standard preprocessor to handle the task.
The gpp preprocessor is available from:
https://logological.org/gpp


Know of some other preprocessor or makefile tips? Have written an article or blog post with your tips on these topics? Please share them. They may get included in this list.
Was recently commenting on a forum about how few Open Source alternatives there are for Android devices. The Free Software Foundation even had a wiki page about how development for mobile devices was a priority. However, when I wrote to them on the subject, they didn't bother to acknowledge or answer my e-mail (until just recently, two years later).

There are some good Open Source projects out there for Android. However, many commercial apps and even the Open Source applications appear to be trying to reinvent the wheel. They're redeveloping concepts that have already been done in other languages and with other build systems. Worse yet, they're making a lot of the same programming mistakes of earlier projects without learning from them.

I truly believe that taste varies widely as far as what people like in a program or application. To one person, an expensive commercial office suite or graphics program is a highly necessary tool. To someone else, it's too complicated and tries to do too much at once. What one person feels is a compelling, action-packed and exciting video game can be boring and mindless to another person. With that said, I'm sure my taste in programs does not match what many others are looking for. Personally, I do find the Open Source applications I ported from other operating systems to Android to be among my favorite Android apps. I'd love to find to locate other projects that are working on similar ports of popular Open Source applications.

Since I'm primarily interested in C/C++ development at this time and I've always been an advocate of cross-platform programming, I've been searching for good references and examples of C/C++ application development for Android that do not lock the developer into using a specific IDE or build system. Most books on Android development are for Java or Kotlin. There are even a good number that use web apps or web development languages likes JavaScript/HTML/CSS including projects like PhoneGap, ReactNative, NativeScript, etc.

There are very few books on NDK development for Android. All of the books I've found so far detail development with Android Studio (or Eclipse for older books that have not been updated in a while). SDL is typically mentioned with NDK development even though there are other development libraries that work with Android. Some don't mention libraries like SDL at all, but then you're limited to examples similar to those provided by Google or very basic applications. There are a few interesting articles on porting applications from other operating systems to mobile devices, but I've found no books that specialize or give much in the way of advice in this area.

I've been considering writing an e-book that fills in the gaps and gives examples of how to develop cross-platform applications that easily port to Android and use NDK plus a more a standard tool-chain. The only thing holding me back is the idea that there would probably be very few developers other than myself interested in this sort of thing. Obviously groups like the FSF weren't interested or they would have taken the time to answer an e-mail. If there is interest from other developers on sharing this type of information, please let me know.

I mentioned on a forum how much I'd like to see a list of available Open Source applications for Android (preferably cross-platform portable applications written in languages other than Java). It would be nice to see what others have done and get ideas for development based on them. Since I really haven't been able to find a resource like that, I'm putting together the start of such a resource here:

C/C++ SDL based apps ported to Android:
https://github.com/pelya/commandergenius
https://sourceforge.net/projects/libsdl-android/files/apk/
Terminal emulator in Java and cli and ncurses based applications ported from other systems:
https://github.com/termux/termux-packages/tree/master/packages
VLC for Android:
https://www.videolan.org/vlc/download-android.html
List of Open Source Android applications. Includes information on language the program was written in. While there aren't a lot of C/C++ applications listed there are some:
https://github.com/pcqpcq/open-source-android-apps
Similar list for iOS Apps:
https://github.com/dkhamsing/open-source-ios-apps
Another list of Open Source applications (unfortunately no indication of the languages they were written in or the build systems required):
https://en.wikipedia.org/wiki/List_of_free_and_open-source_Android_applications
Project for mobile devices (mainly Qt based):
https://ubports.com/
Repository and app store for Open Source apps (mainly Java apps):
https://f-droid.org/en/about/
CrystaX NDK provides and alternative to Google's NDK:
https://www.crystax.net/android/ndk

If you know of other Open Source C/C++ software for Android, please advise and I'll add it to the list.


Here are a couple of interesting articles on Android. The first is a list of alternatives to Google's online app store for Android:
https://android.izzysoft.de/articles/named/android_markets_safe_to_use
The next article is about how to make Android a little more Open Source friendly by stripping it of some of the more proprietary apps:
https://android.izzysoft.de/articles/named/android-without-google-5

Another site with information on removing proprietary libraries from Android devices:
https://microg.org/
Programmers that use other languages tend to think C and C++ don't have a lot of library or module support to help develop applications. While these languages don't have a lot of built-in support for a wide variety of functionality and they don't have an official way to add packages, modules, libraries or other forms of additional code, they still have a wide selection of third party code and libraries you can use to help perform tasks faster.

I personally prefer that C has a minimal library and you don't have to memorize a lot of functionality to get it running. I also like the fact that C/C++ lets you choose options for yourself instead of forcing you to use them. For instance, someone may want to use garbage collection and not deal with memory management. If so, there are libraries out there that can do it for you. However, when I want to write something that runs fast, I'd prefer to do my own memory management. Also, most of those higher level languages that programmers are so enthusiastic about because they have libraries to make tasks easier are usually written in C/C++. Some of the high performance libraries these languages use or the functionality that needs to access operating system related functions (like file management) typically use C/C++ code underneath. For instance, higher level languages that support Internet access are probably using a C library such as curl behind the scenes.

Not having an official version of some functionality that's part of a standard library can make it hard to figure out how best to add that functionality to a project. While there are tons of libraries available for C, not having a language specific way to easily add them as packages can make it confusing as to what use. There is an interesting development in C/C++ programming that's attempting to fill the gap. Several developers are coming up with lightweight and, in some cases, single file or single header libraries with lenient licensing that can easily be added to a project. I'll mention some of those options. If there are others you find useful, please let me know about them so they can be added to the list.

There is a lightweight package manager for C/C++ called clib that makes it easier to find and incorporate lightweight libraries in your projects. It includes a list of available packages:
https://github.com/clibs/clib/wiki/Packages

CCAN is another collection of C snippets similar to the CPAN collection:
http://ccodearchive.net/list.html

Snippets has been around a long time. It has short snippets of code that give examples on how to do things in C/C++. It's a useful resource.
https://github.com/vonj/snippets.org

Libraries that use Unlicense, CC0, BSD 0 clause (or other similar licenses) or code that is in the public domain is very easy to incorporate into projects. You don't have to worry about whether you've given proper credit in your program or provided the proper license information along with your own application. The Unlicense site has a nice list of source code you can use by itself or incorporate in your own projects. Some of the code listed is written for C/C++. There are also some interesting C/C++ projects at github in the public-domain projects.
http://unlicense.org/
https://github.com/public-domain?tab=repositories

Projects from Plan 9 and suckless.org are known for their efficiency and minimalism. You can check out some of that code at:
http://git.suckless.org/

micro-bunzip code is available from:
http://www.landley.net/code/

What follows is a list of single file and lightweight libraries:
https://github.com/nothings/stb
https://github.com/nothings/single_file_libs
https://github.com/yui0/slibs
https://github.com/mackron/dr_libs
https://github.com/RandyGaul/cute_headers
https://github.com/mattiasgustavsson/libs
https://github.com/pennie-quinn/paq
https://github.com/gingerBill/gb
https://github.com/to-miz/tm
https://github.com/r-lyeh/tinybits
https://github.com/tylov/C99Containers
https://github.com/nemequ/portable-snippets
https://github.com/floooh/sokol
https://github.com/hidefromkgb/mac_load
https://github.com/lvandeve/lodepng
https://github.com/rgamble/libcsv
https://github.com/rgamble/csvutils
https://github.com/arnoldrobbins/strftime
https://github.com/curl/fcurl

Know of some others worth trying? Please tell me about them:
https://groups.yahoo.com/groups/CppDesign/
Along the lines of investigating portable C GUI libraries, I started looking at cross-platform library options for font rendering in C. This area is particularly useful if you're investigating creating your own GUI library or game library. I was most interested in the TrueType font rendering libraries and techniques. It was rather surprising to read just how difficult it is to get simple internationalized text to the screen especially using graphics libraries like OpenGL.

Here's what I've located. If you have other recommendations for C font rendering libraries, please let me know.


GUI library options like nuklear and nanovg use stb_truetype.h:
https://github.com/nothings/stb
They also use some kind of font stash, such as this one used with nanovg:
https://github.com/memononen/fontstash


Other GUI libraries use FreeType2.
https://www.freetype.org/

For instance, SDL2_ttf uses FreeType2.
https://www.libsdl.org/projects/SDL_ttf/

Allegro also has font libraries available that are based on FreeType2.
http://opensnc.sourceforge.net/alfont/mirror/

Here's one that works with Allegro or SDL:
http://kirill-kryukov.com/glyph-keeper/files.shtml


There are several font libraries for OpenGL, but there aren't many options written in C. Some are for older versions of OpenGL and some only work with later versions. Here's what I found so far:

https://github.com/rougier/freetype-gl
https://github.com/jtsiomb/libdrawtext
http://quesoglc.sourceforge.net/


Here's another C option that works with FreeType2 and embeds fonts in C programs:
https://github.com/chrisy/fontem


The most recommended technique used by OpenGL developers seems to be texture mapping. A texture can be used like a hash table to store various characters and other pixmaps that need to be rendered. An OpenGL function can draw a piece of the texture or update/change parts of it in memory without affecting performance too much. While software renderers have no real trouble copying or blending a bitmap graphic or pixmap, the newer OpenGL versions send the textures to the GPU for rendering. So utilizing a texture instead of bitmaps/pixmaps and minimizing the number of textures one is working with can improve performance.

I personally find it easier to render text with SDL. It handles copying and blending bitmaps (as an SDL_Surface) and offers a useful library (SDL_ttf) to do most of the work. SDL 2.x does use OpenGL underneath on some platforms, so some of the texture concepts used by OpenGL programmers might improve font rendering performance on some versions of SDL as well.

Freetype seems to be the library for working with TrueType fonts. SDL_ttf uses freetype to interpret the Truetype font format and create bitmaps/pixmaps to represent characters (converting them from vector format to bitmap/pixmap format). I found working with SDL_ttf a lot more user-friendly than trying to use Freetype directly.

Another viable option is stb_truetype.h. The license for this software is definitely an advantage. However, from what I've read the rendering still isn't quite as good as Freetype. I look forward to testing this out on my own at some point.

At this point, I'm still investigating SDL_ttf, stb_truetype.h and OpenGL texture mapping. A combination of these might be just what's needed in a font rendering design for a cross-platform GUI library.

Know of some other font rendering options that work well for Truetype fonts or have a better way to get fonts to the screen, I'd love to hear about it?
Some of the C graphics libraries are great, but I've yet to find a simple GUI that makes it easy to port some older BASIC programs that I want to be able to keep working with. I've created several iterations of my own GUI library, but have never been satisfied with the results. That's the main reason I keep investigating cross-platform GUIs, to see if someone's found a better way to do it. Of the various designs, the ideas behind the immediate mode GUIs seem the most useful for the type of programs I'm targeting. However, I can't seem to find one GUI library that provides a simple way to do what I want. So, I've decided to revisit my old GUI library designs but eliminate some of the framework constraints and some of the object oriented elements. Instead, I'm looking at a more procedural approach that uses concepts from immediate mode GUIs.

Even though I'm avoiding popular C/C++ GUI libraries, I'm not starting completely from scratch and writing everything myself. There are plenty of good graphics libraries that are very portable and make a great basic starting point for a GUI. One of the libraries I've been very impressed with is SDL. It makes a great base for porting software. I've also done a lot of work with PicoGL (a TinyGL fork). It's a convenient way to make OpenGL more portable and avoid some of the version issues. It works on low resource platforms such as handheld devices that don't have high performance video driver support. I've often found OpenGL and Mesa slow on older computers and low resource systems. PicoGL provides very good performance on these types of systems. While using Win32 is not as portable as I would like, it's not that hard to get an OpenGL window up and running on Win32. That easily allows switching between Win32/OpenGL and SDL (1.2.15 or SDL 2.x)/PicoGL. SDL can work on a variety of platforms and PicoGL can work with SDL or with other options such as nano-x, X11 or vesa framebuffer. It shouldn't be too hard to take the output from PicoGL to use with the Android bitmap API either. Another possible option for a backend is Allegro. Like SDL, it works on a variety of platforms. It would be nice to switch between SDL and Allegro as backends depending on which works best for a particular platform without needing to redesign an entire application.

The PDCurses/ncurses API provides a standard way to create console based programs that work well on a variety of platforms from DOS to Windows to FreeBSD to Linux. However, it provides only text support and no real graphics support. While it's great for porting programs written to work with it, I don't think it's the best option to use as a GUI backend. I recently came across TinyCurses which provides a subset of the API and uses SDL as a backend. PDCurses also offers SDL as a backend option. I couldn't help thinking, once a decent GUI design was finalized, it wouldn't be too hard to provide a subset of functionality similar to PDCurses/ncurses. That would allow for easy porting of some PDCurses/ncurses based applications to any platform the GUI library works on.

So, why not just use OpenGL as the backend to design a GUI library? After considering the pros and cons, I decided I don't want to be tied specifically to OpenGL as an API for 2D graphics. While it's very popular and available on several platforms, the changes from a fixed function pipeline to a programmable pipeline with its own shading language make it hard to port programs from one version to another. PicoGL makes use of old fixed function pipeline concepts. Windows OpenGL also uses the older design. Mobile devices and WebGL make use of the newer concepts and the ability to harness the GPU to do more processing. Many developers seem to be abandoning the older concepts and embracing the new programmable pipeline design. However, that leaves some nice older applications that were designed for earlier versions of OpenGL that won't port easily to the newer versions. They might require a complete redesign and rewrite. Using PicoGL is one way to make it easier to port such applications. It can do software rendering to a bitmap which can then use more modern methods (including later versions of OpenGL or SDL 2.x) to transfer the bitmap to the screen. While the idea of using OpenGL as the portable backend for a GUI library sounds good, dealing with version differences and what versions may be available on which platforms does not make it the best option for a complete cross-platform portable solution. Instead, I prefer the concept of being able to switch out backends to use what works well on a particular platform. The GUI library should encapsulate the rendering as much as possible to avoid needing to rewrite applications in order to switch to another backend.

On the other hand, many GUI libraries and some other rendering libraries (such as SDL) offer ways to interoperate with a graphics library like OpenGL. While I want my GUI library code to be cross-platform, I don't want to limit a developer to using just that API. If a programmer wants to use OpenGL or SDL2_gfx or some other library to handle 2D/3D graphics, I'd like the GUI to be able to interoperate with that choice. It would mean that the resulting application would be less portable. However, if an application is already designed to utilize SDL2_gfx, OpenGL or some other library that could work compatibly with the GUI library, it could make adding some GUI functionality to an existing application much easier.

I definitely know what I'm looking for in a cross-platform GUI. I want a simple, portable way to get text, menus, forms, file/directory picker dialog functionality to the screen. I'd like to make use of Freetype fonts. I want an internationalized way to display text and for users to input text. The text strings will probably involve a library such as gettext. I want the options to use keyboard input for those of us who prefer keyboard commands to get their work done and mouse/touchscreen input for devices such as mobile phones where a real keyboard may not be available. I need to be able to access graphics and audio information from a file system or from a zipped file (such as .apk file on Android). I don't care if the look and feel matches what's in style for a particular device or operating system. I just want it to be user-friendly and ergonomically designed.

If you're interested in GUI design or working on a GUI or gaming library of your own, I'd love to compare notes on the subject. Have an idea for what C library might make a good backend for a portable, cross-platform C based GUI? Let me know. Feel free to discuss design issues or other C/C++ topics on the CppDesign mailing list or contact me to compare design notes and share ideas ( http://www.distasis.com/connect.htm ).
I'm always on the look-out for a simple to use, lightweight, portable GUI library. I've put together several lists of available C/C++ GUI libraries. (For instance: http://www.distasis.com/cpp/scrlib.htm ) I've also tried out and experimented with several GUI and text user interface libraries. It's difficult to find one that will let you get a new application up and running or an old one ported to C/C++ quickly. Most GUIs seem to get in the way of development or complicate it.

I still keep debating whether to create my own GUI library in projects or use what's currently available. There's no point in creating your own if there's something better out there. That's the main reason I continue to look for interesting GUI libraries. However, I've yet to find that "something better" that I really enjoy working with.

With that in mind, here's another list of GUI libraries. This time I've limited the field to C only libraries that are highly portable. Since many lighter GUIs use various graphics libraries and other frameworks as backends, I'm including information on graphics libraries that can be used for GUI development as well.


Graphics libraries often used with GUIs:


Some lightweight GUI libraries use graphics libraries as backends to improve portability and decrease library code size. Popular graphics backends written in C include SDL (Simple DirectMedia Layer) and Allegro.

SDL

https://www.libsdl.org/
SDL2_ttf provides TrueType text support for SDL.
https://www.libsdl.org/projects/SDL_ttf/
SDL2_ttf provides internationalization support using a UCS-2 character set. I have patches to support the UTF-32 character set.
http://www.distasis.com/cpp/lmports.htm

Allegro

https://www.allegro.cc/about

AGG

Anti-Grain Geometry library is also used as a graphics backend. Some projects stick with the older version of AGG 2.4 which has a BSD license.
https://en.wikipedia.org/wiki/Anti-Grain_Geometry

Nano-X/Microwindows

Nano-X is highly portable and can work on a wide variety of platforms including DOS and embedded systems. It makes it easier to port X11 and Win32 applications by providing a subset of those APIs (with nano-x/NX11 or microwindows).
https://github.com/ghaerr/microwindows
https://github.com/georgp24/microwindows-android-bin
https://github.com/ghaerr/nxlib

OpenGL

I've seen several lightweight GUI and screen libraries designed for OpenGL. However there are issues with portability to different versions of OpenGL or OpenGLES. Projects like freeglut and GLFW try to make OpenGL easier to use for cross-platform development. There are also several libraries that work with the freetype library and add TrueType font support including ftgl, ftgles, GLTT, freetype-gl, OGFLT
http://freeglut.sourceforge.net/
https://www.glfw.org/

PicoGL

I like PicoGL (a fork of tinyGL) for OpenGL development. It's a subset of OpenGL. It supports several backends including SDL, nano-x, X11 and vesa framebuffer. Since it's software based, it ports well to hand-held devices and other systems that may not have rich hardware support for graphics.
http://people.openmoko.org/jserv/graphics/

I've made several updates and additions to PicoGL including adding some missing OpenGL functionality, SDL 2.x support, bug fixes including a fix for lighting bug in the gears demo. It includes enough OpenGL support to port Emilia pinball. I haven't uploaded my changes to the Internet yet, but if anyone's interested, feel free to contact me about it.


GUI and text user interface options:


PDCurses with SDL backend

This is an option I really like. I've been experimenting with using this for development. I have BSD libmenu and libform working with it too. PDCurses can be used to create a text user interface and SDL can add graphics capabilities.
https://github.com/wmcbrine/PDCurses

TinyWidgets

Lightweight GUI with graphical screen designer. Uses nano-x as a backend. While the original project is dated, there's been some recent development by some of the nano-x developers.
http://tinywidgets.sourceforge.net/
https://github.com/ghaerr/microwindows/tree/master/src/contrib/TinyWidgets

nuklear

This looks promising. Has several backends including GLFW, SDL, Win32, X11, SFML, allegro, nanovg.
https://github.com/Immediate-Mode-UI/Nuklear
https://github.com/vurtun/nuklear
https://github.com/vurtun/nuklear/issues/202
There are also projects that combines nuklear and raylib:
https://github.com/RobLoach/raylib-nuklear
https://github.com/tcfunk/raylib-nuklear

raygui

Another promising cross-platform option. It has support tools to help create layouts. It works on a variety of systems including mobile devices. There's also raylib (a graphics/video game library used by raygui) and raudio (for audio support). The raylib library uses OpenGL/GLFW for graphics support.
https://github.com/raysan5/raygui

c_ugui

Immediate mode GUI using Raylib.
https://github.com/Aurumaker72/c_ugui

nanovg

nanovg is a 2D vector drawing library by the developer of nanosvg (popular svg parsing library). The examples show GUI elements. Other GUI libraries (including nuklear and oui-blendish) also use this as a backend option.
https://github.com/memononen/nanovg
https://bitbucket.org/duangle/oui-blendish/src

GTK+

GTK+ is one of the more popular GUI libraries. However, while each new major version came with added features, it also came with a lot of added complexity. Some distributions use older versions of GTK+ (no longer in development) in order to cut down on complexity. While there were several applications written with this library, it's hard to find up-to-date, supported applications that still use an older version of GTK+.

Amigo Linux is still using GTK 1.2 and has patched some applications to keep them working.
ftp://distro.ibiblio.org/amigolinux/misc/Amigo%20Linux%20Project.html

I've also seen some patches to GTK 1.2 to keep it more up-to-date.
https://github.com/dimkr/gtk
https://github.com/tindzk/GTK

Another interesting GTK+ based option, there were some ports of GTK+ that use the ncurses backend.
https://atrey.karlin.mff.cuni.cz/~pavel/cursed/cursed.html
https://sourceforge.net/projects/zemljanka/files/

If you're interested in more up-to-date GTK+ versions that try to avoid some of the bloat and unneeded dependencies, check out these forks for GTK 2 and a minimal ATK to use with GTK 3:
https://github.com/stefan11111/gtk2
https://github.com/stefan11111/atk


XForms Toolkit

http://xforms-toolkit.org/

LessTif

https://sourceforge.net/projects/lesstif/

Kiss_sdl

GUI toolkit for SDL.
https://github.com/actsl/kiss_sdl

kiss-nanovg-sdl

Based on kiss-sdl but modified to support svg using nanovg.
https://gitlab.com/Mis012/kiss-nanovg-sdl

KiWi

GUI toolkit for SDL.
https://github.com/mobius3/KiWi

RetroGui

Minimalistic GUI library based on SDL.
https://gitlab.com/Pix3l/RetroGui

rouziclib

Works with SDL and other libraries.
https://github.com/Photosounder/rouziclib

Green-GUI

GUI for SDL 1.2 written in C99.
https://github.com/Laurefinwe/Green-GUI

swk

Minimalist widget kit for SDL.
https://oldgit.suckless.org/swk/files.html

WidgetSDL2

C99/SDL2 Cross-platform GUI using include headers.
https://github.com/nuchida7727/WidgetSDL2

uGI

Micro Graphical User interface. Needs SDL2.
https://github.com/wernsey/uGI

SDL GUI

Simple SDL GUI libraries, mainly targeted toward Windows.
https://github.com/David-H-Bolton/sdlgui

CGUI

GUI toolkit using allegro.
http://cgui.sourceforge.net/index.html

Win32

I've seen several C applications written with the Win32 API. That might not sound very portable for platforms other than Windows. However, keep in mind that X11 users have access to winelib and Microwindows offers some Win32 API compatibility. I have been able to get some programs written using a Win32 backend to port and run fine on Microwindows/nano-x.

Otk (Open Tool Kit)

C and OpenGL GUI.
https://sourceforge.net/projects/otk/

IUP

https://sourceforge.net/projects/iup/

LCUI

https://github.com/lc-soft/LCUI

Clay
https://github.com/nicbarker/clay

sgui

https://github.com/AgentD/sgui

libui

https://github.com/andlabs/libui

libui-ng
https://github.com/libui-ng/libui-ng

GraphApp

http://enchantia.com/software/graphapp/

Microraptor GUI

https://github.com/hodefoting/mrg

Micro-GUI (ugui)

https://github.com/ryankurte/micro-gui

microui

https://github.com/rxi/microui

FTK

https://github.com/xianjimli/ftk

EasyGui for embedded systems

https://github.com/MaJerle/EasyGUI

m2klib

https://github.com/olikraus/m2tklib

Milkymist Gui Toolkit

https://github.com/m-labs/mtk

mGui

http://web.tiscali.it/morello/MGui/index.html

RGFW

https://github.com/ColleagueRiley/RGFW

RSGL

https://github.com/ColleagueRiley/RSGL

Yzone

http://lifesoft.chat.ru/yzone/

GUISlice

https://github.com/ImpulseAdventure/GUIslice

newt

https://pagure.io/newt

notcurses

https://github.com/dankamongmen/notcurses

vtk

https://github.com/vktec/vtk

Agar

GUI toolkit using SDL. I've read several posts about it being buggy and not well supported. I've personally had no luck porting it to certain platforms.

STFL

Use with PDCurses, ncurses or similar libraries to provide common controls and widgets.
http://www.clifford.at/stfl/

CDK

Curses Development Kit.
https://invisible-island.net/cdk/cdk.html

Widget Curses ToolKit

Ncurses TUI widget toolkit library.
https://github.com/stfsux/libwctk



This list is in no way comprehensive. If you know of other highly portable, strictly C GUI or text user interface libraries, please mention them. If you're working on your own GUI library, would like to discuss C/C++ GUI libraries and development or other C/C++ related topics, feel free to continue the conversation on the CppDesign mailing list.
Was at a PHP meetup where the group was discussing Docker. Members and the presenter knew certain Linux distributions had a smaller footprint for use with Docker. I was surprised to find out they really didn't know why that was. One of the key factors is the C runtime library. Basic C runtime libraries just cover the functions and data structures that are part of the ISO C standard. Many C runtime libraries also add functions and data structures that are part of the POSIX standard as documented by the Open Group. Some C runtime libraries are rather bloated and provide a wide variety of functions (even beyond those documented by the ISO C and POSIX standards). Others provide a bare minimum. Some, especially those targeting embedded systems are designed for efficiency. Others are designed for functionality. Some provide no Unicode support (locale 'C' only). Some like musl, concentrate on UTF-8 support. Some try to support a large variety of characters sets and internationalization features. All these factors can affect code size and efficiency when compiling programs.

Alpine Linux previously used the uclibc runtime library and now uses the musl library. Most major Linux distributions use glibc. It was a big step, but a positive one when Debian (and Ubuntu) made the switch to eglibc. The choice of C runtime library can make a huge difference for the operating system.

For Windows developers, if you're using MinGW, the GNU compiler on Windows, you're using the Microsoft runtime libraries. The original version of MinGW used crtdll.dll but later versions use msvcrt.dll. Windows systems typically have one of these runtime libraries already installed. So while, you can't distribute Microsoft's libraries, you really don't have to. At least one is already on any particular Windows system. It gets even more complicated because different versions of Windows have different versions of msvcrt (such as msvcr70.dll, msvcr80.dll). MinGW uses a subset of the runtime functions based on Visual Studio 6.0. There are ways to access runtime functions from later versions of Visual Studio, but the application becomes less portable to various versions of Windows. Cygwin which also works on Windows, avoids the problem of dealing with multiple Windows runtime libraries and dlls and provides better POSIX compatibility for their runtime library by using a runtime library based on newlib.

There are a wide variety of runtime libraries designed for embedded systems. They're typical more compact and less bloated than a library like glibc and many are easier to port to various platforms. Of the runtime libraries available for embedded systems that are highly portable, I thought the newlib design was interesting. newlib is currently maintained by Red Hat. There are a limited number of syscalls (typically functionality provided by the kernel) that one needs to provide code for to get the library to work. Newlib uses a combination of public domain and BSD style licenses. Cygwin uses a runtime library derived from newlib, but adds several POSIX functions. It also uses a GNU GPL license. That means whenever you distribute programs linked with their runtime library you must also distribute the source code in order to be compliant with the GPL license.

As mentioned, the standard C library on most Linux distributions is glibc which was developed by the Free Software Foundation. The glibc project was slow to take patches and is a rather large library, so some distributions switched to eglibc which is binary compatible with glibc. The binary compatibility makes it easy to switch between the two. Some Linux distributions wanted to avoid bloated C libraries and work well on low resource or older systems. They chose uclibc which was designed for embedded systems. When I worked with a uclibc based distribution, I found myself making several patches to Open Source programs just to get them to compile. Many Linux distributions such as Alpine Linux are now using musl. It's designed for efficiency and standards compliance including full POSIX standards compliance.

musl was designed to work with a Linux kernel. So unlike choices such as newlib, it is not easy to port to other operating systems. The midipix project is endeavoring to create a POSIX compatible layer for Windows, so that musl will work out of the box on that system. Musl uses a MIT license. The midipix project will use a more restrictive license similar to Cygwin. Many basic embedded system libraries tend to use less restrictive licenses like MIT and BSD so that they will be adopted by companies. However, project or company adapts a C library to a particular system and adds a lot of functionality, they typically tend to use GNU GPL or other more restrictive licenses. Many projects dual license in hopes of selling companies a commercial license with less restrictions.

Google developed the Bionic C library for it's Android operating systems. It has a BSD license. It's also designed to work on low resource systems so it tends to offer less functionality than other C libraries such as glibc. It has partial POSIX support.

I've been hitting many limitations with the MinGW runtime libraries when it comes to porting. Alternatives such as Cygwin's or midipix's runtime libraries would overcome the issues. However, the licenses are much more restrictive. I know I definitely wanted more POSIX compatibility on Windows than MinGW offers out of the box. As a cross-platform programmer, it would be nice to take whatever C runtime library I end up with on Windows and reuse it on Linux and other systems. I looked at C runtime libraries for embedded systems which typically port well. Of those, newlib seemed the most interesting, because according to some of the documentation it only requires 17 syscalls to port it to an operating system. Some Windows CE compiler ports use newlib with added functionality for the Windows CE operating system to derive a working C/C++ compiler. When I investigated the newlib code, I did not particularly like the design, especially the way it handled threading by providing standard and threaded versions of functions. The implementation of file I/O looked like it had been modified several times and at this point could use a major refactoring. When I read some of the comments in that section of the code, I felt very uncomfortable using the library. I wanted a simple, clean, basic design that I can add to.

Another option I looked at was PDClib. I love the idea of a public domain library. MinGW original licensed their WIN32 and runtime code (which integrates with Microsoft's code) as public domain.
PDCLib was based on an earlier Public Domain library project originally at Sourceforge. I tried PDClib on Windows (which the developer says he uses it with), but I was unable to get file I/O to work properly. I contacted the developer to see if he needed with the project, but he really didn't seem to need any assistance at the time. PDClib only supports standard C functions. It does not provide any POSIX functionality. So, it would have limited usage as is for running most Open Source programs.

A number of original operating systems use their own C runtime libraries. I figure, if they can reinvent the wheel and create a C runtime library for their particular purposes, so can I.

I've been coding functions that are typically part of the C runtime library in order to provide better porting support for Windows. I wrote a C11 compatible thread library, several BSD and POSIX string functions, some POSIX file functions, etc. That left me with the dilemma of how best to integrate the additions with the runtime library. They really should be part of the library and part of the C standard headers. I currently have them implemented as supplemental libraries that have to be added separately. It's easier to test and integrate on various operating systems that way. Ideally, it would be nice to have everything accessible as one library though.

I'm very familiar in the various methods of connecting to the kernel in Windows. Some projects such as midipix just use ntdll.dll. Other projects connect to other Microsoft dlls such as kernel32.dll. One can use LoadLibrary, GetProcAddress to connect t a dll or if the library is already linked in, one can skip LoadLibrary. A few Open Source projects I've seen actually implement the LoadLibrary functionality from scratch. I'm not as familiar with the techniques to connect to the Linux, BSD and other kernels and would love to find more clear documentation on this subject. If you run across any good materials, please let me know ( http://www.distasis.com/connect.htm ). Linux uses techniques such as vdso, vsyscall, syscall to call kernel functions.

I find it fascinating to consider the design trade-offs of various C runtime libraries. With that in mind, here's a list of some of the C runtime library options:

eglibc:
http://www.eglibc.org/home
uclibc:
https://www.uclibc.org/
musl:
https://www.musl-libc.org/

Linux from Scratch build instructions (including musl)
http://clfs.org/view/clfs-embedded/arm/
midipix
http://midipix.org/
BSD regular expression library
(Musl regular expression support was forked from this library.)
https://github.com/laurikari/tre

PDCLib:
http://pdclib.e43.eu/
Original Public Domain C library:
https://sourceforge.net/projects/pdclib/
https://sourceforge.net/projects/pdos/
Another fork of PDCLib:
https://github.com/DevSolar/pdclib
libTom Public Domain libraries for math and cryptographics functions
(Some of musl's functions were forked from these.)
http://www.libtom.net/
libc11:
https://github.com/dryc/libc11
Eltanin-OS simia:
https://github.com/eltanin-os/simia

Bionic:
https://github.com/android/platform_bionic

Newlib:
https://sourceware.org/git/gitweb.cgi?p=newlib-cygwin.git;a=tree
libgw32c:
http://gnuwin32.sourceforge.net/packages/libgw32c.htm

Windows CE cross-compiler:
http://cegcc.sourceforge.net/
https://sourceforge.net/p/cegcc/code/HEAD/tree/

ELKS
https://github.com/jbruchon/elks

FUZIX
https://github.com/EtchedPixels/FUZIX

lib43:
https://github.com/lunixbochs/lib43

Embedded Artistry's libc:
https://github.com/embeddedartistry/libc

GNO
https://github.com/GnoConsortium/gno

Sortix C library:
https://gitlab.com/sortix/sortix/blob/master/libc/

MentOS:
https://github.com/mentos-team/MentOS/tree/master/libc/src

olibc:
https://github.com/olibc/olibc

CloudABI's standard C library:
https://github.com/NuxiNL/cloudlibc/

cc65 - C for 6502 systems:
https://github.com/cc65/cc65

kLIBC fork for OS/2:
https://github.com/bitwiseworks/libc

clib2 for Amiga
https://github.com/adtools/clib2

welibc:
https://bitbucket.org/wrelam/welibc/src/master/
I've been looking for useful, efficient, user-friendly alternatives to build tools like GNU autotools and cmake. I've even created lists of build tool alternatives at various wikis and sites related to programming and compilers. If there's interest, I can post some of that information here along with pros and cons of various tools. I think, during my searches, I've found some good alternatives for my own projects and to use with my own build script generator.

If you're looking for build tools for your own projects, you may want to try the following tools. I'm also doing some active development and patching to some of the tools and would be interested in comparing notes with others on ways to use and improve them (see below for details).

GNU autotools is probably the most popular build system for most C/C++ programs. So, what's wrong with it? Just to build a C program, you need two interpreters (m4 and Perl). You also need autoconf, automake and make. The input to these programs is not necessarily intuitive to a C programmer. Many C programs, especially those using Qt make use of cmake which has less dependencies, but I've also found it less than intuitive. What if you want to build a system from scratch. You can get make to build without any other build tools. I've done it. From there, you can work to build the rest of the gnu autotools toolchain. To build cmake, you need to bootstrap the build using another instance of cmake. So where do you get the original build of cmake for the system? There is a way to build cmake with gnu autotools, but I've found it rather buggy.

After looking through several make alternatives, I really have not found a good replacement for it. The syntax takes some getting used to, but I've been able to find ways to get it do whatever I need it to do. There are situations where make is very inefficient, but there are work-arounds. Efficiency really depends on how well you craft your makefiles. I attempted to find some alternatives to the GNU version of make. BSD make has very different syntax, so only the simplest make scripts work with both tools. I find GNU make used more often than BSD make for building Open Source projects and it has features that were never added to BSD make. There's a Perl implementation of make, but that requires a Perl interpreter. My main issue with GNU make is that it is only supported on certain platforms. I sent in a bug report about GNU make not working properly on native Windows and I even sent in a patch. The developers were not interested in supporting native Windows. They thought it was enough that there were versions that worked with Cygwin and msys. Unfortunately, I've yet to find an alternative to make that handles the GNU makefile sysntax and doesn't require installation of an interpreter.

I've decided that until I can find anything better, I will continue to use GNU make. Since it is Free Software, I can modify the code to work on other systems that GNU make developers don't care to support. I can distribute the modified version if I distribute the source code. So, I use a modified version of GNU make that fixes platform specific bugs that I've encountered.

After searching through many alternatives, I've found a wonderful replacement to configure/autoconf. It's also more compact and I find it more intuitive than cmake. It's called CDetect. It's written in C and is comprised of only 3 files. The project is no longer actively developed. However, I've been making several modifications of my own to get it to suit my projects' needs. I've implemented some of the items on the original developers To Do lists. I'm still making modifications as I find features that are lacking, but it makes a useful replacement to configure. I've converted some of the Open Source projects I build from source regularly to use CDetect and custom makefiles instead of their build systems. If you're building from source, such as with a Linux from Scratch system, using CDetect means you don't need Perl, and several other programs installed just to build a C/C++ program.

Freedesktop.org advocates the use of pkg-config. It's used by many GNU projects as well. While I originally thought it was yet another complication when building from source, I've found pkg-config rather useful in simplifying build scripts. You don't have to worry about finding the right library, pkg-config can tell you where to find it. If you're cross-compiling, you can get have two sets of directories with pkg-config information, one for cross-compiled libraries and one for regular libraries. Change the path in an environment variable and your build script knows where to find the appropriate libraries. What I really didn't like about pkg-config was the complexity of the program and that it required a circular dependency with glib. I don't even want glib on my system at this point. Luckily, there is an alternative with friendly licensing called pkgconf. It's a drop in replacement for pkg-config. It's very helpful in finding where the right libraries are on a system. I've gone from never using pkg-config to use pkgconf in almost all my build scripts.

So, between CDetect, pkgconf and make, I now have all the tools I need to use with my build system in order to build the Open Source programs and libraries I use most in an automated fashion. The tools are all written in C, so they require no special interpreters or other languages just to build them.

If you'd like to try out CDetect with my patches or see some of the build scripts I'm using with these tools, check out the archive link on my LM BLD system page:
http://www.distasis.com/cpp/lmbld.htm

I've added several features to my patched version of CDetect. Check the notes.txt file for details. I'm currently making some new modifications and would love input from other developers/users. If you'd like to make suggestions or compare notes, please contact me through the CppDesign mailing list or my web site:
http://www.distasis.com/connect.htm
GUI libraries

I've written articles on cross platform screen libraries including one for the C/C++ Users Journal. I've also done a lot of searching and evaluation of cross-platform GUI libraries. You can take a look at my comparison article on screen libraries at http://www.distasis.com/cpp/scrlib.htm

The following list does not cover every GUI library out there, but it gives a good sample of what's available. Most are C++ libraries but there are a few C libraries for those wanting to work only with C.

My personal preferences at this point are SDL (1 and 2), pdcurses and FLTK because they're lightweight and work on a large variety of systems including mobile devices.

URLs are accurate as of when this was posted. However, they can change over time. You can use a search engine or archive.org wayback tool to find pages that have been moved or backups of older versions of pages.

FLTK - Fast Light ToolKit (C++)
http://www.fltk.org/index.php

Fox Toolkit (C++)
http://www.fox-toolkit.org/

wxWidgets (C++)
http://www.wxwidgets.org/

SDL - SDL 1 and SDL 2
Simple DirectMedia Layer - C cross-platform multimedia library
https://www.libsdl.org/

SDL-widgets
C++ library
http://members.chello.nl/w.boeke/SDL-widgets/

SMFL - simple and fast multimedia library
http://www.sfml-dev.org/

pdcurses
C library
Works with Windows console, X11, SDL 1 and 2
http://pdcurses.sourceforge.net/

pdcurses win32a
C library
A PDCurses fork for Win32 (not console mode).
http://www.projectpluto.com/win32a.htm

Qt
Expansive C++ GUI toolkit - source includes many libraries including a browser example using Webkit.
https://www.qt.io/

NCurses
C console library. Works on POSIX systems and Windows.
http://invisible-island.net/ncurses/

Windows++
I learned a great deal about Win32 C++ programming from the book that created this framework:
https://web.archive.org/web/20070404043707/http://www.dilascia.com/wpp.htm

Owlnext
Borland's Object Windows C++ Library for the modern age
https://sourceforge.net/projects/owlnext/

Ultimate
C++ cross-platform rapid application development framework
http://www.ultimatepp.org/index.html

Poco
C++ library
https://pocoproject.org/

Nana
C++11 GUI library
https://github.com/cnjinhao/nana

GraphApp
Toolkit for platform-independent graphical user interface programming in the C language.
Works with Windows and X Windows
http://enchantia.com/graphapp/

Anti-Grain Geometry
C++ free graphics library for Windows and X11. Includes SVG viewer.
http://www.antigrain.com/about/index.html

CEGUI
Crazy Eddie's GUI System C++ library providing windowing and widgets for graphics APIs/engines
http://cegui.org.uk/wiki/Main_Page

Guichan
Portable C++ gaming library for Allegro, SDL and/or OpenGL
https://sourceforge.net/projects/guichan/

AntTweakBar
C/C++ GUI library for OpenGL and DirectX applications.
http://anttweakbar.sourceforge.net/doc/

Agar
C Cross-platform toolkit for graphical applications.
Difficult to build on some systems and some versions can be buggy.
http://libagar.org/

LibUFO
LibUFO Universal Form Objects, C++ core library for forms.
http://libufo.sourceforge.net/index.html

VGUI
C++ V GUI library and IDE (VIDE).
http://vgui.sourceforge.net/

IUP
Multi-platform toolkit for building graphical user interfaces. with API in three languages: C, Lua and LED.
http://webserver2.tecgraf.puc-rio.br/iup/

Milkymist GUI toolkit
C GUI library
https://github.com/m-labs/mtk

m2tklib
Mini Interative Interface Toolkit Library
https://code.google.com/archive/p/m2tklib/

ftk
Funny tool kit, a C cross-platform embedded GUI
https://github.com/xianjimli/ftk
I'm working on several projects. One of my goals is to be able to port any of the SDL 1.2.x programs I use so they'll work with SDL 1.2.15 or with SDL 2.x. So far, I've added SDL 2 support to PDCurses. I believe some or all of those patches made it back into the official version. Other programs I've added SDL2 support for include bard, picaxo, sfontview, unifontview, perigee, SDL_Draw, pong, drac, yahtzee. More are in the works including Tuxmath. Bard is a lightweight epub reader with text to speech support. Picaxo is a lightweight graphics viewer. Sfontview is a lightweight TrueType font viewer. Unifontview is a font viewer that shows a font's entire character set including Unicode characters supported. Perigee is a graphics slideshow program. SDL_Draw is a graphics library for simple line drawing with SDL. I'm currently using it with wavetools to do the line drawing for a lightweight wave file viewer. The wave file viewer also builds with SDL 1.2.x or SDL 2.x.

Code/patches for many of the modifications I've made are available from a link at:
http://www.distasis.com/cpp/patches.htm
I'll be adding more modifications to various projects over time. Feel free to write if you're interesting in discussing a particular SDL 2 conversion further.

MinGW

May. 5th, 2016 12:29 pm
There are now several forks of MinGW and each has its pros and cons. However, there are now enough negatives to using them, that I've found it necessary to build MinGW from scratch myself. The MinGW64 project uses a later version of gcc, has better compatibility for building Open Source projects and has its own thread library instead of using Red Hat's pthreads-w32. Some custom builds of MinGW64 even have POSIX threading set as the default instead of Win32 threading. That means better compatibility for C++ thread related code (since the GNU C++ library relies on POSIX threading for parts of its implementation). The MinGW project has always been more careful about licensing and making sure that the code it was using was properly licensed and legal for usage. The MinGW project did follow the example of the MinGW64 project in one key area. They switched from public domain to a MIT license for their runtime library and Win32 API. When they did so without clearly indicating that an exception could be made similar to the GNU gcc runtime license exception, I felt it was time to stop using that version of the MinGW compiler.

I'm currently working with gcc 4.9.2 compiled from source. I'm still using the older public domain APIs, but I've made several modifications for compatibility with the Win32 API (including some modifications that aren't available in the MinGW64 libraries). I have a minimal thread library that was custom written for portability. It's based on C11 thread support and includes POSIX functionality. The gnu compiler is built with POSIX threads as the default so C++ threading works as expected.

So far, I've had no reason to want to work with any other MinGW forks. The version I have does everything I need and supports all the programs I want to compile on Windows. My particular fork is continually evolving. I continue to add support for new Win32 API changes, Win32 API omissions, new C/C++ features as I need them. At some point, I hope to completely replace the runtime library with code that better supports internationalization (better UTF-8 support), C standard compatibility and other useful features.

If anyone else is finding limitations with the compilers maintained by the various MinGW and MinGW64 projects or other related forks based on these projects, I highly recommending building the GNU compiler from source on your own with the options you need most. If you're interested in discussing the GNU compiler further or want to know more about my modifications, you're welcome to use the CppDesign mailing list ( http://groups.yahoo.com/group/CppDesign ) as a forum for further discussion.

July 2025

S M T W T F S
  12345
67891011 12
13141516171819
20212223242526
2728293031  

Syndicate

RSS Atom

Most Popular Tags

Style Credit

Expand Cut Tags

No cut tags
Page generated Aug. 18th, 2025 08:54 am
Powered by Dreamwidth Studios