<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html; charset=UTF-8" http-equiv="Content-Type">
<title></title>
</head>
<body text="#000000" bgcolor="#ffffff">
29.1.2011 20:43, Tamas Szekeres kirjoitti:
<blockquote
cite="mid:AANLkTimvfxboJxNYXAa044Jfv-CyS=wW3iOFERVfb2KK@mail.gmail.com"
type="cite">Ari,<br>
<br>
I would be eager to know the exact use case you have. Did you have
some errors provided by the linker in this case?<br>
</blockquote>
<br>
For the stdcall functions I added entries like this<br>
<br>
_CPLDefaultErrorHandler@12<br>
CPLDefaultErrorHandler = _CPLDefaultErrorHandler@12<br>
<br>
to the .def file. I create the .dll.a, which is the import library,
with dlltool from the .def.<br>
<br>
There are no errors from the linker. If I leave the stdcall entries
as they are from pexports, i.e., just<br>
<br>
_CPLDefaultErrorHandler@12<br>
<br>
The linker complains about undefined reference to
`CPLDefaultErrorHandler'<br>
<br>
However, running the Perl tests fail with "The procedure entry point
CPLDefaultErrorHandler could not be located in the dynamic link
library gdal17.dll". This is no wonder since the Perl bindings
GDAL.dll imports CPLDefaultErrorHandler from gdal17.dll. I believe
this because I'm misusing the .def file or dlltool does not
understand that CPLDefaultErrorHandler is an alias to
_CPLDefaultErrorHandler@12.<br>
<br>
I saw a web page which seemed to say that this is a known problem in
dlltool and it had a small hack for dlltool.c to fix the problem,
but I don't find the page just now and I've not yet tried hacking
the dlltool.c (it seems quite possible).<br>
<br>
I think the cdecl functions work ok.<br>
<br>
If I compile GDAL in MSYS, all functions are exported cdecl.<br>
<br>
Ari<br>
<br>
<br>
<blockquote
cite="mid:AANLkTimvfxboJxNYXAa044Jfv-CyS=wW3iOFERVfb2KK@mail.gmail.com"
type="cite">It would indeed be a problem how the various compilers
decorate their export functions in a different way. It looks like
the __declspec(dllexport) option (this is what is used in GDAL)
provides different names with MSVC and MinGW by default. If we
want to compile the dlls in a portable way we should probably get
back to an alternative method like .def file or "#pragma comment(
linker, "/export:FuncName" )" when exporting the functions.<br>
<br>
The article you are referring to describes another way of
providing a portable version that is:<br>
1. Compile the dll as it is now (the functions exported
with__declspec(dllexport)) <br>
2. Extract the export functions in a .def file by using pexports<br>
3. Replace the function names with their undecorated names in the
.def file<br>
4. Recompile the dll with this new export definition file.<br>
<br>
I'm keen to give it a try if I get some further info about how to
test this on the other side.<br>
<br>
<br>
Best regards,<br>
<br>
Tamas<br>
<br>
<br>
<br>
<br>
<div class="gmail_quote">2011/1/29 Ari Jolma <span dir="ltr"><<a
moz-do-not-send="true" href="mailto:ari.jolma@gmail.com">ari.jolma@gmail.com</a>></span><br>
<blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt
0.8ex; border-left: 1px solid rgb(204, 204, 204);
padding-left: 1ex;">
Did anybody else try to use the now standard Visual Studio
built GDAL DLL (which was much discussed some time ago here
and is now available from Tamas' site) in a MinGW environment?<br>
<br>
I spent some time a week or two ago on the issue, but I had a
hard time, which AFAIK is because the DLL mixes two function
export methods and thus using the standard tools seems
difficult if not impossible (I already downloaded the sources
for latest GNU dlltool and considered hacking it...)<br>
<br>
The best page about the issue I found so far is this: <a
moz-do-not-send="true"
href="http://wyw.dcweb.cn/stdcall.htm" target="_blank">http://wyw.dcweb.cn/stdcall.htm</a><br>
<br>
Anybody have any ideas? Is my observation about the two export
methods correct and why is that?<br>
<font color="#888888">
<br>
Ari</font>
<div class="im"><br>
<br>
On 01/29/2011 04:59 AM, Frank Warmerdam wrote:<br>
<blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt
0.8ex; border-left: 1px solid rgb(204, 204, 204);
padding-left: 1ex;">
Folks,<br>
<br>
I have had good success with the GDAL 1.8 upgrade and I
have now thrown<br>
the switch migrating it into the production version of
OSGeo4W.<br>
<br>
I have upgraded "gdal", "gdal-python", "gdal-mrsid" and
"gdal-autotest".<br>
I have yet to upgrade the ecw, and sde related drivers,
and I have not<br>
upgraded the java bindings. I will try to work on them
tomorrow.<br>
<br>
The gdal15dll package was created for backward
compatability and should<br>
be automatically pulled in. It seems to be working fine
for OpenEV.<br>
<br>
I would encourage folks building packages to update, and
rebuild them<br>
using the current GDAL. The GDAL include files in
C:\OSGeo4W\include<br>
and libraries in C:\OSGeo4w\lib should now be for 1.8.<br>
<br>
Note that the new GDAL package is built using Visual
Studio 2008<br>
Express instead of 2003. If you are using the C++ API
this may cause<br>
issues but if you use the C API it should be invisible.<br>
<br>
Let me know of problems.<br>
<br>
Best regards,<br>
</blockquote>
<br>
</div>
<div>
<div class="h5">
_______________________________________________<br>
gdal-dev mailing list<br>
<a moz-do-not-send="true"
href="mailto:gdal-dev@lists.osgeo.org" target="_blank">gdal-dev@lists.osgeo.org</a><br>
<a moz-do-not-send="true"
href="http://lists.osgeo.org/mailman/listinfo/gdal-dev"
target="_blank">http://lists.osgeo.org/mailman/listinfo/gdal-dev</a><br>
</div>
</div>
</blockquote>
</div>
<br>
<div style="visibility: hidden; left: -5000px; position: absolute;
z-index: 9999; padding: 0px; margin-left: 0px; margin-top: 0px;
overflow: hidden; word-wrap: break-word; color: black;
font-size: 10px; text-align: left; line-height: 130%;"
id="avg_ls_inline_popup">
</div>
<pre wrap="">
<fieldset class="mimeAttachmentHeader"></fieldset>
_______________________________________________
gdal-dev mailing list
<a class="moz-txt-link-abbreviated" href="mailto:gdal-dev@lists.osgeo.org">gdal-dev@lists.osgeo.org</a>
<a class="moz-txt-link-freetext" href="http://lists.osgeo.org/mailman/listinfo/gdal-dev">http://lists.osgeo.org/mailman/listinfo/gdal-dev</a></pre>
</blockquote>
<br>
</body>
</html>