C++ "undefined reference" [not-in-charge] [in-charge]

Chuck Tuffli chuck_tuffli at agilent.com
Mon Oct 6 16:53:57 UTC 2003


It looks like the pcibios.h needs to have

#ifdef __cplusplus
extern "C" {
#endif

...

#ifdef __cplusplus
}
#endif

added to get it to compile.

---chuck

On Mon, Oct 06, 2003 at 03:15:40PM +0100, Hugo wrote:
> Hi!
> 
> 
> I am trying to compile a C++ program for the 1st time but I am having
> some problems.
> 
> I can compile a typical "Hello World" example and I have changed the
> Makefile to use the 'make-cxx-exe', but unfortunately I still have some
> errors.
> 
> 
> The code:
> 
> #include <pcibios.h>
>                                                                                                                                                                             
> int main() {
>                                                                                                                                                                             
>   pcib_init();
>                                                                                                                                                                             
>   return 0;
> }
> 
> The compilation error:
> 
> Undefined reference to 'pcib_init()'
> 
> 
> If I try to compile this code as C instead of C++ it compiles with no
> error.
> 
> 
> What am I forgetting?
> 
> Many thanks,
> HV
> 
> 

-- 
Chuck Tuffli
Agilent Technologies



More information about the users mailing list