help-gplusplus
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: HP-UX 11i unsatisfied symbols for libtar


From: Paul Pluzhnikov
Subject: Re: HP-UX 11i unsatisfied symbols for libtar
Date: Thu, 28 Sep 2006 08:42:36 -0700
User-agent: Gnus/5.1006 (Gnus v5.10.6) XEmacs/21.4 (Jumbo Shrimp, linux)

zhendershot@gmail.com writes:

> /usr/ccs/bin/ld: Unsatisfied symbols:
>   tar_close(TAR*)   (first referenced in /var/tmp//ccHgOOyd.o) (code)

Read up on name mangling.
The problem is that the symbols you have in libtar.a are "plain-C"
unmangled symbols, but the symbols you need are C++-mangled ones.

In C++ code, don't do this:

  extern int tar_extract_all(TAR*, char*);

do this instead:

  extern "C" int tar_extract_all(TAR*, char*);

If you are not prototyping these symbols yourself, but include a
header with prototypes, then the bug is in that header (it's not
C++-compatible). The fix:

extern "C" {
  #include "tar.h"
}

Cheers,
-- 
In order to understand recursion you must first understand recursion.
Remove /-nsp/ for email.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]