It is currently Tue Feb 07, 2012 8:36 pm

All times are UTC



Welcome
Welcome to RHAPSODY4YOU

You are currently viewing our boards as a guest, which gives you limited access to view most discussions and access our other features. By joining our free community, you will have access to post topics, respond to polls, upload and download content, and access many other special features. Registration is fast, simple, and absolutely free, so please, register to join our community today.





 Page 1 of 1 [ 4 posts ] 
Author Message
 Post subject: Can I generate a specification (.h) file only
PostPosted: Thu May 21, 2009 8:34 pm 

Joined: Thu Feb 26, 2009 5:25 pm
Posts: 8
Hi,

I wish to be able to define a package that just defines some types. This works OK, but the generated code for the package is a .h file and a .cpp file. The cpp file has no meaningful code, but gets compiled and linked.

This is causing problems when we link in compiled library files that also are based on this package (that just defines types). We get linker errors of multiply defined objects, because each library contains a compiled object code for this package.

The solution would appear to be to just generate a .h file. Can we do this?

Thanks


Offline
 Profile  
 
 Post subject: Re: Can I generate a specification (.h) file only
PostPosted: Thu May 21, 2009 11:30 pm 

Joined: Thu May 21, 2009 11:25 pm
Posts: 12
Dominique wrote:
Hi,

I wish to be able to define a package that just defines some types. This works OK, but the generated code for the package is a .h file and a .cpp file. The cpp file has no meaningful code, but gets compiled and linked.

This is causing problems when we link in compiled library files that also are based on this package (that just defines types). We get linker errors of multiply defined objects, because each library contains a compiled object code for this package.

The solution would appear to be to just generate a .h file. Can we do this?

Thanks


Not sure. But I have done this for functions so that it only generates the function in the .h and not the .cpp. To do this I override the CG->Generate feature to specification. You should check to see if there is something similar in the properties of the package or class.


Offline
 Profile  
 
 Post subject: Re: Can I generate a specification (.h) file only
PostPosted: Thu Sep 17, 2009 12:38 pm 

Joined: Wed Aug 05, 2009 2:46 pm
Posts: 5
Hi,

should be easy.

At first add a file to your component.
In the feature dialogue (general tab) of the file change the type to Implementation.
Switch of the settings
CG:File:AddToMakefile
CG:File:Generate
in the Properties tab of the file.
Switch to the elements tab (of the feature dialogue)
Add the class/file where the types are defined (by using the icons in the upper right)

Please find attached a short example.
But I couldn't test it because I don't have an Developer license on this PC.

Kind Regards
Christian


Attachments:
File comment: Project
Project.zip [2.36 KiB]
Downloaded 23 times
Offline
 Profile  
 
 Post subject: Re: Can I generate a specification (.h) file only
PostPosted: Tue Nov 17, 2009 12:26 pm 

Joined: Thu Oct 02, 2008 11:40 am
Posts: 11
Hi Christian,
I tried the above steps so that it would generate only specification (.h) for the "File" element in my model. But it does generate implementation (.c) and specification (.h) files and also includes in the mak file.
I am using RiC and Rhapsody version is 7.4.

Can any one help me on this?

Cheers,
Kars


Offline
 Profile  
 
Display posts from previous:  Sort by  
 Page 1 of 1 [ 4 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 0 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:

cron

suspicion-preferred