VRPN 06.04

VRPN main page

Obtaining VRPN

VRPN Support

Installing and Testing

Compiling and Modifying

Client code

Server code

Troubleshooting

Connections

Logging and Playback

Shared Objects

Sound

Clock Synchronization

Text Messages

Doxygen documentation

VRPN on PDAs

Coming attractions & suggestions

UNC-specific information

Compiling, Linking and Modifying VRPN

(See the page about compiling the sample apps for more information).

This page deals with the mechanics of compiling and linking with VRPN, and describes the source-code control steps involved in modifying the library or adding a server. These instructions are all specific to the installation of VRPN at UNC-Chapel Hill in the department of Computer Science.

Configuring VRPN

Before compiling on any architecture, you should take a look at the file vrpn_Configuration.h and see if you want to change any of the default configuration options. In particular, DirectInput is configured off by default because it requires the Direct X software development kit to be installed in order to compile VRPN. You can comment out or uncomment any of the definitions in the first section of this file to set VRPN to work the way you want it to.

This configuration file uses a Microsoft-specific #pragma to ask it to load libraries used by optional configurations (such as DirectInput and the Adrienne timecode generator) so that you no longer have to specify the libraries in the settings for each project you are building.

Compiling and Linking an application with VRPN

The include files for VRPN are found in the vrpn and quat source directories. The library files are found in `hw_os`/ directories on the different architectures when they are built. A makefile that will compile and link the vrpn_Connection test example is given here, assuming that the example were stored under the name testvrpn.C:

	LIBS = -lvrpn -lquat


	testvrpn: testvrpn.C
		CC $(CFLAGS) -o testvrpn testvrpn.C $(LIBS)

Important safety tips: (1) All projects that are used to build an application using Visual Studio on Windows must use the same code generation method. The VRPN and quat libraries are set by default to use "Debug Multithreaded DLL." This must be the method used by an application, or else the settings in VRPN and quat need be changed (and then the projects cleaned and then rebuilt). To set this for a project, use Project/Settings from the menu, select the C/C++ tab, then use the pull-down menu to switch from General to Code Generation. On the pull-down menu on that page, select Debug Multithreaded DLL. (2) NT programs that link with VRPN must also link with the Windows Sockets library. To set this for a project, use Project/Settings from the menu, select the Link tab, then add wsock32.lib to the end of the list in the Object/library modules entry.

Compiling and linking a server with VRPN

The procedure for this is the same as linking an application under Windows. On Linux or UNIX, you link with '-lvrpnserver' rather than '-lvrpn'

Where's the source?

The source code for VRPN is stored in a Concurrent Version System (CVS) repository at /afs/cs.unc.edu/project/stm/src/CVS_repository. In order to get a current copy of the source, you need to have write permission in the repository. See Russ Taylor (taylorr@cs.unc.edu) for this. Once you have it, you can get a copy by doing:

	setenv CVSROOT /afs/unc/proj/stm/src/CVS_repository
	cd PLACE_YOU_WANT_THE_SOURCE
	cvs checkout vrpn

You can then work on your local copy of the library without changing the version in the repository. The library is compiled by simply typing 'gmake' in the source directory. Source code for various servers can be found under the server_src directory and some example clients can be found in client_src.

Modifying the library

If you are writing code that is part of the library, please see these coding rules.

Once changes are complete and tested on all architectures, the new code can be committed to the repository.

	cd PLACE_WHERE_YOU_PUT_THE_SOURCE/vrpn
	cvs commit

If you are not completely comfortable with this process, please contact Russ Taylor (taylorr@cs.unc.edu) and he'll help with the release and repository update.

See here for some more CVS hints and info.