Jump to content
OMRON Forums

What is the command to archive object codes to a static library for linking later on?


hongchinlin_992x
 Share

Recommended Posts

What is the command to archive object codes to a static library for linking later on? I am trying to make the object codes of automatically generated files from RTW into a library for the IDE to call. This way I don’t have to select those auto codes to the IDE folder every time the Simulink model is changed. I use the command “ar –r libac.a a.o b.o” to archive the two object code files “a.o” and “b.o” into a library file “libac.a”. Unfortunately the “ar” command reported “invalid OMF record length 19515”. Any idea? Thanks, HC
Link to comment
Share on other sites

  • Replies 6
  • Created
  • Last Reply

Top Posters In This Topic

I make no claims of being a Linux or GCC expert but my understanding of our IDE in its current state tells me you will not be able to do this. This is because when the IDE wants to build the C-code it uses the GCC cross-compiler and before calling GCC the IDE must build the makefile that GCC will use. Since this makefile is built new each time you build from the IDE you will not be able to permanently add the reference to this library into the makefile. We do want to have a feature to add custom lines to the makefile in the Dec 2010 IDE release. I think you might have better luck making a program that automatically copies these files from the RTW otput locations into the locations expected by the IDE.
Link to comment
Share on other sites

  • 1 year later...
/usr/local/bin/powerpc-405-linux-gnu-ar.exe [quote='hongchinlin_992x' pid='2535' dateline='1318348367'] Could you provide the "ar" program of cygwin? I need this program to create library files. I know the IDE does not accept user-provided library and rewrites the makefile each time. I am using cygwin to directly to compile the model. I will modify the makefile after the IDE generates the first makefile. [/quote]
Link to comment
Share on other sites

  • 4 years later...
Hi, Absolutely. It can only be done for background C apps, however. To do this, it is easiest to make a background C app first (even just a blank one) and build it one time. Then, right-click the C app's folder, go to Properties. At the bottom of the Properties pane, there is a field called "C App Property". Click the button that looks like "..." at the end of this field. There, you can specify the local (PC-side) make file path, local (PC-side) output path, and Power PMAC-side path. You can edit the make file specified by the make file path to add any lines that you need. Another way to add custom code to the project is just to get the source files and stuff them all into your C program's folder. That way, you always have everything within the same project and do not need to worry about custom make files.
Link to comment
Share on other sites

Thank you Charles! I did not know this one. In the configuration manager (Menu>Build/Configuration manager) it is possible to create <> configurations or to <> configurations. In which purposed did you opened this possibility? Can i use it to create/use my own make files? I succeed to create a new one but i can not see what is inside and could not find where it was created. I can not edit it. Do we have access to it ? I have currently 2 needs: - First need: Furnish our code to customers to be included in their projects. We want our code to be unreadable, so compiled as a librairy will be the best. We have functions that need to be executed in capps, but some also in the rtcplc, bgcplc and usercode (c from script and phase). The only solution i see is to be able to link it in the make file.. - Second need: We would like to use rt_queue functions in the rti and bgcplc. I tried to include . From my understanding (i might be wrong), a ".so" (rtcplc & bgcplc) needs its own links to the libs, even when the main application is already using theses libs. So i need the xenomai lib for that (-lxenomai ), which is included in the capps make file, but not in the rtcplc/bgcplc make files. Am I correct? Why did Deltatau choose not to include the xemonai lib in the rtcplc? Was it on purpose?
Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
 Share


×
×
  • Create New...