Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6677603
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T04:08:32+00:00 2026-05-26T04:08:32+00:00

I am trying to compile the following program: #include <iostream> int main(){ std::cout <<

  • 0

I am trying to compile the following program:

#include <iostream>
int main(){
    std::cout << "Hello, world!";
    return 0;
}

When I compile it, I get this message:

C:\programs>g++ test.cpp
Info: resolving std::cout  by linking to __imp___ZSt4cout (auto-import)
c:/mingw/bin/../lib/gcc/mingw32/4.5.0/../../../../mingw32/bin/ld.exe: warning: a
uto-importing has been activated without --enable-auto-import specified on the c
ommand line.
This should work unless it involves constant data structures referencing symbols
 from auto-imported DLLs.

The build succeeds and the executable runs as expected, but this warning still irritates me. I expect a successful build to be completely silent. This message gives the false impression that there’s something wrong with my code.

I can silence this error with g++ -Xlinker --enable-auto-import test.cpp, but this is undesirable, as it triples the number of characters I need to type to compile a program.

Questions:

  • Why does this warning appear for the simplest of programs? i don’t expect cryptic warnings when I compile Hello World.
  • Is it possible to silence this warning without passing the flag to the linker every time? An option in a config file hidden somewhere in c:\mingw, perhaps? Or maybe I missed an “automatically enable auto-import” checkbox during installation?

Possibly Relevant Specs

  • GCC Version 4.5.0
  • ld.exe Version 2.20.51.20100613
  • Windows XP Service Pack 3
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T04:08:32+00:00Added an answer on May 26, 2026 at 4:08 am

    I did some reading and it looks like it might be related to the mingw32 dll not having dllimport attributes defined.

    Perhaps there is a patch or you can rebuild mingw32 yourself and add them?

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to get the following simple C++ program to compile: #include <stdio.h> #include
I'm trying to use STL, but the following doesn't compile. main.cpp : #include <set>
When I try to compile my program, I get the following error: main.cpp: In
Hey Folks i am trying to compile this C++ program: #include <stdio.h> #include <string.h>
I am trying to compile the following program in windows but I get an
I'm trying to compile this program and I'm having trouble finding the following files
I'm trying to compile the following simple DL library example code from Program-Library-HOWTO with
When trying to compile a file that include winnt.h via windows.h, I get the
So I am trying to run console 64 bit Hello World program. I have
Tying to compile the following program with Visual Studio 10, I get lot of

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.