linking it right.

Eric Tchepannou etchepannou@hotmail.com
Fri Mar 2 05:51:00 GMT 2001


Hi all,


   I have created a library from a C program and would lie to use it in 
another C++ programm. This lead to some problems. Can somebody please help 
me?

Desc.:

	1 - At the beginning I have lex and yacc files:
        	famcheck.y -- with the method int famcheck (char *) famcheck.lex

        2 - With lex famcheck.lex and yacc famcheck.y I create 2 .c files:
      		lex.yy.c
                y.tab.c

	3 - gcc -c *.c and then ar -cr *.o ==> ../lib/libfamcheck.a

	4 - I have a header file named dc_famcheck.h with the prototype
		int famcheck (char *); from (famcheck.y ==>) y.tab.c


Now the other side:

	a - I have the following C++ files:
        	dc_output.cpp
                dc_scan.cpp
                dc_functions.cpp
                depcheck.cpp --this one includes dc_famcheck.h in order to 
use the method int famcheck (char *)

	b - Compilation:
        	g++ -c {dc_output|dc_scan|dc_functions}.cpp and then
                g++ -c depcheck.cpp -L../lib -lfamcheck

	this gives me the error messages:
        	g++: -lfamcheck : linker input file unused since linking not done.

	then creating my executable results to an unsatisfying symbol: int famcheck 
(char*);

PS : I am using SuSE Linux with gcc-2.95.2


Thanx

--
Eric Tchepannou
_________________________________________________________________________
Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com .



More information about the Gcc-help mailing list