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 CarlTrading, 05-11-2026, 05:56 AM
      0 responses
      65 views
      0 likes
      Last Post CarlTrading  
      Started by CarlTrading, 05-10-2026, 08:12 PM
      0 responses
      40 views
      0 likes
      Last Post CarlTrading  
      Started by Hwop38, 05-04-2026, 07:02 PM
      0 responses
      202 views
      0 likes
      Last Post Hwop38
      by Hwop38
       
      Started by CaptainJack, 04-24-2026, 11:07 PM
      0 responses
      366 views
      0 likes
      Last Post CaptainJack  
      Started by Mindset, 04-21-2026, 06:46 AM
      0 responses
      283 views
      0 likes
      Last Post Mindset
      by Mindset
       
      Working...
      X