TCLUG Development Archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

C++/C linking problems



Hi all,

I just recently joined this group and this is my first post and I will
post a brief intro.
I am an ok C++ programmer with a fairly strong Unix background (Digital
Unix/HP-UX/Solaris).  I recently  just started to port some proprietary
C/C++/*nix code
to gcc and Redhat 6.1.  I have waded through most of the issues but I am
stumped on
why I get tons of "undefined reference to xxxx" - where xxx is generally
either some
kind of global or library function in a C shared library.  My main
source is virtually
all C++.  The compile line looks ok to me (all the includes/libraries
appear to line up).

These last few weeks have been my only significant exposure to gcc/g++.
I am somewhat
convinced I am doing something generically stupid here (as I am not a
full time programmer).
I could fund some serious free beer for anyone who could help me sort
this out.

Here are my (relevant? - many seemingly irrelevant left out) g++
command
line parameters:

g++
-ggdb
-DLINUX
-D_REENTRANT
-DP_THREADS
-fstrict-prototype
-I/opt/mms/include
-I/opt/mms/mlib-I/usr/X11R6/Xm2.1/include
-I/usr/X11R6/include
-I/usr/local/include
-o
Action
Action.C
-L/home/sjp/src/toolkits/libMe
-lMe
-L/usr/local/lib
-L/usr/local/lib/X11
-L/usr/X11R6/lib
-lMrm
-lUil
-lXm
-L/usr/X11R6/lib
-lXt
-lX11
-L/usr/local/lib/gcc
-lcmdline

sjp