From: Wheeler, F. (Research) <wh...@cr...> - 2002-05-20 17:46:12
|
Here are some quick notes on my attempts thus far to get VXL to compile under Cygwin. I'm using a very recent (within 2.5 weeks) version of cygwin running under win2k. I'm fairly well satisfied with using cygwin/cmake/Nmake/msvc++ for a complete build and cygwin/cmake/make/gcc for a non-gui build. I'm sending this to the list just to put it on the record in case it is useful to anyone else. Does anybody else care about compiling VXL in cygwin with gcc? Everything compiles great if you use cmake built with msvc++ to build nmake files and then use nmake to compile with msvc++. This is essentially doing what you would do in msvs or in a msdos shell, only with a more convenient unix-like command-line interface. The gcc 2.95.3-5 (the extra 5 is probably a cygwin patch version) that comes with Cygwin compiles cmake and the non-GUI parts of VXL fine with static libraries. gcc 3.0.4 and 3.1 bootstrap out of the box, but give odd linker errors when compiling VXL. That is could be a Cygwin/gcc issue, not a VXL issue. For a shared library build with gcc 2.95.3-5 (cmake -DBUILD_SHARED_LIBS:BOOL=OFF), only 20 libraries (DLLs) got built. I only looked closely at the errors for testlib.dll, which did not get built. It did not build because of an undefined reference to "register_tests()". Perhaps the link line is not issued properly in this environment? I can't get the gui stuff to compile with gcc. VGUI seems to require a flavor of mesa different than that provided with Cygwin (XFree86). Cygwin has no xmesa.h, just osmesa.h. I made a few quick attempts, but doubt it is possible to compile a program with gcc that is to use MFC and MS OpenGL libs. Under Cygwin, gcc is picky about the order of libraries at link time. gcc's info pages imply that this is always the case for gcc, but I have not seen the problem with gcc/binutils under Solaris. I changed several CMakeLists files to help deal with this (include CMakeListsLink of all dependencies) and also some CMake Module files, which only add libraries once, when they are first searched for and found. I've checked in my modified CMakeLists files, but not the Module files yet. The Module file changes are much more drastic, so I'll run them by this list before I commit. There are some examples within oxl, and perhaps elsewhere, that require vgui, but do not test for HAS_OPENGL, which vgui depends on. If all of the vgui stuff only built when HAS_OPENGL is true, then cygwin/gcc would compile cleanly, though incompletely. Fred Wheeler |