next up previous contents
Next: 2.3 Compiling Templates Up: 2 Compiling And Running Previous: 2.1 Introduction

2.2 Avoiding Name Collisions

Some of the global names in our library are simple enough that they may conflict with names used in your code or some other library you use. We have taken the following steps to ensure that such conflicts can be resolved easily - these are based on vague memories of something from the documentation of the InterViews project, so to the degree that the approaches are similar, that project should get the credit. In a header file that defines an obvious name, such as String , we replace (via #define ) that name with some less obvious name, such as Omega_String . This ensures that these obvious names do not appear in the library, even though we use them in our code.

In case of conflict, just #undef the obvious name after the inclusion of omega.h , but before the inclusion of the header file that causes the conflict. For example, if you need to use both the Omega Library and Motif (which defines the name String ), first #include omega.h , then #undef String (or, alternatively, #include omega/basic/leave_String.h , which does this), and then #include the necessary Motif header files.

If you find a conflict in a header that we have not prepared as described above, let us know so that we can fix this in the next release. In the meantime, it should be fairly easy to install this fix yourself and re-compile.



omega@cs.umd.edu