delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1997/05/27/05:19:10

Date: Tue, 27 May 1997 11:15:25 +0200 (METDST)
From: Robert Hoehne <robert DOT hoehne AT Mathematik DOT TU-Chemnitz DOT DE>
To: Michiel de Jong <michielj AT htsa DOT hva DOT nl>
Cc: djgpp AT delorie DOT com
Subject: Re: Newbie question: Linking in RHide (Samuel Vincent)
In-Reply-To: <3.0.32.19970527010041.006918bc@htsa.htsa.hva.nl>
Message-Id: <Pine.HPP.3.95q.970527110858.19522E-100000@newton.mathematik.tu-chemnitz.de>
Mime-Version: 1.0

On Tue, 27 May 1997, Michiel de Jong wrote:

> the allegro library, and thats working fine. I have the source code of the
> libary and if I include the source in my project I still get these
> "undefined reference" errors, but if i paste the library code into the file
> in which i use the library the erros disappear (except for the part of the
> library source written in assembly, which i cannot paste into the C++ file
> (can I?)). 
> If you have any suggestion, I would be most obliged.

Can it be that your library is C-code and your program is written
in C++?? And in that case you include in your source files the
header file for your library which declares the prototypes of
your functions but they are not surrounded by

#ifdef __cplusplus
extern "C" {
#endif
...
#ifdef __cplusplus
}
endif

If you don't do this, gcc assumes that the functions in your
library are C++ functions which have a different name when they
are C-functions.

BTW: If my guess above is true, then you can see that all
the confusion comes simply by not emitting enough information
about your problem.

Robert
*****************************************************************
* Robert Hoehne, Fakultaet fuer Mathematik, TU-Chemnitz-Zwickau *
* Post:    Am Berg 3, D-09573 Dittmannsdorf                     *
* e-Mail:  Robert DOT Hoehne AT Mathematik DOT TU-Chemnitz DOT DE              *
* WWW:     http://www.tu-chemnitz.de/~rho                       *
*****************************************************************

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019