Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. Template related error for non-template code?

Template related error for non-template code?

Scheduled Pinned Locked Moved C / C++ / MFC
helpcsharpc++visual-studioquestion
4 Posts 4 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • F Offline
    F Offline
    Franz Klein
    wrote on last edited by
    #1

    I get the following error messages: c:\C++ Programs\StructViewer\parser.h(48) : error C2061: syntax error : identifier 'name' c:\C++ Programs\StructViewer\parser.h(50) : error C2061: syntax error : identifier 'var_type' for the following section of my code: struct struct_info { struct_info() {}; std::string name; name_extractor variable(name); string var_type; type_extractor variable_type(struct_info::var_type); }; The struct declared above gets passed to a grammar rule that was defined using the Boost library. I am using Visual Studio 2003 on Win XP SP2. I am for the time being ignorant of the cause of the error. Can anyone help? :confused::sigh::confused:

    I am the handsome one in the crowd.

    L N S 3 Replies Last reply
    0
    • F Franz Klein

      I get the following error messages: c:\C++ Programs\StructViewer\parser.h(48) : error C2061: syntax error : identifier 'name' c:\C++ Programs\StructViewer\parser.h(50) : error C2061: syntax error : identifier 'var_type' for the following section of my code: struct struct_info { struct_info() {}; std::string name; name_extractor variable(name); string var_type; type_extractor variable_type(struct_info::var_type); }; The struct declared above gets passed to a grammar rule that was defined using the Boost library. I am using Visual Studio 2003 on Win XP SP2. I am for the time being ignorant of the cause of the error. Can anyone help? :confused::sigh::confused:

      I am the handsome one in the crowd.

      L Offline
      L Offline
      led mike
      wrote on last edited by
      #2

      Franz Klein wrote:

      the cause of the error.

      It would appear you don't have required header files included properly.

      1 Reply Last reply
      0
      • F Franz Klein

        I get the following error messages: c:\C++ Programs\StructViewer\parser.h(48) : error C2061: syntax error : identifier 'name' c:\C++ Programs\StructViewer\parser.h(50) : error C2061: syntax error : identifier 'var_type' for the following section of my code: struct struct_info { struct_info() {}; std::string name; name_extractor variable(name); string var_type; type_extractor variable_type(struct_info::var_type); }; The struct declared above gets passed to a grammar rule that was defined using the Boost library. I am using Visual Studio 2003 on Win XP SP2. I am for the time being ignorant of the cause of the error. Can anyone help? :confused::sigh::confused:

        I am the handsome one in the crowd.

        N Offline
        N Offline
        Nemanja Trifunovic
        wrote on last edited by
        #3

        Franz Klein wrote:

        name_extractor variable(name);

        This looks like a declaration of a member function variable that takes one parameter of unknown type. If you really mean to declare a function, all parameters must have their types declared, i.e. name_extractor variable (std::string& name);


        Programming Blog utf8-cpp

        1 Reply Last reply
        0
        • F Franz Klein

          I get the following error messages: c:\C++ Programs\StructViewer\parser.h(48) : error C2061: syntax error : identifier 'name' c:\C++ Programs\StructViewer\parser.h(50) : error C2061: syntax error : identifier 'var_type' for the following section of my code: struct struct_info { struct_info() {}; std::string name; name_extractor variable(name); string var_type; type_extractor variable_type(struct_info::var_type); }; The struct declared above gets passed to a grammar rule that was defined using the Boost library. I am using Visual Studio 2003 on Win XP SP2. I am for the time being ignorant of the cause of the error. Can anyone help? :confused::sigh::confused:

          I am the handsome one in the crowd.

          S Offline
          S Offline
          Stephen Hewitt
          wrote on last edited by
          #4

          Franz Klein wrote:

          name_extractor variable(name);

          name is not a type.

          Steve

          1 Reply Last reply
          0
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • World
          • Users
          • Groups