News:

When registered with our forums, feel free to send a "here I am" post here to differ human beings from SPAM bots.

Main Menu

MinGW include directories

Started by lpcstr, February 05, 2011, 01:41:23 AM

Previous topic - Next topic

lpcstr

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?

stahta01

Not really a Code::Blocks question
Read my last post on this subject: http://forums.next.codeblocks.org/index.php/topic,14042.0.html

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

lpcstr

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.

Jenna

Quote from: lpcstr on February 05, 2011, 05:34:20 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.

lpcstr

Quote from: jens on February 05, 2011, 08:34:51 AM
Quote from: lpcstr on February 05, 2011, 05:34:20 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?

lpcstr

here is GCC's output on it's search paths:


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?

stahta01

#6
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.
C Programmer working to learn more about C++.
On Windows 10 64 bit and Windows 11 64 bit.
--
When in doubt, read the CB WiKi FAQ. [url="http://wiki.codeblocks.org"]http://wiki.codeblocks.org[/url]