|
Related YoLinux Tutorials:
°C++ Info, links
°C++ String Class
°C++ STL vector, list
°Emacs and C/C++
°Advanced VI
°CGI in C++
°Subversion / Trac
°Subversion commands / use
°Clearcase Commands
°MS/Visual C++ Practices
°C++ Memory corruption and leaks
°YoLinux Tutorials Index
Free Information Technology Magazines and Document Downloads
Free Information Technology Software and Development Magazine Subscriptions and Document Downloads
|
Open Source:
C, C++ and FORTRAN come with most distributions.
Cross Compiling:
Commercial Compilers:
| Language |
WWW |
Description |
| Ada |
Ada Core Technologies |
Ada 95 GNAT open source compiler and GUI tools. (gcc backend) |
| Ada |
Green Hills Software |
AdaMULTI 2000, ADA 95 IDE |
| Ada |
Aonix Software |
Ada 95/83, ObjectAda |
| Ada |
Rational Software: Apex |
Ada 95/83 development |
| C |
Compaq C |
True 64 Compiler ported to Linux for Alpha chip. |
| C++ |
Intel |
Intel ISO standard C++ compiler and tools (optimized) |
| C++ |
KAI (Kuck and Associates): Guide |
OpenMP C/ C++ compiler for SMP multiprocessor systems. Has OpenSMP directives for dynamic balancing and dynamic threading |
| C++ |
Fujitsu C/C++ |
Optimized ANSI, K and R, ISO/IEC and ATandT standard C++ compiler |
| C/C++/Ch |
C/C++ embedable interpreters |
ISO C/C++, POSIX, GTK+, OpenGL, Motif, Sockets, CGI and scientific programming support. |
| FORTRAN |
Portland Group Compilers |
Paralell FORTRAN, Cray extentions |
| FORTRAN |
Absoft ProFortran |
ANSI FORTRAN 95, array bounds checking, HP/Compaq/VAX extensions |
| FORTRAN |
Intel |
FORTRAN 95, HP/Compaq/VAX extensions. [buy] |
| FORTRAN |
HP/Compaq Fortran |
True 64 Compiler ported to Linux on Alpha chip (only). |
| FORTRAN |
N.A.Software |
GUI debugger, IEEE math and exception handling. Lots of math libraries. |
| FORTRAN |
Fujitsu FORTRAN |
Optimized 95, 90, 77, 66 compiler |
| FORTRAN |
Numerical Algorithms Group (NAG) |
Compiler supports 64 bit integers and High Performance FORTRAN (HPF), IEEE support. |
| COBOL |
Liant: COBOL |
Re-host Mainframe apps on Unix/Linux. |
| COBOL |
TheKompany.com: KOBOL |
ANSI COBOL compiler and IDE. |
| COBOL |
Micro Focus COBOL |
For IBM zSeries Linux mainframe. |
| PL/1 |
Liant: Open PL/1 |
Re-host Mainframe apps on Unix/Linux. |
| JAVA |
Tower Technology: TowerJ |
Compiles JAVA to native code. Will also compile JAVA byte code to native binary code. |
| LISP |
Franz Inc: Allegro CL |
Common Lisp object-oriented development environment |
| Eiffel |
ISE: Eiffel |
Object-oriented language and development environment |
| BASIC |
PureBasic |
Compiler not an interpreter. Many extensions |
Also see:
- C++:
| c++filt |
Demangle C++ symbols |
| SWIG.org |
Interface compiler for wrapper routines which run from test scripts for testing "C" and "C++". Works with Perl, Python, Ruby, and Tcl and allows scripts to invoke "C" and "C++" functions, libraries, etc. |
| ParaSoft C++ Test |
Static source code tester and automated unit test cases. |
- Parasoft C++ Test notes:
- View command line options: cpptest -h
- From directory in which Makefile resides:
[user1@prompt]$ make CC="cpptest -Zms Project-Name"
Project file: /home/user1/C++TestProj/ProjectsFiles/Project-Name.cpf
Options:
- cpptest -Zcpf Project-Name.cpf -Zd off
Turning on/off dynamic analysis. (default is on)
- Command line: cpptest -Zcpf /home/user1/C++TestProj/ProjectsFiles/Project-Name.cpf -Zd off -Zrf Proj-Output-Test-Results.txt
- Launch GUI: c++test &
- C:
| lint |
Where is it??? Try lclint |
| bison |
GNU Project parser generator (yacc replacement) |
| pccts |
Purdue Compiler-Compiler (yacc/lex combo) |
| flex |
fast lexical analyzer generator |
cdecl
c++decl |
Compose C and C++ type declarations |
| CScope |
C source code cross referencing tool |
| cxref |
C source code documentation and cross referencing tool |
- FORTRAN:
| f2c |
Convert Fortran 77 to C or C++ |
- Debuggers:
| gdb [man] |
GNU debugger. Command driven text/console interface. [Tutorial] |
| xxgdb [xxgdb] |
X window system interface to the GNU debugger |
| DDD [man] |
Data Display Debugger. GUI interface for gdb and dbx. |
| GVD |
GtkAda/GNAT Graphical GDB Debugger Interface |
| KDbg |
KDE Desktop Graphical GDB Debugger Interface |
| RHIDE |
Console mode with windows like Borland 3.1 toolset. |
| Insight |
GUI interface to gdb. Works with Source-Navigator IDE |
| xwpe |
Borland C++ console mode IDE clone |
| RogueWave TotalView |
[Commercial] Specialized in debugging multi-threaded software with memory leak detection. Also MPI/OpenMP debugging facilities. |
- Java:
| kaffe |
Java virtual machine |
For a full list of Java tools and JVMs, see the YoLinux Java Tutorial
- Source Code Documentation:
| dOxygen |
Documentation system for C++, C, Java, IDL (Corba,
Microsoft, and KDE-DCOP flavors). Generates on-line documentation (in
HTML) and/or an off-line reference manual (in LaTex)
See YoLinux dOxygen guide |
- Gnome:
| glade |
Visual GUI builder to generate gtk C++ code or Gnome XML interface description to build Gnome GUI applications |
| memprof |
Memory Profiling Tool to profile code, look for memory leaks and monitor code execution. |
For more information, see the YoLinux GTK+ Tutorial
- Motif/LessTiff:
| uil |
Compile Motif scripting interface (Not my 1st choice for Motif programming) |
| xmbind |
configures the virtual key bindings of LessTif |
- General:
| make |
Utility to maintain groups of programs with compiling/linker directives |
| imake |
Utility to generate Makefiles from a template. |
| GNU autoconf |
Tool used to generate configure script. Requires GNU m4. |
| gHex |
Binary Editor and Viewer |
| beav |
Binary Editor and Viewer |
| od |
dump files in octal and other formats. od -c will try to dump everthing as ascii. |
| xxd |
make a hexdump or do the reverse |
| strings |
Print the strings of printable characters found in a file. |
| install |
copy files and set attributes (ginstall) |
| m4 |
Macro language for builing configuration files |
| objdump |
display assembler information from object files |
| nm |
display symbol table from an object file |
| readelf |
Displays information about ELF format object files. |
| ar |
Create, modify, and extract from archives |
| ranlib |
Generate index to archive |
| ldconfig |
determine run-time link bindings |
| ldd |
Print shared library dependencies for an executable
(i.e.: ldd `which xpdf`) |
| GNU libtool |
Used to generate shared libraries. |
| ipcs |
Report interprocess communication facility status for queues, shared memory, semaphores |
| iprm |
Remove queues, shared memory, or semaphores |
- Data Base toolkit:
gdbm
(Includes dbm and ndbm compatability.) |
The GNU database manager. |
| Berkeley DB |
Open Source embedded database system/toolkit. |
| SQLite.org |
Open Source embedded database system/toolkit. |
| Commercial Software Development Tool Vendors: |
| IDE: Integrated Development Environment |
- IDE:
| Eclipse.org |
IBM open source JAVA and C/C++ (with
CDT plug-in) IDE. Included with FC4. Extensible IDE consortium -
Borland, IBM, Red Hat, Rational. Lots of industry backing. (Open Source)
Also see EclipsePluginCentral.com Plugins available for Subversion SCM, XML documents, HEX, ...
Also see: YoLinux C++ Development |
| Anjuta |
C, C++. Written for GTK/Gnome. Solid, simple,
intuitive, bug free IDE for C/C++ development on Linux.
Search/Indexing, edit, compile and debug. Almost no learning curve for
those familiar with IDE's. |
| KDevelop.org |
C++ KDE IDE |
| Sun Studio |
C/C++, FORTRAN IDE for Linux. (Free and supported x86 versions) |
| Source Navigator |
C/C++, FORTRAN, COBOL, Tcl, JAVA, asm editor, cross reference tool, class browser and IDE. |
| wxStudio |
C++ cross platform IDE. Written for wxWindows cross platform GUI framework. |
| Moonshine |
IDE built with Adobe AIR, for AS3/Flex Development. |
| DiaSCE |
C/C++ Gnome code editor. Integrated with Glade GTK GUI builder. (no debugging) |
| Lazarus |
IDE for Free Pascal (GPL'ed compiler) and class libraries which emulate Delphi. |
- Commercial IDE's:
| Metrowerks: CodeWarrior |
Code navigation, compile and compare (cross platform), GNU C++ and JAVA |
| Borland: C++ Builder 5 |
Full IDE. Cross platform desktop apps. |
| Borland: Kylix |
Rapid Application Development (RAD) environment.
Develop for Apache, Databases (Oracle, DB2, Interbase and MySQL), Cross
platform desktop apps. Visual Basic like Language: CLX (Delphi
compatable) |
| TrollTech: Qt |
Cross platform and multi-language application development framework for C++ |
| New Planet Software: Code Medic |
Works with Code Crusader (strong C++) development environment and JX (X-window C++ application framework). |
| C-Forge |
Project management and complete edit/compile/debug
cycle support. Supports CVS, SCCS, RCS, ETAGS, C/C++ and FORTRAN,
Querix 4gl and eRuby, Qt Designer, WxWindows and your wheel mouse. |
| Viosoft: Arriba |
Embedded Software IDE. MS/Visual C++ like IDE for Linux. |
| WindRiver: Workbench |
C, C++ or ADA. Unix or Windows |
| Aligo: Omni Mobile Platform |
Mobile Java development (Cell phones/PDA's) |
| KDE Studio "Gold" |
C++ KDE IDE (Commercial Open Source) |
Also see:
| Memory Debugging Development Tools: |
- Memory Debugging:
| ccmalloc |
ETH Zurich: C/C++, Checks for illegal memory access and leaks. Cannot detect illegal memory reads. |
| GNU Checker |
Warns of using uninitialized variable or memory or unallocated memory. |
| dbmalloc |
C malloc, memory, string, and bstring |
| dmalloc |
C malloc, realloc, calloc, free. Memory-leak tracking, fence-post write detection, file/line number reporting. Portable replacement C libraries memory allocation routines with debugging and statistics gathering. |
| Electric Fence |
malloc() debugger. Stops program on the instruction that overruns or under-runs a malloc buffer. Catches buffer overruns by using write protected pages to guard memory. |
| fda |
FDA provides a toolkit for validating pointers, checking for leaks, gathering memory statistics, bounds checking... |
| Leak Tracer |
C++ program for checking memory leaks. |
| libcw |
Full-featured debugging support library for C++ developers. |
| libsafe |
Detect and handle buffer overflow and format string
vulnerabilities before the hackers do. (Middleware software, not
compiled in) |
| Valgrind MemCheck |
Part of the KDE Valgrind
toolset. C/C++ memory supervision. Intercepts malloc/new/free/delete.
Detects memory leaks, uninitialised memory, inappropriate read/write of
stack and malloc'ed blocks, some pthread errors. Valgrind modifies its object as it is running to detect memory errors. Valgrind detects memory leaks by scanning memory. Valgrind HOWTO
This tool is often rated the best Open Source memory debugging tools. |
| Memleak |
Part or X11R6.4 |
| Memdebug |
|
| MemProf |
Red Hat GUI (Gtk/Gnome) tool for profiling and leak
detection. Preloads it's own runtime library. Supports threaded and
forked programs. |
| MM |
Shared memory abstraction layer library. |
| mpatrol |
Profile and log/trace malloc/free/new[] |
| mpr |
Log malloc/free calls |
| NJAMD |
Replaces malloc. Looks for overflows,underflows, writes to freed memory, leaks. C/C++, thread safe. |
| YAMD |
Yet Another Malloc Debugger: C/C++ |
| gcc w/ bounds checking |
GCC bounds checking compiler patch. Adds the -fbounds-checking flag to gcc. |
| Cacheprof |
Profile/investigate cache effects in x86 programs.
Works with gcc compiler: cacheprof gcc -O -o myprog myprog.c. |
- Commercial Memory debugging tools:
| Aprobe |
Memory and performance audits. |
| Etnus TotalView |
Memory leak detection including threaded software. |
| Parasoft: Insure++ |
Memory corruption and memory leak error detection. C/C++ |
| IBM/Rational: Purify |
Runtime memory analysis. Memory corruption and memory leak error detection. C/C++ |
| IBM/Rational: Purify Plus |
Runtime memory analysis, profiling and code coverage. Memory corruption and memory leak error detection. C/C++ |
- Parasoft Insure++ Notes/Example:
-
Configure Insure++:
- Add to path in .bash_profile: /opt/parasoft/Insure++/bin.linux2/cpp/
- turn on graphical interface:
Add to the file /opt/parasoft/Insure++/.psrc
-
Compile/run:
- Test with example: cd /opt/parasoft/Insure++/examples/cpp/
- Compile: insure -g -o leak leak.C
- Run: ./leak
Output from run:
- Alternate memory functions:
Commercial Design Tools:
Software Requirements Management Tools:
- aNimble - Grails/web based Requirements Management tools. Based on OSRMT.
[download]
- OSRMT - Desktop GUI application
- rmtoo - Text and command line based. Generates dependency graphs and requirements docs.
Rmtoo text files CM'ed with source.
| CM: Software Change Management and Configuration Management: |
Change Management (CM) Versioning systems and control:
-
- GNU gmake/make: GNU make is a build system based on the original UNIX "make" build system but with more features. Install RPM package: make
GNU make manual
- scons: Newer python based, cross platform build system. Great for cross platform development (i.e. MS/Windows and Linux/Unix)
- Apache ANT: XML based build tool. Built-in support for Java
- Apache Maven: XML based Java project build, reporting and documentation tool. Supports plug-ins for additional support
| Application Lifecycle Management (ALM): |
ALM systems integrate the software process from requirements through design, project management and task decomposition, assingment, coding, documentation, builds, testing, bug reporting all the way to requirements verification and release (or so they claim).
ALM tool (framework) License | CM SVN | CM Git | Wiki | Req | Task & Bug track | Peer review | Agile | Comments |
Endeavour Java/Tomcat GNU | Y | N | Y | Y | Y | N | N | ALM layer on top of the following individual components: JamWiki, Jenkins, Sventon, Subversion and JForum. Sill acts like separate products and not yet fully integrated. Requirements support still needs work. Supports Gant chart. |
Codebeamer Java/Tomcat commercial product | Y | Y | Y | Y | Y | N | N | MS/Word document import/export for requirements. Authenticated with LDAP server. Did not get Git integration working. From Germany |
Codendi Java/Php commercial and GNU community edition | Y | Y | Y | Y | Y | N | N | Requirements and requiremnts trace. Difficult to install, if not impossible. From France |
Codebeamer was the most promising ALM tool I tested. Due to tight integration with wiki, task and bug tracking and CM, I still prefer Trac even though it is not a true ALM tool.
Trac does have extensive plugin support to extend basic capabilities and can be customized into the system you want.
| GNU Makefile for cross platform deployment: |
GNU Makefile OS dependencies:
Makefiles can use defined OS variables. Cygwin sets $OS to
"MS/Windows-Cygwin". This does not seem to be set for other OS's but
can be set in the system profile or it can be explicitly set as in the
example below.
-
OS = $(shell uname -s)
ifeq "$(OS)" "CYGWIN_NT-5.0"
OS_DIR = win-i32
CC = /usr/bin/g++
CPPFLAGS = -g -mms-bitfields -mno-cygwin -mwindows
LDFLAGS = -g -mms-bitfields -mno-cygwin -mwindows
AR = /usr/bin/ar
CP = /usr/bin/cp
MKDIR = /usr/bin/mkdir
RM = /usr/bin/rm
ECHO = /usr/bin/echo
TOUCH = /usr/bin/touch
endif
ifeq "$(OS)" "Linux"
OS_DIR = linux-i32
CC = /usr/bin/g++
CPPFLAGS = -g
LDFLAGS = -g
AR = /usr/bin/ar
CP = /bin/cp
MKDIR = /bin/mkdir
RM = /bin/rm
ECHO = /bin/echo
TOUCH = /bin/touch
endif
ifeq "$(OS)" "SunOS"
OS_DIR = sun-sparc
CC = /usr/local/bin/g++
CPPFLAGS = -g
LDFLAGS = -g
AR = /usr/ccs/bin/ar
CP = /bin/cp
MKDIR = /bin/mkdir
RM = /bin/rm
ECHO = /bin/echo
TOUCH = /bin/touch
endif
ifeq "$(OS)" "IRIX64"
# SGI
OS_DIR=sgi-mips
CC=/usr/bin/CC
CPPFLAGS = -g -c -LANG:std -n32 -ptused
LDFLAGS = -v -g -LANG:std -n32 -ptused
AR = /usr/bin/ar
CP = /usr/bin/cp
MKDIR = /sbin/mkdir
RM = /sbin/rm
ECHO = /sbin/echo
TOUCH = /sbin/touch
endif
...
help:
@-$(ECHO) "make all - builds executable/library"
@-$(ECHO) "make install - installs components"
@-$(ECHO) "make clean - removes object files and executable/library"
@-$(ECHO) "make clean_all - removes all object files, executable/library, ..."
...
|
Also see YoLinux C/C++ gcc/g++ cross platform tips
Note that the following test frameworks are often used for Test Driven Development (TDD) and in Contiuous Integration (CI) implementations to provide a unit test infrastructure.
Test Frameworks:
- C/C++:
- Java:
Note that the "Mock" frameworks provide a mockup of classes which interface with the class being tested.
This is required when unit testing a class which depends on other classes for its' own operation and function.
Acceptance Test Frameworks:
- FIT
- Slim (FIT clone but coded for better integration with FitNesse)
- FitNesse (Web/Wiki front-end to FIT and Slim)
Web testing:
- iOpus: iMacros - Automate Firefox
- Selenium - Web application testing system. Firefox plug-in
- Watir - Automate web browser for web testing
Also see our Continuous Integration (CI) build server tutorials:
(Unit tests usually included with CI implementations)
Wikipedia list of unit testing frameworks
| Automated Nightly / Continuous Build, Integration and Test Systems: |
Automated Nightly/Continuous Build and reporting systems:
- Jenkins: MIT licensed, written in Java, runs in servlet container, supports CVS, Subversion, Ant, Maven, and shell scripts.
YoLinux.com: Jenkins installation and configuration
- Cabie: Distributed and multiplatform build servers. (Perl, MySQL) Configured for use with Subversion, CVS or Perforce CM systems.
YoLinux.com: Cabie installation and configuration
- BuildBot: Distributed and multi-platform build servers. (Python)
- Tinderbox2: (Mozilla.org project) For use with Bonsai and CVS.
- NightWatch: Java build, JUnit test system (Perl)
- Cruise Control:
Continous build system (build and test after each check-in) based on
ANT, JUNIT, ... Plugins (triggers) for Subversion, Perforce and
Clearcase.
- Apache Continuum: supports Apache Maven and Apache Ant.
Commercial:
- TRAC: Simple, web based, intuitive bug and change tracking. Has a good interface with Subversion. Click around and view a current project using TRAC.
- Tigris.org: Scarab
- From the Subversion crew. Interfaces with Subversion CM revision
control system. Data entry, queries, reports, notifications to
interested parties, collaborative accumulation of comments, dependency
tracking. Web based.
- Bugzilla - Database for bugs. Allows people to report bugs and assigns these bugs to the appropriate developers.
- GNATS -
Utilities to formulate and administer a database of Problem Reports
grouped by site-defined "problem categories." Organizes the large
volume of email that flows between end users and software maintainers
by defining a database made up of archived
and indexed email messages.
- SeaPine.com: TestTrack Pro
- Web based defect/bug tracker which integrates with Surround SCM,
Visual SourceSafe, ClearCase, PVCS, Perforce, CVS, StarTeam, and
SourceOffSite.
- IBM/Rational: ClearQuest - works with their Clearcase change management system. Commercial product. Client application and web interface.
Cross Platform API's:
| Software Install/Update systems: |
- Running Red Hat 7.1 (glibc 2.2.2) but compiling for Red Hat 6.2 compatability.
See RELEASE-NOTES
export LD_ASSUME_KERNEL=2.2.5 . /usr/i386-glibc21-linux/bin/i386-glibc21-linux-env.sh
- To add libraries to be included during dynamic linking,
add the entry to the file
/etc/ld.so.conf OR add the the library path to the
environment variable LD_RUN_PATH.
Sample: /etc/ld.so.conf
-
/usr/X11R6/lib /usr/lib ... .. /usr/lib/sane /usr/lib/mysql /opt/lib
|
Add the library path to this file and then execute the command
ldconfig to configure the linker run-time bindings.
You can use the "-f file-name" flag to reference another
configuration file if you are developing for different environments.
See man page for command ldconfig.
- To include the library during execution, add the library path to the environment variable LD_LIBRARY_PATH.
(Linux/Solaris: LD_LIBRARY_PATH, SGI: LD_LIBRARYN32_PATH, AIX: LIBPATH, Mac OS X: DYLD_LIBRARY_PATH, HP-UX: SHLIB_PATH)
- Direct loader to preload a specific shared library before all others: export LD_PRELOAD=/usr/lib/libXXX.so.x; exec program
Also see:
- Including a library in the compile statement: gcc src-file.c -lm -lpthread
The libraries referenced in this example for inclusion during linking
are the math library and the thread library. They are found in
/usr/lib/libm.a and /usr/lib/libpthread.a.
- ld.so - a.out dynamic linker/loader
- Environment variable to highlight warnings, errors, etc: export CC="colorgcc"
- Linux distros and releases:
| Red Hat/Fedora |
Kernel |
Glibc Libraries |
GCC |
| FC 4 |
2.6.11-1.1369 |
glibc-2.3.5-10 |
4.0.0-8 |
| FC 3 |
2.6.9-1.667 |
glibc-2.3.3-74 |
3.4.2-6 |
| FC 2 |
2.6.5-1 |
glibc-2.3.3-27 |
3.3.3-7/3.4.0 |
| FC 1 |
2.4.22-1.2115 |
glibc-2.3.2-101 |
3.3.2-1 |
| RH 9.0 |
|
glibc-2.3.2 |
3.2.2 |
| RH 8.0 |
|
glibc-2.2.93 |
3.2 |
| RH 7.3 |
|
glibc-2.2.5 |
2.96 |
| RH 7.2 |
|
glibc-2.2.4 |
2.96 |
| RH 6.2 |
|
glibc-2.1.3 |
2.91 |
| RH 5.x |
|
glibc-2.0 |
|
| RH 4.x |
|
libc5 |
|
|
| RHEL |
Kernel |
Glibc Libraries |
GCC |
| RHEL6 |
2.6.32-279 |
2.12-1 |
4.4.6 |
| RHEL5 |
2.6.18-8 |
2.5-12 |
4.1.1-53 |
| RHEL4 |
2.6.9-5 |
2.3.4-2 |
3.4.3-9 |
| RHEL3 |
2.4.21-4 |
2.3.2-95.3 |
3.2.3-20 |
| CENTOS |
Kernel |
Glibc Libraries |
GCC |
| Centos4 |
2.6.9-22 |
2.3.4-2.13 |
3.4.4-2 |
| Centos3 |
2.4.21-37 |
2.3.2-95.37 |
3.2.3-53 |
| SuSE Pro |
Kernel |
Glibc Libraries |
GCC |
| 10 |
2.6.13-15 |
|
|
| 9.3 |
2.6.11 |
glibc-2.3.4-23 |
3.3.5-5 |
| 9.2 |
2.6.8-24 |
glibc-2.3.3-118 |
3.3.4-11 |
| 9.1 |
2.6.4-52 |
glibc-2.3.3-98 |
3.3.3-41 |
| 9.0 |
|
glibc-2.3.2 |
3.3.1 |
| 8.2 |
|
glibc-2.3.2 |
3.3 |
| 8.1 |
|
glibc-2.2.5 |
3.2 |
| SuSE Enterprise |
Kernel |
Glibc Libraries |
GCC |
| 9.0 |
2.6.5 |
|
|
|
- How to generate a library:
- Compile: cc -c ctest1.c ctest2.c
- Create library "ctest.a": ar -cvq ctest.a ctest1.o ctest2.o
- List files in library: ar -t ctest.a
- Using library: cc -o executable-name prog.c ctest.a
- Example files:
- ctest1.c
- ctest1.c
- prog.c
#include <stdio.h> main() { int x; ctest1(&x); printf("Valx=%d\n",x); }
|
Historical note:
After creating the library it was once necessary to run the command: ranlib ctest.a.
This created a symbol table within the archive. Ranlib is now embedded into the "ar"
command.
- How to generate a shared object: (Dynamically linked object library file.)
-
gcc -fPIC -c *.c gcc -shared -Wl,-soname,libfoo.so.1 -o libfoo.so.1.0 *.o
Notes:
- Option -fPIC: Compiler directive to output position independent code suitable for dynamic linking.
- Pass options to linker: -Wl.
In this example the options to be passed on to the linker are:
"-soname libfoo.so.1".
- Option -shared: Produce a shared object which can then be linked with other objects to form an executable.
- Option -o: Output of operation. In this case the name of the shared object to be output will be "libfoo.so.1.0
Man Pages:
- gcc - GNU C compiler
- ld - The GNU Linker
- Unit test: Testing/Debugging C++ classes (this also applies to C functions)
Create test main program which by default is not compiled.
For debugging and test purposes have the main invoked with a compiler or
makefile flag. Implementing this method allows the test program to always
be available and in sync with the classes and/or functions within the file.
See example C++ (ManageNumbers.cpp) program and test case main.
- Regular compile: g++ -c ManageNumbers.cpp
- Compile for test: g++ -DMAIN -c ManageNumbers.cpp
Note: The GNU gcc group often uses the define flag "TEST".
Create a target in the makefile for the unit test:
-
... testModule1: module1 g++ -DMAIN -c ManageNumbers.cpp ...
|
Also see unit test with CppUnit, a C++ Unit test framework
- Internationalization:
- Message translation see GNU "gettext".
- If available: ./configure --with-included-gettext
- Internationalized packages usually have many `po/LL.po' files, where
LL gives an ISO 639 two-letter code identifying the language.
(i.e. environment variable LANG=en)
- catgets:
- ./configure --with-catgets
- See man page for C function catgets
- Language codes are NOT the same as the country codes given in ISO 3166.
- See man page for C functions setlocale, charsets, unicode
- International character sets: Unicode.org
YoLinux Software Development Tutorials:
Links:
- Tigris.org - Open Source Software engineering, issue tracking and collaberation tools
- ADAhome.com - ADA home page
- ManEdit - GUI tool for creating/editing man pages.
- Programming topics:
Books: |
-
 |
"Advanced Linux Programming"
by Mark Mitchell, Jeffrey Oldham, Alex Samuel, Jeffery Oldham
ISBN # 0735710430, New Riders
Good book for programmers who already know how to program and just need
to know the Linux specifics. Covers a variety of Linux tools, libraries,
API's and techniques. If you don't know how to program, start with a
book on C.
|
|
 |
"Advanced UNIX Programming" Second Edition
by Marc J. Rochkind
ISBN # 0131411543, Addison-Wesley Professional Computing Series
|
|
 |
"Advanced Programming in the UNIX Environment" First Edition
by W. Richard Stevens
ISBN # 0201563177, Addison-Wesley Professional Computing Series
It is the C programmers guide to programming on the UNIX platform.
This book is a must for any serious UNIX/Linux programmer. It covers all
of the essential UNIX/Linux API's and techniques.
This book starts where the basic C programming book leaves off.
Great example code.
This book travels with me to every job I go to.
|
|
 |
"Code Complete: A Practical Handbook of Software Construction"
by Steve McConnell
ISBN # 0735619670, Microsoft Press
This book teaches coding style and maturity to programmers without.
It is software lessons, guidance and experience in a book.
It will make you a better programmer by teaching
you how to code with style and grace.
|
|
 |
"UNIX Network Programming, Volume 1: Sockets Networking API" Third Edition
by W. Richard Stevens, Bill Fenner, Andrew M. Rudoff, Richard W. Stevens
ISBN # 0131411551, Addison-Wesley Pub Co; 3 edition (October 22, 2003)
This book covers POSIX, IPv6, network APIs,
sockets (elementary, advanced, routed, and raw), multicast, UDP, TCP,
Threads, Streams, ioctl. In depth coverage of topics.
|
|
 |
"UNIX Network Programming, Volume 1: Networking APIs - Sockets and XTI" Second Edition
by W. Richard Stevens
ISBN # 013490012X, Prentice Hall PTR
This book covers network APIs, sockets + XTI,
multicast, UDP, TCP, ICMP, raw sockets, SNMP, MBONE. In depth coverage
of topics.
|
|
 |
"UNIX Network Programming Volume 2: Interprocess Communications"
by W. Richard Stevens
ISBN # 0130810819, Prentice Hall PTR
This book covers semaphores, threads, record locking, memory mapped I/O,
message queues, RPC's, etc.
|
|
 |
"Advanced Unix Programming"
by Warren W. Gay
ISBN # 067231990X, Sams White Book Series
This book covers all topics in general: files,
directories, date/time, libraries, pipes, IPC, semaphores, shared
memory, forked processes and I/O scheduling. The coverage is not as in
depth as the previous two books (Stevens Vol 1 and 2)
|
|
 |
"Linux Programming Bible"
by John Goerzen
ISBN # 0764546570, Hungry Minds, Inc
This covers the next step after "C" programming 101.
|
|
 |
"Gnome/Gtk+ Programming Bible"
by Arthur Griffith
ISBN # 0764546406, Hungry Minds, Inc
Covers programming desktop GUI applications with the Gnome/Gtk+ GDK API.
|
|
|
|