building mixed C/C++ programs

Status
Not open for further replies.

kuya

Ars Scholae Palatinae
881
hi all,
how do you get gcc to build a mixed c/c++ program?

i'm using rpcgen to build a networking app on a solaris machine (gcc version 2.95.2).

running rpcgen on my .x file creates the following C files for me
remote_db_clnt.c
remote_db_svc.c
remote_db_xdr.c
remote_db.h

the app involves database'ish code, so i decided to use the string class and map provided by the STL in C++. but i'm having issues building the app using gcc.

% gcc -x c++ remote_db_server.cpp -x c remote_db_svc.c -x cremote_db_xdr.c -lnsl -lsocket

produces the following errors:
Undefined first referenced
symbol in file
cout /var/tmp/ccMhmu6j.o
string_char_traits<char>::compare(char const *, char const *, unsigned int)/var/tmp/ccMhmu6j.o

and then some more linker errors

does anyonne know how to fix this?
 
Status
Not open for further replies.