On Wed, Jun 30, 2010 at 10:20 PM, JonY <[email protected]> wrote: > On 7/1/2010 10:21, Paarvai Naai wrote: >> As I have mentioned in some recent emails, I am building my mingw-w64 >> toolchain using upstream binutils-2.20.1, gcc 4.5.0, and >> mingw-w64-v1.0-20100604 snapshot. The host is i386-linux and the >> target is x86_64-w64-mingw32 with multilib support. >> >> I am running into a strange auto-import issue when compiling for C++: >> >> ] /usr/local/gcc/x86_64-windows-gcc/bin/x86_64-windows-g++ -o >> hello.exe hello.cxx >> Info: resolving std::cout by linking to __imp___ZSt4cout (auto-import) >> /usr/local/gcc/x86_64-windows-gcc/lib/gcc/x86_64-w64-mingw32/4.5.0/../../../../x86_64-w64-mingw32/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. >> >> But the libstdc++ library should already be a proper import library: >> /usr/local/gcc/x86_64-windows-gcc/x86_64-w64-mingw32/lib64/libstdc++.dll.a >> >> The test program is again simple: >> -- >> #include<stdio.h> >> #include<iostream> >> using namespace std; >> >> int main (int argc, char *argv[]) >> { >> printf("hello world!\n"); >> cout<< "bye world!\n"; >> return 0; >> } >> -- >> >> I'd prefer not to turn on auto-importing with the --enable-auto-import >> option as it will mask auto-importing in other libraries. Does anyone >> have any idea why this is happening or how to fix it? >> >> Paarvai > > Hi, > > its not due to having libstdc++.dll.a around. Its a warning saying that > gcc and the linker wasn't expecting an import library to be used. The > libstdc++-v3 headers don't have the dllimport statements. > > ktietz has since patched ld to properly do auto-imports with the > --enable-runtime-pseudo-reloc-v2 changes becoming default. In short you > can ignore this warning.
Not only can the warning be ignored, the warning will no longer occur with the binutils from the current trunk HEAD, because --enable-auto-import has now become the default for x86 and x64 mingw targets. I should mention that the auto import warning is basically telling the user that an object was attempting to use symbol foo, and it didn't find foo in any of the libraries, but found __imp_foo in one of the import libraries and is using that instead. With the pseudo-reloc 2 changes, you have to be doing some really really really odd things to run across any issues with enable-auto-import. Doug. ------------------------------------------------------------------------------ This SF.net email is sponsored by Sprint What will you do first with EVO, the first 4G phone? Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first _______________________________________________ Mingw-w64-public mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/mingw-w64-public
