delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2003/04/27/10:05:24

Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sources.redhat.com/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sources.redhat.com/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com
Message-ID: <007f01c30cc6$1255d9e0$f76d86d9@ellixia>
From: "Elfyn McBratney" <elfyn-cygwin AT exposure DOT org DOT uk>
To: "cygwin" <cygwin AT cygwin DOT com>, "Joshua Kwan" <joshk AT triplehelix DOT org>
References: <20030427094538 DOT GA29573 AT triplehelix DOT org>
Subject: Re: Creating DLLs doesn't work normally..
Date: Sun, 27 Apr 2003 15:04:21 +0100
MIME-Version: 1.0
X-Priority: 3
X-MSMail-Priority: Normal
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1106

> Hi all,
>
> A number of the projects which I am actively developing I have been
> trying to port to Cygwin. It has mostly gone without errors except when
> making shared libraries. For example:
>
> g++ -lm -lc -Wall -pedantic -ffast-math -g -ggdb -I../../src -I../.. -MD
> -MP -MF  '.depend' -DPLUGIN_BUILD -shared
> -Wl,-soname,static.so -o static.so static.cpp

Well for starters any libraries you link in (-l...) should go right at the
end of the g++ command line. And on Cygwin the '-soname' linker flag doesn't
do anything. Also you don't need to link to -lc on Cygwin, as it's Cygwin
(eg. libc == cygwin1.dll).

>  In file included from static.cpp:10: ../../src/think.h:18:15: warning:
anonymous variadic macros were introduced in C99
>  /cygdrive/c/DOCUME~1/joshk/LOCALS~1/Temp/cc0Qd530.o(.text+0x7c): In
function `module_init':
>  /home/joshk/think++/plugins/osc/static.cpp:38: undefined reference to
`thPlugin::SetDesc(char const*)'
>  /cygdrive/c/DOCUME~1/joshk/LOCALS~1/Temp/cc0Qd530.o(.text+0x143): In
function `module_callback':
>  /home/joshk/think++/plugins/osc/static.cpp:56: undefined reference to
`thNode::SetArg(char const*, float*, int)'
>  collect2: ld returned 1 exit status
>  make[3]: *** [static.so] Error 1
>
> However, on Linux the build executes without a hitch. I tried making .so
> .dll to no effect. This happens with ircd-hybrid too, so I'm wondering
> if I am missing something else. I have pored the archives already and
> I've not found a solution... Tried taking out -lm because it is already
> part of libcygwin. I'm at a total loss.

If you remove the '-soname' linker flag, change `-o soname.so' to `-o
soname.dll' and move '-lm' to the end, you should be alright.

Elfyn


--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019