delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2004/12/08/02:01:04

Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/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: <1d7bdfaa04120723007dda7d32@mail.gmail.com>
Date: Wed, 8 Dec 2004 17:00:43 +1000
From: Robert McLeay <rmcleay AT gmail DOT com>
Reply-To: robert AT fearthecow DOT net
To: cygwin AT cygwin DOT com
Subject: Re: Suppressing linking errors with GCC/G++/ld under Cygwin
In-Reply-To: <Pine.GSO.4.61.0412062329590.3217@slinky.cs.nyu.edu>
Mime-Version: 1.0
References: <1d7bdfaa04120618524bec0978 AT mail DOT gmail DOT com> <Pine DOT GSO DOT 4 DOT 61 DOT 0412062329590 DOT 3217 AT slinky DOT cs DOT nyu DOT edu>

Hi again,

Thanks very much for your help. I've been working on this some more,
and I think that the first solution is the better one. The follow is
executed, (excerpt from make's output) with the following errors too.

echo EXPORTS > qa.def
nm code_block.o qa.o qa_options.o | grep '^........ [T] _' | sed
's/[^_]*_//' | sort >> qa.def
ld --base-file qa.base -o qa.exe code_block.o qa.o qa_options.o
-L/opt/local/gnu/lib
ld: warning: cannot find entry symbol _mainCRTStartup; defaulting to 00401000
code_block.o(.text+0xa6):code_block.cc: undefined reference to
`std::basic_ostream....

I know that there's something that I'm overlooking (most likely really
basic and silly to miss), but after staring at all this compiler
output, I swear that my brain has been fried. :)

From the Makefile, the full commands that I am attempting to use are:

# Export symbols
	echo EXPORTS > $(COMMAND.qa).def
	nm $(OBJECTS.qa) | grep '^........ [T] _' | sed 's/[^_]*_//' | sort
>> $(COMMAND.qa).def
# Link the DLL
	ld --base-file $(COMMAND.qa).base -o $(COMMAND.qa).exe $(OBJECTS.qa)
-L/opt/local/gnu/lib  $(EXTRALIBS) $(LDFLAGS)
	dlltool --as=as --dllname $(COMMAND.qa).exe --def $(COMMAND.qa).def
--base-file $(COMMAND.qa).base --output-exp $(COMMAND.qa).exp
	ld --base-file $(COMMAND.qa).base $(COMMAND.qa).exp -o
$(COMMAND.qa).exe $(OBJECTS.qa)  $(BIG_LIBRARY) $(EXTRALIBS)
$(LDFLAGS)
	dlltool --as=as --dllname $(COMMAND.qa).exe --def $(COMMAND.qa).def
--base-file $(COMMAND.qa).base --output-exp $(COMMAND.qa).exp
	ld $(COMMAND.qa).exp -o $(COMMAND.qa).exe $(OBJECTS.qa) 
$(BIG_LIBRARY) $(EXTRALIBS) $(LDFLAGS)
#Build the .a lib to link to
	dlltool --as=as --dllname $(COMMAND.qa).exe --def $(COMMAND.qa).def
--output-lib lib$(COMMAND.qa).a

It's a real pity that the switch -Wl,--out-implib,[name].a doesn't
work. All the same, thanks a heap to all the Cygwin developers - even
though I've run into problems like this, I'd be having a far worse
time without it.

Regards,

Robert.

--
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