hi,
also angenommen du hast 3 source-files
unter linux
1) (main): sdlPathFinder304.cpp (gilt auch fuer c-files)
2) (sub1): sdlAstar304.cpp
3) (sub2): sdlSerialCom304.cpp

jetzt moechtest du eine ausfuehrbare Datei:
dass wird jetzt gemacht: mit einem einfachen script (unter linux)

-----------------------
Code:
#!/bin/sh
# name: compileSDLPathFinderScript304.sh
# dd. 01.10.2010
#
# with: main: sdlPathFinder304.cpp
#       sub1: sdlAstar304.cpp
#       sub2: sdlSerialCom304.cpp
#
echo "Compilation of sdlPathFinder304"
g++ -Wall `sdl-config --cflags` -c sdlPathFinder304.cpp
g++ -c sdlAstar304.cpp 
g++ -c sdlSerialCom304.cpp
g++ -O2 -s `sdl-config --libs` -o sdlPathFinder304 sdlPathFinder304.o sdlAstar304.o sdlSerialCom304.o -lm
echo "CompileSDLPathFinderScript304 is Done"

exit 0
also zuerst wird object-code erzeugt,
dann alles miteinander gelinkt.
selbstverstaendlich kann man das auch mit einem "makefile" machen
aber das wuerde zu weit fuehren.
ich wuerde Dir ein gutes C-buch empfehlen.
gruss nomad