News:

Accounts with zero posts and zero activity during the last months will be deleted periodically to fight SPAM!

Main Menu

MinGW has lost Std

Started by danharibo, January 12, 2008, 07:07:14 PM

Previous topic - Next topic

danharibo

I'm trying to use <string>, but when i try and include it, MinGW decides it can't find it.
So i add the folder that string is in, but then i get these errors:
C:\MinGW\include\c++\3.4.5\string:45: bits/c++config.h: No such file or directory
C:\MinGW\include\c++\3.4.5\bits\stringfwd.h:46: error: syntax error before "std"
C:\MinGW\include\c++\3.4.5\bits\stringfwd.h:47: error: syntax error before '{' token
C:\MinGW\include\c++\3.4.5\bits\stringfwd.h:60: error: syntax error before '<' token
C:\MinGW\include\c++\3.4.5\cstddef:50: error: syntax error before "std"
C:\MinGW\include\c++\3.4.5\cstddef:51: error: syntax error before '{' token
C:\MinGW\include\c++\3.4.5\cstring:78: error: syntax error before '{' token
C:\MinGW\include\c++\3.4.5\cstring:101: error: conflicting types for 'memchr'
C:\MinGW\include\string.h:36: error: previous declaration of 'memchr' was here
C:\MinGW\include\c++\3.4.5\cstring:101: error: conflicting types for 'memchr'
C:\MinGW\include\string.h:36: error: previous declaration of 'memchr' was here
C:\MinGW\include\c++\3.4.5\cstring:101: error: `const_cast' undeclared (first use in this function)
C:\MinGW\include\c++\3.4.5\cstring:101: error: (Each undeclared identifier is reported only once
C:\MinGW\include\c++\3.4.5\cstring:101: error: for each function it appears in.)
C:\MinGW\include\c++\3.4.5\cstring:101: error: syntax error before "const"
C:\MinGW\include\c++\3.4.5\cstring:103: error: syntax error before ':' token
C:\MinGW\include\c++\3.4.5\cstring:107: error: conflicting types for 'strchr'
C:\MinGW\include\c++\3.4.5\cstring:107: error: conflicting types for 'strchr'
C:\MinGW\include\c++\3.4.5\cstring:107: error: `const_cast' undeclared (first use in this function)
C:\MinGW\include\c++\3.4.5\cstring:107: error: syntax error before "const"
C:\MinGW\include\c++\3.4.5\cstring:109: error: syntax error before ':' token
C:\MinGW\include\c++\3.4.5\cstring:113: error: conflicting types for 'strpbrk'
C:\MinGW\include\c++\3.4.5\cstring:113: error: conflicting types for 'strpbrk'
C:\MinGW\include\c++\3.4.5\cstring:113: error: `const_cast' undeclared (first use in this function)
C:\MinGW\include\c++\3.4.5\cstring:113: error: syntax error before "const"
C:\MinGW\include\c++\3.4.5\cstring:115: error: syntax error before ':' token
C:\MinGW\include\c++\3.4.5\cstring:119: error: conflicting types for 'strrchr'
C:\MinGW\include\c++\3.4.5\cstring:119: error: conflicting types for 'strrchr'
C:\MinGW\include\c++\3.4.5\cstring:119: error: `const_cast' undeclared (first use in this function)
C:\MinGW\include\c++\3.4.5\cstring:119: error: syntax error before "const"
C:\MinGW\include\c++\3.4.5\cstring:121: error: syntax error before ':' token
C:\MinGW\include\c++\3.4.5\cstring:125: error: conflicting types for 'strstr'
C:\MinGW\include\c++\3.4.5\cstring:125: error: conflicting types for 'strstr'
C:\MinGW\include\c++\3.4.5\cstring:125: error: `const_cast' undeclared (first use in this function)
C:\MinGW\include\c++\3.4.5\cstring:125: error: syntax error before "const"
C:\MinGW\include\c++\3.4.5\cstdlib:85: error: syntax error before '{' token
C:\MinGW\include\c++\3.4.5\cstdlib:123: error: conflicting types for 'abs'
C:\MinGW\include\c++\3.4.5\cstdlib:123: error: conflicting types for 'abs'
C:\MinGW\include\c++\3.4.5\cstdlib:126: error: conflicting types for 'div'
C:\MinGW\include\stdlib.h:376: error: previous declaration of 'div' was here
C:\MinGW\include\c++\3.4.5\cstdlib:126: error: conflicting types for 'div'
C:\MinGW\include\stdlib.h:376: error: previous declaration of 'div' was here
C:\MinGW\include\c++\3.4.5\cstdlib:127: error: syntax error before '}' token
C:\MinGW\include\c++\3.4.5\exception:59: error: syntax error before "const"
C:\MinGW\include\c++\3.4.5\exception:60: error: syntax error before '}' token
C:\MinGW\include\c++\3.4.5\exception:74: error: storage class specified for parameter `terminate_handler'
C:\MinGW\include\c++\3.4.5\exception:76: error: storage class specified for parameter `unexpected_handler'
C:\MinGW\include\c++\3.4.5\exception:79: error: syntax error before "terminate_handler"
C:\MinGW\include\c++\3.4.5\exception:85: error: syntax error before "unexpected_handler"
C:\MinGW\include\c++\3.4.5\exception:100: error: syntax error before "bool"
:: More errors follow but not being shown.
:: Edit the max errors limit in compiler options...
:: === Build finished: 50 errors, 0 warnings ===

The weird thing is, It was working last week..

stahta01

No idea. Are you using Vista? If so, try the steps to fix MinGW again search in the Wiki.

Otherwise, I think I would look at you PATH for other compilers that might be causing issues.
Like an Cygwin in your path can cause issues.

If the above does not work, I would re-install MinGW.

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]

MortenMacFly

Quote from: danharibo on January 12, 2008, 07:07:14 PM
I'm trying to use <string>, but when i try and include it, MinGW decides it can't find it.
Are you sure you have installed the g++ compiler? (not only the gcc core)?!
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: [url="https://www.codeblocks.org/docs/main_codeblocks_en.html"]https://www.codeblocks.org/docs/main_codeblocks_en.html[/url]
C::B FAQ: [url="https://wiki.codeblocks.org/index.php?title=FAQ"]https://wiki.codeblocks.org/index.php?title=FAQ[/url]

danharibo

#3
I Removed the file and Re-Made the class, and the problem disapeared.
:|