This is the mail archive of the
mailing list for the Cygwin project.
RE: Code using archive file that compiles with g++ on linux but gives linking problem with g++ on cygwin
- From: "Dave Korn" <dave dot korn at artimi dot com>
- To: <cygwin at cygwin dot com>
- Date: Wed, 14 Jun 2006 19:10:41 +0100
- Subject: RE: Code using archive file that compiles with g++ on linux but gives linking problem with g++ on cygwin
On 14 June 2006 19:01, Ganesh Ramakrishnan wrote:
> I have an archive libminipar.a. I have a C++ program pdemo.cpp that
> makes use it.
> ... When I compile the program on linux, I get no errors.
> However, when I compile it on cygwin using g++ version 3.4.4, I get
> the following linking error
[ snip bunch of error messages that imply absolutely nothing was found in the
> Any idea why this should happen? I tried to use the -static flag while
> linking on the linux machine and tried using the binary on cygwin. But
> cygwin did not recognize the binary.
Nope, you can't run a linux compiled binary on cygwin; the underlying O/S is
too fundamentally different. Windows doesn't even use ELF format, for a
So cygwin only emulates linux at the source-code level: everything needs to
be recompiled, but it should just recompile and run straightforwardly.
Therefore my guess is that you've tried to just move the library archive
across and use it on the cygwin setup. That also won't work, for exactly the
same reason why moving binaries won't work. The solution is the same as for
binaries: recompile the library from source, so that you've got a
windows-format library archive.
Can't think of a witty .sigline today....
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple
Problem reports: http://cygwin.com/problems.html