X-Recipient: archive-cygwin AT delorie DOT com X-SWARE-Spam-Status: No, hits=-2.4 required=5.0 tests=AWL,BAYES_00,SPF_PASS X-Spam-Check-By: sourceware.org Message-ID: <49C24FD4.2090908@gmail.com> Date: Thu, 19 Mar 2009 13:59:48 +0000 From: Dave Korn User-Agent: Thunderbird 2.0.0.17 (Windows/20080914) MIME-Version: 1.0 To: cygwin AT cygwin DOT com Subject: Re: Message during linking References: In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com Delivered-To: mailing list cygwin AT cygwin DOT com Eric Lilja wrote: > g++ command_line.o grep.o scanner.o -s -o my_grep.exe > Info: resolving typeinfo for std::runtime_error by linking to > __imp___ZTISt13runtime_error (auto-import) > Info: resolving std::cout by linking to __imp___ZSt4cout (auto-import) > Info: resolving std::cerr by linking to __imp___ZSt4cerr (auto-import) > /usr/lib/gcc/i686-pc-cygwin/4.3.2/../../../../i686-pc-cygwin/bin/ld: > warning: auto-importing has been activated without --enable-auto-import > specified on the command line. > This should work unless it involves constant data structures referencing > symbols from auto-imported DLLs. > > What does this mean? Is it a problem? What it means is that ld has not been informed in advance that it needs to assume any undefined symbols in the executable may need to be imported from a dll. Normally it is necessary to modify the source code to add a dllimport declspec/attribute to the declarations of any functions that must be imported. This feature of ld saves having to modify generic Linux source code with annotations everywhere. This usually works, but in some circumstances it will fail, depending on whether certain language constructs involving const data items exist in the code. > Why did it happen? It has started to happen now because libstdc++ is a DLL for the first time. We've fixed upstream ld to enable the feature by default and these warnings will disappear in the next binutils release. > What do I do to fix it? Should I be using some flags now that I didn't even know about > before? The message gives you a clue; since the problem is that " [ ... something has happened ...] without --enable-auto-import specified on the command line", you need to specify --enable-auto-import on the command line. I agree it's over-wordy and confusing, but it's trying to describe a complicated situation. > An executable is generated btw, even if I use -Werror during > linking (but maybe that doesn't have any effect). I expect that -Werror only relates to compiler warnings. > Here's the very simple Makefile that was used: > CXX = g++ > CXXFLAGS = -Wall -Wextra -std=c++98 -pedantic -Werror -c > LDFLAGS = -s -o $(EXEC) Add -Wl,--enable-auto-import to those LDFLAGS. cheers, DaveK -- 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/