[Top][All Lists]

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

Re: [Gnucap-devel] mingw DLL problem

From: David Fang
Subject: Re: [Gnucap-devel] mingw DLL problem
Date: Sat, 3 Nov 2007 01:30:28 -0400 (EDT)

I still can't figure out how to make it work.

Consider the file  ""
extern int bar();
int foo(int q)
 return q*bar();

On Linux, to make a native .so I can do:
       g++ -fPIC --shared
and it builds an appropriate file, such that "bar" will be
resolved later.

The problem is if I do:
       i586-mingw32msvc-g++  --shared
It responds with:
/tmp/ undefined reference to
collect2: ld returned 1 exit status

With a real file, I get a flood of these messages.
What am I doing wrong?

Hi Al,
I don't mean to nag about this again :), but this sort of problem is intended for GNU libtool, whose collection of configure-time checks will answer these questions and more for you (and anyone else) on these platforms, and just Do The Right Thing (TM). I strongly recommend libtoolizing the build, or at least playing around with a toy example to see what it deduces on the target platform. I happen to have a small tutorial/test-case tarball handy, if you'd like a (hopefully unintimidating) example to play with:

(same test case I presented in a address@hidden thread:

This demonstrates plug-in modules done with libtool's libltdl. The test program loads plug-in libraries based on command-line arguments, and confirms each module that is found and loaded. 2 of the tests in the small test-suite are known to fail on darwin (intentionally exposes a difference in rpath-ness between platforms). I don't have a mingw system to test, so I might learn something new from your testing of this.



David Fang
Computer Systems Laboratory
Electrical & Computer Engineering
Cornell University
        -- (2400 baud? Netscape 3.0?? lynx??? No problem!)

reply via email to

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