Hello Greg,

Rose ANSI C++ will not generate the main function. In fact, C++ allows some
C-like items (global functions, global data) that are not generated by the
ANSI C++ add-in(which models only the object oriented features of ANSI C++).

You can however add the main function to the desired source file
and the ANSI C++ add-in will not alter it upon subsequent code generations.
The situation is better for Java, where the main function is actually a
static member function of some class. Therefore, the main function can be
modeled by Rose Java. In general, in order to model a collection of global
functions, you can use a Class Utility in Rose. This has the effect of
making each member function static (and it is supported by the ANSI C++
add-in). 

Regards, Lara

==========================================================================
Solutions knowledge base                     http://solutions.rational.com
==========================================================================
Lara Ziosi                                      Technical Support Engineer
Rational WW Customer Service                             Rational Software 
Phone: +31 (0)20 4546 200                          Fax: +31 (0)20 4546 201
Beechavenue 30  -- 1119 PV Schiphol-Rijk                   The Netherlands
Email: [EMAIL PROTECTED]         http://www.rational.com/support
==========================================================================


-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
Sent: Friday, January 31, 2003 3:30 PM
To: [EMAIL PROTECTED]
Subject: (ROSE) main() in C++ code generated by Rose




All,

This is probably obvious, but I can't see the forest for all the trees in
front of my face.  When generating ANSI C++ code, how do I get Rose to
generate the main() function.  I have a component MainProg that is
stereotyped Main Program, and I have a class keyboardapp that is realized
by my MainProg component and has one operation - void main(int argc, char
*argv) - but all that gives me is a .cpp file with the function
keyboardapp::main(int argc, char *argv) in it (and a .h file with the class
definition for keyboardapp).  How do I get a .cpp file with a simple main
function in it with no class prefix?

Thanks,

Greg Young
Rockwell Collins, Inc

************************************************************************
* Rose Forum is a public venue for ideas and discussions.
* For technical support, visit http://www.rational.com/support
* Only plain-text messages are supported.
* HTML or Rich-Text messages may be rejected.
*
* Post or Reply to: [EMAIL PROTECTED]
* Subscription Requests: [EMAIL PROTECTED]
* Archive of messages:
*    http://www.rational.com/support/usergroups/rose/rose_forum.jsp
* Other Requests: [EMAIL PROTECTED]
*
* To unsubscribe from the list, please send email
*    To: [EMAIL PROTECTED]
*    Subject: <BLANK>
*    Body: unsubscribe  rose_forum
*************************************************************************
************************************************************************
* Rose Forum is a public venue for ideas and discussions.
* For technical support, visit http://www.rational.com/support
* Only plain-text messages are supported.
* HTML or Rich-Text messages may be rejected.
*
* Post or Reply to: [EMAIL PROTECTED]
* Subscription Requests: [EMAIL PROTECTED]
* Archive of messages:
*    http://www.rational.com/support/usergroups/rose/rose_forum.jsp
* Other Requests: [EMAIL PROTECTED]
*
* To unsubscribe from the list, please send email
*    To: [EMAIL PROTECTED]
*    Subject: <BLANK>
*    Body: unsubscribe  rose_forum
*************************************************************************

Reply via email to