Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

CS1032 - Cannot define/undefine preprocessor symbols after first token in file

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    CS1032 - Cannot define/undefine preprocessor symbols after first token in file

    Hello All,
    Here is what I have read about this error:

    The #define and #undef preprocessor directives must be used at the beginning of a program, before any other keywords, such as those used in the namespace declaration.
    Here is a screenshot of the code in question:

    Click image for larger version  Name:	screenshot-090322.PNG Views:	0 Size:	97.8 KB ID:	1214260

    Based on what I have read, it would appear I have my #define in the correct position, but it still errors. Any help would be greatly appreciated.

    Thank you for your time,
    Travis Sloneker

    #2
    travisloneker Travis, C# compiler directives relate to defined symbols. Your code is attempting to declare a structure.

    Declare the structure within the body of the program itself. Try including something like this after your struct declaration:
    Code:
    private BarType TypeOfBar;
    Thanks.
    Multi-Dimensional Managed Trading
    jeronymite
    NinjaTrader Ecosystem Vendor - Mizpah Software

    Comment


      #3
      Originally posted by jeronymite View Post
      travisloneker Travis, C# compiler directives relate to defined symbols. Your code is attempting to declare a structure.

      Declare the structure within the body of the program itself. Try including something like this after your struct declaration:
      Code:
      private BarType TypeOfBar;
      Thanks.
      jeronymite - I appreciate the help! After some consideration, I decided a simple string would do what I needed. Thank you once again.

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by NullPointStrategies, Yesterday, 05:17 AM
      0 responses
      53 views
      0 likes
      Last Post NullPointStrategies  
      Started by argusthome, 03-08-2026, 10:06 AM
      0 responses
      130 views
      0 likes
      Last Post argusthome  
      Started by NabilKhattabi, 03-06-2026, 11:18 AM
      0 responses
      70 views
      0 likes
      Last Post NabilKhattabi  
      Started by Deep42, 03-06-2026, 12:28 AM
      0 responses
      44 views
      0 likes
      Last Post Deep42
      by Deep42
       
      Started by TheRealMorford, 03-05-2026, 06:15 PM
      0 responses
      49 views
      0 likes
      Last Post TheRealMorford  
      Working...
      X