1 ANTLR C++ Support Libraries Additional Notes
3 1.1 Using Microsoft Visual C++
5 Currently this is still (or again) somewhat experimental. MSVC is not the
6 development platform and I don't have access to the compiler currently.
9 Make sure you compile the library *and* your project with the same
10 settings. (multithreaded/debug/etc.)
12 Visual C++ 6 only is supported for static builds. Some hacking and STLPort
13 is needed to build a DLL (only for experts).
15 Visual C++ 7.0 and 7.1 should support both static and DLL builds (DLL
16 builds might be broken). In general the main problem is getting the right
17 template instantiations into the DLL. For 7.0 you might have to tweak the
18 list in lib/cpp/src/dll.cpp. I'm told 7.1 does not need this.
20 For a static build (works probably best)
22 1. Create a win32 static library project.
23 2. Enable RTTI. (Run Time Type Information)
24 3. Add the source files from <installpath>/antlr/lib/cpp/src to the project
25 (except dll.cpp) put <installpath>/antlr/lib/cpp in the search path for
28 For the DLL build (MSVC 7.0 tested)
30 * Project settings ("create new project" dialogs)
32 - Application Settings
37 * Project properties (change defaults to)
38 - Configuration Properties
41 - Additional Include Directories
42 - drive:\antlr-2.7.2\lib\cpp
44 - Preprocessor Definitions
45 - WIN32;_DEBUG;_WINDOWS;_USRDLL;ANTLR_EXPORTS
48 - Multi-threaded Debug DLL (/MDd)
49 - Enable Function-Level Linking:
52 - Enable Run-Time Type Info
55 - Create/Use Precompiled Headers
57 NOTE: Do not use the antlr generated and support library in a multithreaded
58 way. It was not designed for a multithreaded environment.
62 NOTE: outdated the new Makefiles do not support this anymore.
64 It is also possible to build a native binary of ANTLR. This is somewhat
65 experimental and can be enabled by giving the --enable-gcj option to
66 configure. You need a recent GCC to do this and even then the constructed
67 binary crashes on some platforms.
69 2. Tested Compilers for this release
71 Don't get worried if your favourite compiler is not mentioned here. Any
72 somewhat recent ISO compliant C++ compiler should have little trouble with
75 *NOTE* this section was not updated for the new configure script/Makefiles some of the things listed here to pass different flags to configure may not work anymore. Check INSTALL.txt or handedit generated scripts after configure.
79 2.1.1 Sun Workshop 6.0
83 CC: Sun WorkShop 6 2000/08/30 C++ 5.1 Patch 109490-01
85 Compiles out of the box configure using:
87 CXX=CC CC=cc AR=CC ARFLAGS="-xar -o" ./configure
89 Use CC to make the archive to ensure bundling of template instances. Check
94 Tested 3.0.4, 3.2.1, 3.2.3, 3.3.2, 3.4.0.
96 All tested gcc are using a recent GNU binutils for linker and assembler.
97 You will probably run into trouble if you use the solaris
104 Visual C++ 6.0 reported to work well with static build. DLL build not
105 supported (reported to work when using STLPort in previous ANTLR versions).
106 I heart that in some cases there could be problems with precompiled headers
107 and the use of normal '/' in the #include directives (with service pack 5).
109 Visual C++ 7.0 reported to work, might need some tweaks for DLL builds due
110 to some shuffling around in the code.
112 Visual C++ 7.1 reported to work, might need some tweaks, see above.
114 My current guess is that DLL builds are all over the line broken. A
115 workaround is to make a DLL from the complete generated parser including
116 the static ANTLR support library.
120 Not expecting any big problems maybe some tweaks needed in configure.
122 3. Old notes for a number of compilers
124 3.1 SGI Irix 6.5.10 MIPSPro compiler
126 You can't compile ANTLR with the MIPSPro compiler on anything < 6.5.10
127 because SGI just fixed a big bug dealing with namespaces in that release.
129 Note: To get it to compile do basically the following:
131 CC=cc CXX=CC CXXFLAGS=-LANG:std ./configure --prefix=/usr/local/antlr
133 Note probably dates back to 2.7.0-2.7.1 era.
137 It may be you'll have to change one or two static_cast<char*>()'s to a
138 C-style cast. (think that's a compiler bug)
142 CXX=CC CC=cc RANLIB="CC -xar" ./configure
144 The custom ranlib is needed to get the template instances into the archive.
145 Check manpages. Maybe the Sun CC 6 instructions above will work as well.
147 3.3 GCC on some platforms (Alpha Tru64)
149 The -pipe option not supported it seems. Configure using:
151 CFLAGS="-W -Wall" ./configure
153 Or remove the -pipe's from the generated scripts/Config.make.
159 The ANTLR code uses some relatively new features of C++ which not all
160 compilers support yet (such as namespaces, and new style standard headers).
162 At the moment, you may be able to work around the problem with a few nasty
165 Try creating some header files like 'iostream' just containing:
167 #include <iostream.h>
169 and compile with an option to define away the word 'std', such as
173 Also in the antlr subdirectory there's a file config.hpp. Tweak this one to
174 enable/disable the different bells and whistles used in the rest of the code.
175 Don't forget to submit those changes back to us (along with compiler info)
176 so we can incorporate them in our next release!
178 4.2 Reporting problems
180 When reporting problems please try to be as specific as possible e.g.
181 mention ANTLR release, and try to provide a clear and minimal example of
182 what goes wrong and what you expected.
184 Bug reports can be done to Terence or the current subsystem maintainers as
185 mentioned in the doc directory. Another option is to use the mailing list
186 linked from http://www.antlr.org.
188 Before reporting a problem you might want to try with a development
189 snapshot, there is a link to these in the File Sharing section of
191 http://www.antlr.org.