Using ASN1C with Existing Visual Studio Project Files
Visual Studio Projects
ASN1C comes complete with several samples, each of which includes a Visual Studio project file compatible with Visual Studio 2010. (These project files may be imported into newer versions of Visual Studio.) ASN1C versions 6.0 and above also include options to generate project files.
This tutorial describes creating a project file for the Employee sample program found in ASN1C_INSTALL_DIR\cpp\sample_ber\employee. On typical Windows installations, ASN1C_INSTALL_DIR is c:\acv[version], where [version] corresponds to the three digit version number, such as 703.
Following are instructions for using the enclosed project files.
- Before working with the project, the source code for it must be generated, either using the command-line tool or the graphical user interface. Also, the "nmake" command can be used from a Visual Studio 2010 command window after using the "cd" command to change the "employee" directory.
- Open Microsoft Visual Studio (2010 or higher). The details of using a version of Visual Studio newer than 2010 may be slightly different from those presented below.
- From the File menu, choose "Open->Project/Solution..."
- Open the file employee_Writer.vcxproj.
- If you expand the Header Files and Source Files filters, you should see the source files that comprise the writer project.
- Click on the Save All button (the one with multiple disk pictures). Visual Studio will prompt you to save a .sln (solution) file and will suggest the name employee_Writer.sln. Change this name to employee.sln and save the file.
- Right click on "Solution 'employee' " and choose "Add->Existing Project...". Choose the file employee_Reader.vcxproj.
- Right click on the employee_Writer project and select "Set As StartUp Project".
- Select "Build->Build employee_Writer from the menu bar. This action will compile the writer executable.
- Click on the employee_Reader project.
- Select "Build->Build employee_Reader" from the menu bar. This action will compile the reader execucatble.
- Select "Debug->Start Without Debugging" from the menu bar. A Visual Studio terminal window will open, and you will see the content of the writer's execution. Close this window by pressing any key.
- Right click on the employee_Reader project and select "Set As StartUp Project".
- Select "Debug->Start Without Debugging" from the menu bar. A Visual Studio terminal window will open, and you will see the contents of the reader's execution. Close this window by pressing any key.