cygwin-x newbie trying compile a library that uses xwindows.
Michael Rogers <michael_lloyd_rogers <at> yahoo.com>
2008-08-01 16:52:03 GMT
I'm trying to see if I can compile the plasma physics code xoopic (the non-commericial verion) on my
personal laptop using cygwin-x. They have their own library of graphing routines called xgrafix which
uses xwindows. In their pub directory they also have tar files that are just xgrafics distributions
with test code. I do scientific programming on unix systems for a living, so I figured that if I could
get xgrafix to compile and execute its test programs on cygwin-x, then, I should be able get the full
xoopic distribution to compile, perhaps with a little extra work.
I ran the default unix configuration file just to see what it needs. The only show stoppers were that it was
looking for libX11.a, libXpm.a, libtcl.8.4.a and libtk.8.4.a. The last two it pieced together from
info in their respective confxxx.sh scripts. I quickly located the corresponding import libs for
the standard cygwin-x system (I'm fine with the standard dynamic linking, this is for my personal use
recompiling a static distribution is just too much like work for my purposes).
I believe the correct import libs for me would be: libX11.dll.a, libXpm.dll.a, libtcl84.dll.a and
libtk84.dll.a. I seem to recall a couple of other libraries that started with libtcl and libtk so
correct me if I'm wrong. When I just stuck in the absolute path name variables to those import libs in
the configure file, which overrides the tests, it found the import libs and made Makefiles that
actually compiled, including the test.c program. Note that I checked the Makefiles and they had the
right "-l" switches for everything. (The fortran test didn't compile but I can beat that into
submission by myself, later.) But the c test hangs when it runs, probably because the
resulting Makefile didn't link think the libraries correctly. I tried a couple of variations
editing the Makefiles, even using the actuall DLL.s as the libraries but get the same result.
I've gotten spoiled by having a support person for scripts and makefiles and the like for the last
several years and we don't generally use gnu compilers anyway so I'm not sure of the best way to proceed at
this point. So here are my questions:
Question 1.) Currently it is building static archive - xgrafix.a. Since I'm building a graphics library
that links to the X11, Xpm, Tcl and Tk DLLs, do I need to compile it (xgraphics) as a DLL? It might work
either way but I'm fine with whatever works best. To wit, I found the following useful entry in the cygwin
user's guide under "Building and Using DLLs.
-------------------------------------------------------------------------------------------------------------------------------------------------------
However, if you are building a dll as an export library, you will probably want to use the complete syntax:
gcc -shared -o cyg${module}.dll \
(Continue reading)