From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 19328 invoked by alias); 22 Apr 2002 19:41:55 -0000 Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner@cygwin.com Mail-Followup-To: cygwin@cygwin.com Received: (qmail 19309 invoked from network); 22 Apr 2002 19:41:53 -0000 Received: from unknown (HELO katrina.ibb.gatech.edu) (128.61.131.14) by sources.redhat.com with SMTP; 22 Apr 2002 19:41:53 -0000 Received: from ece.gatech.edu (ibb-429.ibb.gatech.edu [128.61.133.79]) by katrina.ibb.gatech.edu (8.11.6/8.11.6) with ESMTP id g3MJdfe25804; Mon, 22 Apr 2002 15:39:42 -0400 (EDT) Message-ID: <3CC4671C.5070606@ece.gatech.edu> Date: Mon, 22 Apr 2002 12:55:00 -0000 From: Charles Wilson User-Agent: Mozilla/5.0 (Windows; U; Win98; en-US; rv:0.9.4) Gecko/20011019 Netscape6/6.2 X-Accept-Language: en-us MIME-Version: 1.0 To: "Larry Hall (RFK Partners, Inc)" CC: cygwin@cygwin.com Subject: Re: Problems linking program References: <5.1.0.14.2.20020422132917.025e76d0@mail.prefres.com> <4.3.1.2.20020422143622.02a9ff00@pop.ma.ultranet.com> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-SW-Source: 2002-04/txt/msg01227.txt.bz2 Larry Hall (RFK Partners, Inc) wrote: >> ld -shared -o libgd.so.2.0.0 gd.o gd_gd.o gd_gd2.o gd_io.o gd_io_dp.o >>gd_io_file.o gd_ss.o gd_io_ss.o gd_png.o gd_jpeg.o gdxpm.o gdfontt.o gdfonts.o >> gdfontmb.o gdfontl.o gdfontg.o gdtables.o gdft.o gdcache.o gdkanji.o wbmp.o >> gd_wbmp.o gdhelpers.o gd_topal.o -lfreetype -lgd -lz -ljpeg -lpng -lcygwin >>/usr/lib/libcygwin.a(_cygwin_crt0_common.o)(.text+0xe6): undefined reference to >>`GetModuleHandleA@4' > OK. First, you shouldn't need to list -lcygwin. It gets added automatically. > Fortunately now, it should be harmless to list it however. That hasn't always > been the case so it's good not to get in the habit of adding it when it's not > needed. > > 'GetModuleHandle()' is a Win32 API. You apparently have not installed the > w32api package. Rerun setup and do so. Nope -- the problem is he's using 'ld' directly to link the DLL. Don't do that. Instead of 'ld -shared', use 'gcc -shared'. If you MUST pass linker specific options to ld, use '-Wl,--my-ld-option' in your gcc command line. (BTW, naming your dll "foo.so.2.0.0" is a really bad idea. Windows only supports shared libs that end in ".dll".) --Chuck -- Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple Bug reporting: http://cygwin.com/bugs.html Documentation: http://cygwin.com/docs.html FAQ: http://cygwin.com/faq/