This is the mail archive of the cygwin mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Message during linking


Hi, I have a small utility written in C++ that I made for cygwin 1.5.x and g++ 3.4.4 a few years ago. I just tried to build it under the latest test release of cygwin 1.7 with the latest test release of g++ 4.3.2. First it didn't compile due to a missing include but I remember that one of the things that has happened with the standard library since the old version is that the number of extra includes you get have been significantly reduced (which I like).
Anyway, I added the missing include and compilation was able to complete, but during the linking phase I saw this:


$ make realclean ; make
rm -f command_line.o grep.o scanner.o my_grep.exe my_grep.exe.stackdump
g++ -Wall -Wextra -std=c++98 -pedantic -Werror -c command_line.cpp
g++ -Wall -Wextra -std=c++98 -pedantic -Werror -c grep.cpp
g++ -Wall -Wextra -std=c++98 -pedantic -Werror -c scanner.cpp
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? Why did it happen? What do I do to fix it? Should I be using some flags now that I didn't even know about before? An executable is generated btw, even if I use -Werror during linking (but maybe that doesn't have any effect).

Here's the very simple Makefile that was used:
CXX = g++
CXXFLAGS = -Wall -Wextra -std=c++98 -pedantic -Werror -c
LDFLAGS = -s -o $(EXEC)
EXEC = my_grep.exe
OBJECTS = command_line.o grep.o scanner.o

all: $(OBJECTS)
	$(CXX) $^ $(LDFLAGS)

command_line.o: command_line.cpp command_line.hpp
	$(CXX) $(CXXFLAGS) $<

grep.o: grep.cpp command_line.hpp scanner.hpp
	$(CXX) $(CXXFLAGS) $<

scanner.o: scanner.cpp scanner.hpp
	$(CXX) $(CXXFLAGS) $<

clean:
	rm -f $(OBJECTS) $(EXEC).stackdump

realclean:
	rm -f $(OBJECTS) $(EXEC) $(EXEC).stackdump

- EL

PS. You don't have to email me directly, I read the list using gmane. DS.


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]