Book a Demo

Author Topic: Issue with Code Generation and Dependencies  (Read 3055 times)

RobOp

  • EA Novice
  • *
  • Posts: 1
  • Karma: +0/-0
    • View Profile
Issue with Code Generation and Dependencies
« on: September 26, 2015, 05:14:50 am »
Hi,

I'm currently having issues generating C code using a class diagram. Specifically, my issue boils down to a struct with an enumeration typed element is generated before the enumerated typedef is generated. I've tried playing with the order in the Project Browser but I can't move the enumeration above the struct, which I assume is what the code generator uses for order.

To reproduce. Create a new class diagram. Add two class items and one enumeration. Change the stereotype on one of the classes to struct and make both the enumeration and struct nested members of the class. Add a couple of attributes to the enumeration and define one member of the struct to be of the enumeration. Generate the code and notice that the struct is defined before the enumeration is defined resulting in a compile error.

Thank you for any help that you can provide.

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +397/-301
  • I'm no guru at all
    • View Profile
Re: Issue with Code Generation and Dependencies
« Reply #1 on: September 26, 2015, 05:43:17 pm »
I can't help much with the code gen templates. But the ordering is one of those strange things in EA. You can not place an arbitrary order on elements in the browser. There is some kind of invisible hierarchy. Eg. diagrams and packages appear first and then other element groups. Within the groups you can rearrange elements, but not outside.

q.