Author Topic: MinGW include directories  (Read 9656 times)

Offline lpcstr

  • Multiple posting newcomer
  • *
  • Posts: 11
MinGW include directories
« on: February 05, 2011, 01:41:23 am »
After installing MinGW on Windows I couldn't compile anything from command line because it doesn't search for headers or libs in the right folders. I installed Code::Blocks and added the directories under compiler options to solve this issue, but now I need to build the Boost library and bjam won't work because when it tries to compile with GCC the standard headers can't be found. How can I fix this?

Offline stahta01

  • Lives here!
  • ****
  • Posts: 7591
    • My Best Post
Re: MinGW include directories
« Reply #1 on: February 05, 2011, 03:07:13 am »
Not really a Code::Blocks question
Read my last post on this subject: http://forums.codeblocks.org/index.php/topic,14042.0.html

Tim S.
C Programmer working to learn more about C++ and Git.
On Windows 7 64 bit and Windows 10 64 bit.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

Offline lpcstr

  • Multiple posting newcomer
  • *
  • Posts: 11
Re: MinGW include directories
« Reply #2 on: February 05, 2011, 05:34:20 am »
Well Tim, that's one long tree of links. I looked through it and none of them point to anything useful.

My problem is that gcc/g++ won't compile anything from command line because it isn't set up to look in the right folders for includes and libs.

If I try to build Boost with bjam --toolset=gcc --prefix=<installpath> install it gives me the same X.h couldn't be found error messages I would get when trying to compile with gcc without specifying -IC:\MinGW\include\ etc.

Offline Jenna

  • Administrator
  • Lives here!
  • *****
  • Posts: 7255
Re: MinGW include directories
« Reply #3 on: February 05, 2011, 08:34:51 am »
My problem is that gcc/g++ won't compile anything from command line because it isn't set up to look in the right folders for includes and libs.
That means your installation is broken.
You should never need to set the includes explicitely.

Offline lpcstr

  • Multiple posting newcomer
  • *
  • Posts: 11
Re: MinGW include directories
« Reply #4 on: February 05, 2011, 11:03:32 am »
My problem is that gcc/g++ won't compile anything from command line because it isn't set up to look in the right folders for includes and libs.
That means your installation is broken.
You should never need to set the includes explicitely.

Well, thanks for telling me it's broken. I installed it using their GUI installer. I tried reinstalling it too, and using an older version just for the sake of trying, and it made no difference. This behavior is the same no matter what.

So maybe you know how to fix it?

Offline lpcstr

  • Multiple posting newcomer
  • *
  • Posts: 11
Re: MinGW include directories
« Reply #5 on: February 05, 2011, 11:27:17 am »
here is GCC's output on it's search paths:

Code
install: 
C:\MinGW\lib\mingw32/4.5.2/

programs:
c:/mingw/lib/../../libexec/gcc/mingw32/4.5.2/;
c:/mingw/lib/../../libexec/gcc/;
C:/MinGW/lib/../../mingw32/bin/mingw32/4.5.2/;
C:/MinGW/lib/../../mingw32/bin/

libraries:
C:/MinGW/lib/mingw32/4.5.2/;
C:/MinGW/lib/;
C:/MinGW/lib/../../mingw32/lib/mingw32/4.5.2/;
C:/MinGW/lib/../../mingw32/lib/;
C:/MinGW/lib/../mingw32/4.5.2/;
C:/MinGW/lib/../;
/mingw/lib/mingw32/4.5.2/;
/mingw/lib/

Needless to say most of these paths are incorrect.

Now how the heck do I change them?

Offline stahta01

  • Lives here!
  • ****
  • Posts: 7591
    • My Best Post
Re: MinGW include directories
« Reply #6 on: February 05, 2011, 04:26:52 pm »
Second post I read saying MinGW.org's GCC 4.5.2 is bad; likely you should try an older or newer version.
Note: I am always using TDM version of MinGW because it works.
http://sourceforge.net/projects/tdm-gcc/

Tim S.
« Last Edit: February 05, 2011, 04:29:15 pm by stahta01 »
C Programmer working to learn more about C++ and Git.
On Windows 7 64 bit and Windows 10 64 bit.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org