don@zardoz.coral.com (Don Dewar) (08/08/90)
I tried to send this to you directly, but failed. Here is my re-broadcast. ) ) ) I have a program which is successfully compiled using Oasys ) C++ and C compilers. Right now I'm trying to change and compile ) it using GNU g++ compiler (with nessessary changes like .hxx into .h; ) .cxx into .cc ; explicitly adding -lg++ flag to my Makefile, etc.) ) But now the problem is linking object codes generated with g++ to ) object codes generated with gcc: ) At first, I compiled my files separately to get object codes. Then, ) I tried to link those object codes together to get the executable version, ) but it gave me error messages that say some of my functions are undefined. ) Here are the error messages: ) ) ------------------------------------------------------------------------------ ) g++ -g tpod.o ../parser/parser.o ../parser/scanner.o ) ../parser/scan_support.o ../parser/gram.o ../hash/hash.o ) ../error/error.o ../tree/tree.o ../list/list.o ../diags/diags.o ) ../mg/model_gen.o ../mg/queueing_model.o ../mg/qm_support.o ) ../qns/qns.o ../qns/solver.o ../expr/expr.o ../expr/stack.o ui_support.o ) -ll -lm -lg++ ) ../parser/scanner.o: Undefined symbol _id_or_res_word referenced from text segment ) ../parser/scanner.o: Undefined symbol _identifier referenced from text segment ) ../parser/scanner.o: Undefined symbol _number referenced from text segment ) ../parser/scanner.o: Undefined symbol _number referenced from text segment ) ../parser/scanner.o: Undefined symbol _string referenced from text segment ) gramxx.y:2132: Undefined symbol yylex() referenced from text segment ) gramxx.y:2147: Undefined symbol yylex() referenced from text segment ) ../error/error.o: Undefined symbol text_msg() referenced from text segment ) ../error/error.o: Undefined symbol text_msg() referenced from text segment ) ../error/error.o: Undefined symbol text_msg() referenced from text segment ) ../error/error.o: Undefined symbol text_msg() referenced from text segment ) ../diags/diags.o: Undefined symbol report_msg() referenced from text segment ) ../diags/diags.o: Undefined symbol report_msg() referenced from text segment ) ../diags/diags.o: Undefined symbol report_msg() referenced from text segment ) ../qns/solver.o: Undefined symbol text_msg() referenced from text segment ) ../qns/solver.o: Undefined symbol text_msg() referenced from text segment ) ../qns/solver.o: Undefined symbol text_msg() referenced from text segment ) ../qns/solver.o: Undefined symbol text_msg() referenced from text segment ) ../qns/solver.o: Undefined symbol text_msg() referenced from text segment ) ../qns/solver.o: More undefined symbol text_msg() refs follow ) ../qns/solver.o: Undefined symbol report_msg() referenced from text segment ) ../qns/solver.o: Undefined symbol report_msg() referenced from text segment ) ../qns/solver.o: Undefined symbol report_msg() referenced from text segment ) ../qns/solver.o: Undefined symbol report_msg() referenced from text segment ) ../qns/solver.o: Undefined symbol report_msg() referenced from text segment ) ../qns/solver.o: Undefined symbol report_msg() referenced from text segment ) ../qns/solver.o: More undefined symbol report_msg() refs follow ) ui_support.c:56: Undefined symbol _parse_sdf referenced from text segment ) ui_support.c:63: Undefined symbol _print_all referenced from text segment ) ui_support.c:66: Undefined symbol _solver referenced from text segment ) *** Error code 1 ) make: Fatal error: Command failed for target `tpod' ) ) ------------------------------------------------------------------------------ ) ) Oh yes, I'm using yacc and lex instead of bison. Is this my problem? ) I have spent a lot of time trying to get rid of these errors with no luck. ) Any idea is greatly appreciated. ) Thanks in advance. ) ) The happiest guy at NOSC, ) ) Anthony Sterrett. ) ) In my last job, we also ported our OASYS compiled C++ (Glockenspiel) to Cfront and G++. Since we had version 1.2E, which appeared well before there was any talk of standardizing to Cfront 2.0, we had to add all the relevant linkage section statements (extern "C" ...) to our include files. Not having linkage defined correctly produced problems similar to the ones you are having. That's my stab at diagnosing your problem. We too were using yacc and lex and had to doctor the output of these files to add the linkage section syntax when calling those functions from g++. +---------+ | Coral | |@@@@@*@**| |@@*@@**@@| Don Dewar |*@@**@@@@| Coral Network Corporation, Marlborough, MA |@***@@@@@| Internet: don@coral.com |@@**@@@@@| Phone: (508) 460-6010 |*********| Fax: (508) 481-6258 |Networks | +---------+