Author Topic: What am I looking at here?  (Read 6215 times)

Offline azrael4h

  • Single posting newcomer
  • *
  • Posts: 2
What am I looking at here?
« on: January 07, 2011, 03:24:30 am »
Osiyo, I've been trying to get Codeblocks to decide to work for some time now. I finally got it to realize where the header files are located, and this mess is what popped up:

Code
C:\CodeBlocks\MinGW\lib\gcc\mingw32\4.4.1\include\c++\bits\stringfwd.h|44|error: expected '=', ',', ';', 'asm' or '__attribute__' before '<' token|
C:\CodeBlocks\MinGW\lib\gcc\mingw32\4.4.1\include\c++\bits\stringfwd.h|47|error: expected '=', ',', ';', 'asm' or '__attribute__' before '<' token|
C:\CodeBlocks\MinGW\lib\gcc\mingw32\4.4.1\include\c++\bits\stringfwd.h|50|error: expected '=', ',', ';', 'asm' or '__attribute__' before '<' token|
C:\CodeBlocks\MinGW\lib\gcc\mingw32\4.4.1\include\c++\bits\stringfwd.h|54|error: expected '=', ',', ';', 'asm' or '__attribute__' before '<' token|
C:\CodeBlocks\MinGW\lib\gcc\mingw32\4.4.1\include\c++\bits\stringfwd.h|56|error: expected '=', ',', ';', 'asm' or '__attribute__' before '<' token|
C:\CodeBlocks\MinGW\lib\gcc\mingw32\4.4.1\include\c++\bits\stringfwd.h|59|error: expected '=', ',', ';', 'asm' or '__attribute__' before '<' token|
C:\CodeBlocks\MinGW\lib\gcc\mingw32\4.4.1\include\c++\bits\stringfwd.h|61|error: expected '=', ',', ';', 'asm' or '__attribute__' before '<' token|
C:\CodeBlocks\MinGW\lib\gcc\mingw32\4.4.1\include\c++\cstddef|51|error: expected '=', ',', ';', 'asm' or '__attribute__' before ':' token|
C:\CodeBlocks\MinGW\lib\gcc\mingw32\4.4.1\include\c++\cstddef|52|error: expected '=', ',', ';', 'asm' or '__attribute__' before ':' token|
C:\CodeBlocks\MinGW\lib\gcc\mingw32\4.4.1\include\c++\cwchar|67|error: expected '=', ',', ';', 'asm' or '__attribute__' before ':' token|
C:\CodeBlocks\MinGW\lib\gcc\mingw32\4.4.1\include\c++\cwchar|141|error: expected '=', ',', ';', 'asm' or '__attribute__' before ':' token|
C:\CodeBlocks\MinGW\lib\gcc\mingw32\4.4.1\include\c++\cwchar|143|error: expected '=', ',', ';', 'asm' or '__attribute__' before ':' token|
C:\CodeBlocks\MinGW\lib\gcc\mingw32\4.4.1\include\c++\cwchar|144|error: expected '=', ',', ';', 'asm' or '__attribute__' before ':' token|
C:\CodeBlocks\MinGW\lib\gcc\mingw32\4.4.1\include\c++\cwchar|145|error: expected '=', ',', ';', 'asm' or '__attribute__' before ':' token|
C:\CodeBlocks\MinGW\lib\gcc\mingw32\4.4.1\include\c++\cwchar|146|error: expected '=', ',', ';', 'asm' or '__attribute__' before ':' token|
C:\CodeBlocks\MinGW\lib\gcc\mingw32\4.4.1\include\c++\cwchar|147|error: expected '=', ',', ';', 'asm' or '__attribute__' before ':' token|
C:\CodeBlocks\MinGW\lib\gcc\mingw32\4.4.1\include\c++\cwchar|148|error: expected '=', ',', ';', 'asm' or '__attribute__' before ':' token|
C:\CodeBlocks\MinGW\lib\gcc\mingw32\4.4.1\include\c++\cwchar|149|error: expected '=', ',', ';', 'asm' or '__attribute__' before ':' token|
C:\CodeBlocks\MinGW\lib\gcc\mingw32\4.4.1\include\c++\cwchar|150|error: expected '=', ',', ';', 'asm' or '__attribute__' before ':' token|
C:\CodeBlocks\MinGW\lib\gcc\mingw32\4.4.1\include\c++\cwchar|151|error: expected '=', ',', ';', 'asm' or '__attribute__' before ':' token|
C:\CodeBlocks\MinGW\lib\gcc\mingw32\4.4.1\include\c++\cwchar|152|error: expected '=', ',', ';', 'asm' or '__attribute__' before ':' token|
C:\CodeBlocks\MinGW\lib\gcc\mingw32\4.4.1\include\c++\cwchar|153|error: expected '=', ',', ';', 'asm' or '__attribute__' before ':' token|
C:\CodeBlocks\MinGW\lib\gcc\mingw32\4.4.1\include\c++\cwchar|154|error: expected '=', ',', ';', 'asm' or '__attribute__' before ':' token|
C:\CodeBlocks\MinGW\lib\gcc\mingw32\4.4.1\include\c++\cwchar|155|error: expected '=', ',', ';', 'asm' or '__attribute__' before ':' token|
C:\CodeBlocks\MinGW\lib\gcc\mingw32\4.4.1\include\c++\cwchar|156|error: expected '=', ',', ';', 'asm' or '__attribute__' before ':' token|
C:\CodeBlocks\MinGW\lib\gcc\mingw32\4.4.1\include\c++\cwchar|157|error: expected '=', ',', ';', 'asm' or '__attribute__' before ':' token|
C:\CodeBlocks\MinGW\lib\gcc\mingw32\4.4.1\include\c++\cwchar|158|error: expected '=', ',', ';', 'asm' or '__attribute__' before ':' token|
C:\CodeBlocks\MinGW\lib\gcc\mingw32\4.4.1\include\c++\cwchar|160|error: expected '=', ',', ';', 'asm' or '__attribute__' before ':' token|
C:\CodeBlocks\MinGW\lib\gcc\mingw32\4.4.1\include\c++\cwchar|162|error: expected '=', ',', ';', 'asm' or '__attribute__' before ':' token|
C:\CodeBlocks\MinGW\lib\gcc\mingw32\4.4.1\include\c++\cwchar|163|error: expected '=', ',', ';', 'asm' or '__attribute__' before ':' token|
C:\CodeBlocks\MinGW\lib\gcc\mingw32\4.4.1\include\c++\cwchar|164|error: expected '=', ',', ';', 'asm' or '__attribute__' before ':' token|
C:\CodeBlocks\MinGW\lib\gcc\mingw32\4.4.1\include\c++\cwchar|166|error: expected '=', ',', ';', 'asm' or '__attribute__' before ':' token|
C:\CodeBlocks\MinGW\lib\gcc\mingw32\4.4.1\include\c++\cwchar|169|error: expected '=', ',', ';', 'asm' or '__attribute__' before ':' token|
C:\CodeBlocks\MinGW\lib\gcc\mingw32\4.4.1\include\c++\cwchar|172|error: expected '=', ',', ';', 'asm' or '__attribute__' before ':' token|
C:\CodeBlocks\MinGW\lib\gcc\mingw32\4.4.1\include\c++\cwchar|174|error: expected '=', ',', ';', 'asm' or '__attribute__' before ':' token|
C:\CodeBlocks\MinGW\lib\gcc\mingw32\4.4.1\include\c++\cwchar|176|error: expected '=', ',', ';', 'asm' or '__attribute__' before ':' token|
C:\CodeBlocks\MinGW\lib\gcc\mingw32\4.4.1\include\c++\cwchar|178|error: expected '=', ',', ';', 'asm' or '__attribute__' before ':' token|
C:\CodeBlocks\MinGW\lib\gcc\mingw32\4.4.1\include\c++\cwchar|179|error: expected '=', ',', ';', 'asm' or '__attribute__' before ':' token|
C:\CodeBlocks\MinGW\lib\gcc\mingw32\4.4.1\include\c++\cwchar|180|error: expected '=', ',', ';', 'asm' or '__attribute__' before ':' token|
C:\CodeBlocks\MinGW\lib\gcc\mingw32\4.4.1\include\c++\cwchar|181|error: expected '=', ',', ';', 'asm' or '__attribute__' before ':' token|
C:\CodeBlocks\MinGW\lib\gcc\mingw32\4.4.1\include\c++\cwchar|182|error: expected '=', ',', ';', 'asm' or '__attribute__' before ':' token|
C:\CodeBlocks\MinGW\lib\gcc\mingw32\4.4.1\include\c++\cwchar|183|error: expected '=', ',', ';', 'asm' or '__attribute__' before ':' token|
C:\CodeBlocks\MinGW\lib\gcc\mingw32\4.4.1\include\c++\cwchar|184|error: expected '=', ',', ';', 'asm' or '__attribute__' before ':' token|
C:\CodeBlocks\MinGW\lib\gcc\mingw32\4.4.1\include\c++\cwchar|185|error: expected '=', ',', ';', 'asm' or '__attribute__' before ':' token|
C:\CodeBlocks\MinGW\lib\gcc\mingw32\4.4.1\include\c++\cwchar|186|error: expected '=', ',', ';', 'asm' or '__attribute__' before ':' token|
C:\CodeBlocks\MinGW\lib\gcc\mingw32\4.4.1\include\c++\cwchar|187|error: expected '=', ',', ';', 'asm' or '__attribute__' before ':' token|
C:\CodeBlocks\MinGW\lib\gcc\mingw32\4.4.1\include\c++\cwchar|188|error: expected '=', ',', ';', 'asm' or '__attribute__' before ':' token|
C:\CodeBlocks\MinGW\lib\gcc\mingw32\4.4.1\include\c++\cwchar|189|error: expected '=', ',', ';', 'asm' or '__attribute__' before ':' token|
C:\CodeBlocks\MinGW\lib\gcc\mingw32\4.4.1\include\c++\cwchar|190|error: expected '=', ',', ';', 'asm' or '__attribute__' before ':' token|
C:\CodeBlocks\MinGW\lib\gcc\mingw32\4.4.1\include\c++\cwchar|191|error: expected '=', ',', ';', 'asm' or '__attribute__' before ':' token|
||More errors follow but not being shown.|
||Edit the max errors limit in compiler options...|
||=== Build finished: 50 errors, 0 warnings ===|

It appears to be related to this file, since it keeps popping up in a new tab when I try to build and run.

Code
// String support -*- C++ -*-

// Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009
// Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library.  This library is free
// software; you can redistribute it and/or modify it under the
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 3, or (at your option)
// any later version.

// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
// GNU General Public License for more details.

// Under Section 7 of GPL version 3, you are granted additional
// permissions described in the GCC Runtime Library Exception, version
// 3.1, as published by the Free Software Foundation.

// You should have received a copy of the GNU General Public License and
// a copy of the GCC Runtime Library Exception along with this program;
// see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
// <http://www.gnu.org/licenses/>.

/** @file stringfwd.h
 *  This is an internal header file, included by other library headers.
 *  You should not attempt to use it directly.
 */

//
// ISO C++ 14882: 21 Strings library
//

#ifndef _STRINGFWD_H
#define _STRINGFWD_H 1

#pragma GCC system_header

#include <bits/c++config.h>

_GLIBCXX_BEGIN_NAMESPACE(std)

  template<typename _Alloc>
    class allocator;

  template<class _CharT>
    struct char_traits;

  template<typename _CharT, typename _Traits = char_traits<_CharT>,
           typename _Alloc = allocator<_CharT> >
    class basic_string;

  template<> struct char_traits<char>;

  typedef basic_string<char>    string;

#ifdef _GLIBCXX_USE_WCHAR_T
  template<> struct char_traits<wchar_t>;

  typedef basic_string<wchar_t> wstring;
#endif

#if (defined(__GXX_EXPERIMENTAL_CXX0X__) \
     && defined(_GLIBCXX_USE_C99_STDINT_TR1))

  template<> struct char_traits<char16_t>;
  template<> struct char_traits<char32_t>;

  typedef basic_string<char16_t> u16string;
  typedef basic_string<char32_t> u32string;

#endif

_GLIBCXX_END_NAMESPACE

#endif // _STRINGFWD_H

I'm trying to compile this, just to see if Codeblocks actually works. I've not seen much to say it does; it took me an hour to get it to this point on not-working.

Code
#include <iostream>

int main ()
{
std::cout << "Hello World!\n";
return 0;
}


Thus far, all it's done is make my nostalgic for the days when DevC++ was all I had, and since it pretty much worked, I had no problems with that. Since Dev C++ is no longer updated, and I'm in Win7 (and thus probably won't be able to get it to work anyway), I'm pretty much stuck with this, or Eclipse. And I've been trying to get Eclipse to at least leave an error message before it crashes.

So what am I looking at? I'm not a good programmer (I'm learning, and that's about the best I can say for it), and so as far as I can tell the stringfwd.h file is not written correctly. I don't want to try and fix it myself, because frankly I have no clue whats wrong, or even if my guess is remotely close. The code I'm using to test I double checked across two different books, just to make sure I've got that right. 

Offline stahta01

  • Lives here!
  • ****
  • Posts: 7592
    • My Best Post
Re: What am I looking at here?
« Reply #1 on: January 07, 2011, 04:13:14 am »
Turn on Full Compiler Logging
http://wiki.codeblocks.org/index.php?title=FAQ#Q:_How_do_I_troubleshoot_an_compiler_problem.3F

Since your are a experienced programmer; I think you should be able to see the problem. My guess below.

Note: CB assumes files ending in .c are C Files; not C++ files. This is the normal cause of errors similar to yours.

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 azrael4h

  • Single posting newcomer
  • *
  • Posts: 2
Re: What am I looking at here?
« Reply #2 on: January 07, 2011, 10:26:52 am »
Turn on Full Compiler Logging
http://wiki.codeblocks.org/index.php?title=FAQ#Q:_How_do_I_troubleshoot_an_compiler_problem.3F

Since your are a experienced programmer; I think you should be able to see the problem. My guess below.

Note: CB assumes files ending in .c are C Files; not C++ files. This is the normal cause of errors similar to yours.

Tim S.

You forgot the in at the beginning of experienced. :P To be fair, I did write in CBM BASIC back before dinosaurs were wiped out, and in QuickBASIC I actually finished something. C++ not so much.

That was it; Codeblocks only has the option to save as "C/C++ files", and defaults to .c. I manually changed the source to .cpp and it compiled. Guess I'll have to remember to add the correct extension to all my files.