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 8670393
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T18:41:49+00:00 2026-06-12T18:41:49+00:00

I develop C++ programs using a Cygwin installation on top of Windows XP. I

  • 0

I develop C++ programs using a Cygwin installation on top of Windows XP.

I also have MinGW installed, because I want to use it’s version of g++, not the one that comes with Cygwin.

That part seems to be set up correctly. When I start a Cygwin session I see this:

$ which g++
/cygdrive/c/MinGW/bin/g++

This is correct, g++ is pointing to my MinGW install.

What I don’t understand is when I write code that includes library code (for example, header files from the `Winsock/BerkleySockets API), how can I tell where the compiler is finding that header file?

For example, if I have #include "winsock.h" in my code, where does the compiler find that header file?

If I do a general search for winsock.h on my computer, I get this:

C:\MinGW\include
C:\cygwin\usr\include\w32api

Both have a copy of winsock.h (though the file sizes of these aren’t exactly the same, so they can’t be identical).

Thanks for the help.

I should also point out, I have the C:\MinGW\bin in my Windows PATH Environment Variable, as well as that same path configured in my/etc/profile file within Cygwin.

  • 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-06-12T18:41:50+00:00Added an answer on June 12, 2026 at 6:41 pm

    I’m guessing the g++ compiled for MingW has the same command line arguments as the standard g++. Check out the g++ manual page.

    To add include paths to your compilation, use the -I flag.

    g++ -I/include/path/here -I/another/include/path -o prog src.cpp
    

    To add library paths to your linking, use the -L flag.

    g++ -L/lib/path/here -L/another/lib/path -o prog src.cpp
    

    The MingW site explains how the include file search works on MingW, and how to modify it.

    The site also says that if you want to view the include file search while it happens during the compilation, pass the verbose flag (-v) to the compiler.

    g++ -v -o prog src.cpp
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm using xampp on windows 7 to develop my programs but I've got a
I'm using Windows 7 and now I want to develop a program with WMI.
I want to develop a program using VB.Net 2010, and I want to use
What language should I use to develop programs for Nokia/Samsung/LG/Sony Ericsson phones? (Both Symbian
I want to develop an app to display the programs schedule of a specific
I used to develop some Perl programs using Fry::Shell . I think it is
I develop a project using .jar to reuse code. So I have on .jar
I want to use Eclipse to develop C++ projects on Linux. Particularly I want
Does a cloud IDE or another tool exist to develop and compile programs using
I have mac snowleopard 10.6 but i develop lots of programs (in C &

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.