public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
* linking it right.
@ 2001-03-02  5:51 Eric Tchepannou
  2001-03-02  8:58 ` Alexandre Oliva
  0 siblings, 1 reply; 2+ messages in thread
From: Eric Tchepannou @ 2001-03-02  5:51 UTC (permalink / raw)
  To: gcc-help

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 .

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2001-03-02  8:58 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-03-02  5:51 linking it right Eric Tchepannou
2001-03-02  8:58 ` Alexandre Oliva

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).