| 6 ratings: |
|
4.16 out of 5   |
Creating Shared Libraries for VxWorks Targets without Wind River
Hardware: PXI/CompactPCI>>Controllers
Problem: I need to deploy a shared library to my cRIO-901x. The library must be a .out file. How can I create a .out file without purchasing the
Wind River Workbench?
Solution: The GNU tool chain distributed with VxWorks can compile shared libraries for controllers running Wind River VxWorks, including the CompactRIO 901x, 902x, and 907x series, and Single-Board RIO series. Standalone copies of the free GNU tool chain for VxWorks 6.1 and 6.3 are attached to this document.
Installing the GNU Tool Chain
- Download the .zip file attached to this KB and extract the files directly to your C: drive.
- The 6.1 download will create a supp and a WindRiver folder on the C: drive. The 6.3 download will create a gccdist folder which contains these folders. Move these folders outside of gccdist and delete the gccdist folder. The docs folder is not necessary but can provide further reference for using the GNU Tool Chain.
- Open the supp folder.
- Right-click setup-gcc.bat and select edit.
- In the batch file, verify that the extraction path, GCCPATH, is set to the C: drive. If necessary, change the line to read: GCCPATH=C:\.
- Save and close the file.
- Open a command prompt by navigating to Start » Run and entering cmd.
- Enter cd C:\supp. This will go to the supp folder in the C: drive.
- Enter setup-gcc.bat. This will run the batch file which installs the GNU Tool Chain.
Note: The WindRiver GNU Toolchain 6.3 and 6.1 do not work on Windows Vista or later.
Running the GNU Tool Chain Example
- In the command prompt, enter cd example. This will go to the example folder.
- Enter make. This will run the example's makefile which creates the .out file.
- Now if you navigate again to C:\supp\example, you will see a folder called PPC603gnu.
- Open PPC603gnu to see the example.out file that was created.
Editing the Makefile to Compile Other .out Files
- In supp, create a new folder for your files.
- Add the .cpp file you wish to convert to the new folder.
- Copy the Makefile in the example folder and paste it to your new folder.
- Right-click Makefile and open it with notepad.
- Change the line OBJECTS := $(OBJ_DIR)/example.o to OBJECTS := $(OBJ_DIR)/yourcppfile'sname.o.
- Change the line PROJECT_TARGETS := $(OBJ_DIR)/example.out to PROJECT_TARGETS := $(OBJ_DIR)/yourcppfile'sname.out.
- In the command prompt, type "cd your new folder's name?" to go to that folder.
- Enter make to run the makefile.
- In your new folder, you will see the PPC603gnu folder created which contains your new .out file.
Note: If you receive an error running your new makefile, it may be necessary to run
setup-gcc.bat again. Just follow Steps 7-9 in Installing the GNU Tool Chain, and try again.
Related Links: Developer Zone Tutorial: Developing Shared Libraries for the cRIO-901x and Other VxWorks Targets KnowledgeBase 44HDTKQ0: Frequently Asked Questions (FAQ) for NI cRIO-901x and cRIO-907x KnowledgeBase 4LRA4IQ0: What Operating System is my Real-Time Controller Running and Why?
Attachments: 
Report Date: 03/02/2009
Last Updated: 03/26/2015
Document ID: 4V1ACUAF