Reprinted please identify Source: http://blog.csdn.net/zgh1988/article/details/7998054
1. You can create two types of projects in tornado environment: a bootable VxWorks image (bootable project) and downloadable application modules (downloadable project ).
2. Downloadable Projects
In the previous section, we have successfully run the Vxworks system, so we need to develop applications on this basis.
(1) create a downloadable Project
(2) Add a file
File --> New --> C/C ++ source file
File Name: Test
(3) Click the test. cpp file to add the code.
# Include <stdio. h>
Void test ()
{
Printf ("Hello VxWorks! \ N ");
}
You may find that there is no main function here, and there is no process concept in VxWorks. Only a task represents a task. So we declare only one function.
(4) Compile and link
The dark buttons on the left are: build project, re-buildall, compile current source file, and update Dependencies from the right to the left. However, the execution order is: update dependencies --> compile current source file --> buildporject
In this case, there will be two files in your project:
(5) Configure target shell
Tools --> target shell --> Configure target servers
Target name/IP address of the target machine
After completing the two configurations, click the "launch" button to start the target server.
(6) download the program
At the top of the re-build button, select target @ pc0326ybv from a drop-down list.
Click Download object file or boot image.
You can either download project1.out or test. O. (Note: The VxWorks system starts at this time ).
Click "--> I", launch Shell
Run the command: moduleshow --> Test
3. Project Guidance
(1) create a bootable Project
(2) file --> New --> C/C ++ source file
File Name: Test
(3) Compile and run the program to create a VxWorks Image
(4) replace D with the VxWorks image generated above: the original VxWorks image under the disk directory.
Re-open the VM, run the VxWorks operating system, and execute the test task. However, an error occurs,
Undefined Symbol: Test
Why is this problem? This is because the file we defined is test. cpp and will be renamed during the compilation process, so test has changed.
So we should do this:
Re-replace D: The image in the directory and re-run the VxWorks operating system. This is the success!