[mapserver-users] Java MapScript Win32 DLL

Andrew Collins andrewrcollins at yahoo.com
Tue Oct 8 12:53:35 EDT 2002


Norman

Thanks for the FYI on gcc's ability to make dll's directly.
However I continue to be stuck with problems.

> ====
> at the top of the SWIG generated mapscript_wrap.c file
> you probably need to adjust the #define for DLL linkage to
> something like
> 
> #if defined(_WIN32) || defined(__WIN32__) || defined(__CYGWIN__)
> #       if defined(_MSC_VER) || defined(__CYGWIN__) || defined( __MINGW32__)
> #               if defined(STATIC_LINKED)
> #                       define SWIGEXPORT(a) a

I didn't see any of this in any file I've been dealing
with so far. What are these changes supposed to do?

> Here are the command lines that build python mapscript for me with Cygwin
> the same techniques should work for MingW and java mapscript DLL
> < you will need to change these to reflect you are building the Java
>    library and your local configuration etc. >
> 
> gcc -g -O2 -Wall -Wstrict-prototypes -DUSE_DL_IMPORT -DPROJ=-DUSE_PROJ -DUSE
> _PROJ_API_H -DGD=-DUSE_GD_PNG -DUSE_GD_JPEG -DUSE_GD_WBMP -DUSE_GD_FT -DJPEG
> =-DUSE_JPEG -DIGNORE_MISSING_DATA=-DIGNORE_MISSING_DATA -DOWS=-DUSE_WMS_SVR 
> -DUSE_WMS_LYR -DUSE_WFS_SVR -DEPPL=-DUSE_EPPL -DTIFF=-DUSE_TIFF -DGDAL=-DUSE
> _GDAL -DOGR=-DUSE_OGR -DPOSTGIS=-DUSE_POSTGIS -I../.. -I/usr/local/include -
> I/usr/local/include/python2.1 -c mapscript_wrap.c -o mapscript_wrap.o

The above step is straight forward--I have not had any problems here.
(That I know of.)

> gcc -shared -Wl,--enable-auto-image-base mapscript_wrap.o ../../libmap.a
> /usr/local/lib/ogr.a -L../.. -L/lib -L/usr/local/lib -L/usr/local/lib/python
> 2.1/config -lmap -lgd -lfreetype -lproj -lgdal.1.1 -lpq -lwwwinit -lwwwapp -
> lwwwxml -lxmlparse -lxmltok -lwwwhtml -lwwwtelnet -lwwwnews -lwwwhttp -lwwwm
> ime -lwwwgopher -lwwwftp -lwwwfile -lwwwdir -lwwwcache -lwwwstream -lwwwmux 
> -lwwwtrans -lwwwcore -lwwwutils -lmd5 -lm -lpython2.1 -o _mapscript.dll

This step always spits out linker-related warnings and errors:

Info: resolving _gdFontTiny by linking to __imp__gdFontTiny (auto-import)
Info: resolving _gdFontSmall by linking to __imp__gdFontSmall (auto-import)
Info: resolving _gdFontMediumBold by linking to __imp__gdFontMediumBold
(auto-import)
Info: resolving _gdFontLarge by linking to __imp__gdFontLarge (auto-import)
Info: resolving _gdFontGiant by linking to __imp__gdFontGiant (auto-import)
../../libmap.a(mapogr.o)(.eh_frame+0x11):mapogr.cpp: undefined reference to
`__gxx_personality_v0'
fu000001.o(.idata$3+0xc): undefined reference to `libgd_dll_a_iname'
fu000003.o(.idata$3+0xc): undefined reference to `libgd_dll_a_iname'
fu000005.o(.idata$3+0xc): undefined reference to `libgd_dll_a_iname'
fu000007.o(.idata$3+0xc): undefined reference to `libgd_dll_a_iname'
fu000009.o(.idata$3+0xc): undefined reference to `libgd_dll_a_iname'
nmth000000.o(.idata$4+0x0): undefined reference to `_nm__gdFontTiny'
nmth000002.o(.idata$4+0x0): undefined reference to `_nm__gdFontSmall'
nmth000004.o(.idata$4+0x0): undefined reference to `_nm__gdFontMediumBold'
nmth000006.o(.idata$4+0x0): undefined reference to `_nm__gdFontLarge'
nmth000008.o(.idata$4+0x0): undefined reference to `_nm__gdFontGiant'
make: *** [mapscript_so] Error 1

The above problems with "mapogr.cpp" and "libgd_dll_a_inam" are
the reason I did the following which you state I should not do...

> !!! DO NOT DO THE FOLLOWING !!!
> 
> > $ cd mapserver-3.6.1
> > $ mv lib/libgd.dll.a lib/libgd_dll.a
> > $ mv mapogr.cpp mapogr.c

I understand the entirety of this process in-theory,
but in-practice this whole experience has been nothing
short of damn frustrating.

=====
Andrew Collins - andrewrcollins at yahoo.com
http://profiles.yahoo.com/andrewrcollins/

__________________________________________________
Do you Yahoo!?
Faith Hill - Exclusive Performances, Videos & More
http://faith.yahoo.com



More information about the mapserver-users mailing list