C++ programming projects for GNU GCC g++
Installing and
starting to learn Ubuntu Linux has been one of my most fun
computer projects in a long time. Bundled with Linux distributions is the GNU Compiler Collection (GCC)
with its g++ compiler for C++. I like that it generates fast native code rather than intermediate code that has to be compiled at
runtime. It seems easy enough to use as a command line compiler, but I'm using the
Anjuta IDE.
It's been a pleasant surprise to discover that some of my existing Visual C++
projects have only required minor modifications to make g++ compatible,
meaning that they were more standard than I thought they were and more cross-platform than I thought they were. That applies to
the console projects. The graphics projects will be another story, but I'll be interested to see what GTK+ has
to offer and how it compares with Windows .NET, which I haven't used enough to get used to or get locked
into. I really enjoy working in Linux, so I'm hopeful.
This page is an index for new g++ projects and for old ones that I've found to be compatible (or have revised to be compatible)
with g++. If I ever get to GTK+ projects, those will be listed here, as well.
Each link below goes to the project page, which has a more complete description, a code listing, possibly screenshots, and a
download link if the project is large.
Utility functions, classes, headers, and miscellaneous
| my.h |
All my programs #include "my.h". It has typedefs, #defines, function prototypes, and some template functions.
|
| mylib.cpp |
Most of my programs also #include this file's library routines.
|
| File Array |
Class that holds a list (vector) of file names and provides methods for retrieving them in sequential or random order.
|
| Descriptive statistics and linear regression
calculator class |
A class, tested and usable with both g++ and VC++, that accumulates numeric values into an array (vector) and can perform statistical calculations about the array
contents on demand. Provides descriptive statistics, linear regression with 7 data transformations, automatic best-fit
transformation detection, prediction, correlation coefficient,
Student's t significance testing, and some additional unusual capabilities. I have no reports that anyone is using it in an
artificial intelligence program, and I haven't done so myself, but that's one of the things I wrote it for. Nonetheless, I
find it great for generating a quick statistics report about a list of numbers. |
| DoubleRect |
A rectangle class that uses doubles for dimensions and calculations. Useful for zooming such as in a
Mandelbrot application.
Works with g++ and Visual C++.
|
Programs
| Artificial Neural Network |
Classes for a multilayer perceptron (MLP) backpropagation neural net. It is the network code that is platform
independent and can be used in g++. The Visual C++ version of the project for Windows includes an application
that uses color graphics to display the node activity while the
network is trained. I don't expect to do that for the Linux version. Instead, I want a working neural network to put to
practical use from console applications. |
| File print utility |
Utility to print program source code or other text files,
with options for setting tab expansion, lines-per-inch, lines-per-page,
margins, line numbering, and more. |
|
Random music generator |
A platform independent class that facilitates the generation of random
music in 12 keys and a variety of musical modes (scales), and a console
application that uses the class to play music through the PC speaker. [Not yet available. Link goes to old version.] |
| Solve alphabet substitution ciphers |
Decipher.cpp
assists with solving a substitution cipher by providing an interface
where you can easily and quickly swap letter translations and see the
results immediately in the text. Encipher.cpp
is the companion program that creates a substitution cipher. |
g++ conversion notes
I'm new to the g++ compiler, and am accumulating notes here while converting existing projects from Visual C++.
- The following works in Borland and Visual C++, but gives an "operator >> undefined" error in g++:
ifstream(filename.c_str()) >> variable;
In g++, it seems you must assign a variable to a temporary object before you can use it:
ifstream is(filename.c_str());
is >> variable;
|