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
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. A strange error I don't know how to fix

A strange error I don't know how to fix

Scheduled Pinned Locked Moved C / C++ / MFC
helpc++tutorialcsharpvisual-studio
3 Posts 2 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.
  • B Offline
    B Offline
    b_girl
    wrote on last edited by
    #1

    I'm using VC++ 6.0 Yesterday I was working on one of my class files, just adding a couple if statements and such, nothing big. After I was done, I tried compiling and I'm now getting some errors that I have no clue how to fix. This class file compiled and ran just fine before I added this additional code, so to try to isolate the problem, I commented out what I had done yesterday and tried compiling again, but I'm still getting the same errors. It almost seems as though my header file, containing all the function definitions, isn't being completely recognized. For example, one of the errors is: C:\Program Files\Microsoft Visual Studio\MyProjects\GUPIXWIN\CreateMegaFile.cpp(603) : error C2601: 'CreateBatchModeString' : local function definitions are illegal All the errors are exactly the same, it's just that the function name (enclosed in single brackets above) changes. I'm getting this same error for 6 of my functions, which are all defined within the included header file: CreateMegaFile.h This is the format of the function definitions within my header file, and clearly there's nothing wrong with these definitions!:

    CString CreateSetupString();			
    CString CreateSampleStructureString();	
    CString CreateDefineMatrixString();		
    CString CreateDefineTraceString();		
    CString CreateDefineFitString();		
    CString CreateDefineInvisibleString();	
    CString CreateBatchModeString();		
    CString CreateSpectrumFitString();		
    CString CreateBackgroundEdgeString();	
    CString CreateDigitalFilterString();	
    CString RemoveElementSymbol(CString original);	
    CString BreakString(CString cstr, int pos);
    

    the last 6 functions are the ones that are giving the errors. Yesterday, when I was adding code into this class file, I wasn't touching any of the code within those last 6 functions. I was adding code into the first one. Does anybody know what's going on here?! Thanks.

    D 1 Reply Last reply
    0
    • B b_girl

      I'm using VC++ 6.0 Yesterday I was working on one of my class files, just adding a couple if statements and such, nothing big. After I was done, I tried compiling and I'm now getting some errors that I have no clue how to fix. This class file compiled and ran just fine before I added this additional code, so to try to isolate the problem, I commented out what I had done yesterday and tried compiling again, but I'm still getting the same errors. It almost seems as though my header file, containing all the function definitions, isn't being completely recognized. For example, one of the errors is: C:\Program Files\Microsoft Visual Studio\MyProjects\GUPIXWIN\CreateMegaFile.cpp(603) : error C2601: 'CreateBatchModeString' : local function definitions are illegal All the errors are exactly the same, it's just that the function name (enclosed in single brackets above) changes. I'm getting this same error for 6 of my functions, which are all defined within the included header file: CreateMegaFile.h This is the format of the function definitions within my header file, and clearly there's nothing wrong with these definitions!:

      CString CreateSetupString();			
      CString CreateSampleStructureString();	
      CString CreateDefineMatrixString();		
      CString CreateDefineTraceString();		
      CString CreateDefineFitString();		
      CString CreateDefineInvisibleString();	
      CString CreateBatchModeString();		
      CString CreateSpectrumFitString();		
      CString CreateBackgroundEdgeString();	
      CString CreateDigitalFilterString();	
      CString RemoveElementSymbol(CString original);	
      CString BreakString(CString cstr, int pos);
      

      the last 6 functions are the ones that are giving the errors. Yesterday, when I was adding code into this class file, I wasn't touching any of the code within those last 6 functions. I was adding code into the first one. Does anybody know what's going on here?! Thanks.

      D Offline
      D Offline
      David Crow
      wrote on last edited by
      #2

      b_girl wrote: For example, one of the errors is: C:\Program Files\Microsoft Visual Studio\MyProjects\GUPIXWIN\CreateMegaFile.cpp(603) : error C2601: 'CreateBatchModeString' : local function definitions are illegal This is indicative of an extra, missing, or misplaced curly bracket.


      A rich person is not the one who has the most, but the one that needs the least.

      B 1 Reply Last reply
      0
      • D David Crow

        b_girl wrote: For example, one of the errors is: C:\Program Files\Microsoft Visual Studio\MyProjects\GUPIXWIN\CreateMegaFile.cpp(603) : error C2601: 'CreateBatchModeString' : local function definitions are illegal This is indicative of an extra, missing, or misplaced curly bracket.


        A rich person is not the one who has the most, but the one that needs the least.

        B Offline
        B Offline
        b_girl
        wrote on last edited by
        #3

        DavidCrow wrote: This is indicative of an extra, missing, or misplaced curly bracket. *ahem* yeah... just found it. wow... i feel dumb! i thought i had checked for missing curly brackets before, but i guess i must have skipped over this one by accident. thanks.

        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