Code::Blocks Forums

User forums => General (but related to Code::Blocks) => Topic started by: lpcstr on February 05, 2011, 01:41:23 am

Title: MinGW include directories
Post by: lpcstr 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?
Title: Re: MinGW include directories
Post by: stahta01 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.
Title: Re: MinGW include directories
Post by: lpcstr 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.
Title: Re: MinGW include directories
Post by: Jenna 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.
Title: Re: MinGW include directories
Post by: lpcstr 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?
Title: Re: MinGW include directories
Post by: lpcstr 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?
Title: Re: MinGW include directories
Post by: stahta01 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.