[Top][All Lists]

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

Re: [Mingw-cross-env-list] libarchive

From: Natalie Tasman
Subject: Re: [Mingw-cross-env-list] libarchive
Date: Wed, 9 Jun 2010 11:46:19 -0700


Here's a small test program for libarchive.  On a native system (OS X 10.6 using macports) it builds without error, while using my current (dev) version of mignw-cross-env I still get errors suggesting the same confusion between static and dynamic declarations ("undefined reference to `__imp__archive_write_new'", etc) with this small test file.

build: <gcc> -o libarchive-test.exe libarchive-test.c -I <include path> -L<lib path> -larchive

-- begin --

/* This file is part of mingw-cross-env.       */
/* See doc/index.html for further information. */

#include <archive.h>
#include <archive_entry.h>

int main(int argc, char *argv[])
  struct archive *tgz;
  tgz = archive_write_new();

  return 0;


Hope this helps, and my thanks,


On Mon, Jun 7, 2010 at 7:24 PM, Volker Grabsch <address@hidden> wrote:
Natalie Tasman <address@hidden> schrieb:
> Thanks again, Volker.  The problem that I'm having is that after those
> warnings, I'm getting a lot of linker errors down the line, such as
> ./.libs/libtpp_common.a(tpp_tarball.o):/Users/natalie/src/tpp/autotools/trans_proteomic_pipeline/src/common/tpp_tarball.cpp:62:
> undefined reference to `__imp__archive_entry_new'"

This looks like a statically referenced library (which is correct)
whose header contain dllimport/dllexport declarations (which is
_not_ correct).

This has nothing to do with the libtool warnings. It is a separate
problem, although it has of course something to do with static

> I will try to come up with a small test program.  Do you want a single C
> file, or a small autotooled project?

Just a single C file, please, and a single command to demonstrate
how to compile it.

You might want to have a look at the existing test files in the "src/"
directory, e.g. "src/sdl-test.c".


Volker Grabsch
NotJustHosting GbR

reply via email to

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