[postgis-users] Load of [...] postgis.dll failed.

William C. Rowden rowdenw at hurston.org
Tue May 6 21:19:44 PDT 2003


Has anyone seen the following error?  Would someone suggest where to
look to fix this? [1]:

    Load of file /usr/lib/postgis.dll failed: dlopen: Win32 error 126

I receive this error for the following command (in
"/usr/share/postgresql/contrib"):

   psql -h localhost -U postgres -d myGISdb -f postgis.sql

I am using PostgreSQL 7.3.2-1 [2] with Cygwin 1.3.22-1 [3] on Windows
2000 Server on a Dell PowerEdge 1650.

Despite being familiar with Linux system administration (but not
development), I used "The NON-UNIX User's Guide to Installing PostGIS
on Windows"
(<http://postgis.refractions.net/windows/WindowsHowTo.html>).  I had
already done the steps in the "Install Cygwin" and "Configure
PostgreSQL" sections, so I attempted to compile using
postgis-0.7.5.tar as described in the "Set up PostGIS" section.
Unable to compile, I downloaded a pre-compiled version and edited the
"postgis.sql" file [4].

More detail follows:

[1] The head of the output containing the error is as follows:

    BEGIN
            message         
	    ------------------------
	     PL/PgSQL is installed.
	     (1 row)
	     
	     psql:postgis.sql:18: NOTICE: ProcedureCreate: type
	     histogram2d is not yet defined
	     psql:postgis.sql:18: ERROR: Load of file
	     /usr/lib/postgis.dll failed: dlopen: Win32 error 126
	     psql:postgis.sql:23: ERROR: current transaction is
	     aborted, queries ignored until end of transaction block
	     psql:postgis.sql:31: ERROR: current transaction is
	     aborted, queries ignored until end of transaction block

This output is followed by ERRORs for each of the other CREATE statements.

[2] I installed PostgreSQL 7.3.2-1 using the README for the Cygwin
PostgreSQL distribution v 1.30.  The IPC connection from cygipc-1.13
(<http://www.neuro.gatech.edu/users/cwilson/cygutils/cygipc/>) only
works when logged in at the console--not remotely through Windows
Terminal Services.  I suspect this is a file permission issue.  I use
the Internet domain sockets (i.e., "-h localhost") rather than Unix
domain sockets to connect to the postmaster without problem, however.

[3] I installed the PostgreSQL 7.3.2-1 binary and source from Cygwin.
When I added the source after the original README instructions, I also
added bison and flex, as the build used those also.

[4] When making PostGIS, I received the error in the "Undefined
references" and "Cygwin / PostgreSQL / PostGIS" threads:

	   dlltool --export-all --output-def postgis.def
	   postgis_debug.o postgis_ops.o postgis_fn.o postgis_inout.o
	   postgis_proj.o postgis_chip.o postgis_transform.o
	   postgis_gist_72.o postgis_estimate.o
	   dllwrap -o postgis.dll --dllname postgis.dll --def
	   postgis.def postgis_debug.o postgis_ops.o postgis_fn.o
	   postgis_inout.o postgis_proj.o postgis_chip.o
	   postgis_transform.o postgis_gist_72.o postgis_estimate.o
	   ../../src/utils/dllinit.o -L/usr/local/lib -L/usr/local/lib
	   -L../../src/backend -lpostgres
	   fu000001.o(.idata$3+0xc): undefined reference to
	   `_libpostgres_a_iname'
	   nmth000000.o(.idata$4+0x0): undefined reference to
	   `__nm__cpu_index_tuple_cost'
	   Info: resolving _cpu_index_tuple_cost by linking to
	   __imp__cpu_index_tuple_cost (auto-import)
	   collect2: ld returned 1 exit status
	   dllwrap: gcc exited with status 1
	   make: *** [libpostgis.a] Error 1

I tried putting "DLLIMPORT" in the appropriate "extern" statement
without success, and didn't want to patch the makefile, so I
downloaded a precompiled version instead
(<http://www.vso.cape.com/~nhv/files/postgres/cygPostGIS_731.tgz>).
The $libdir variable in "postgis.sql" consequently didn't work, so I
replaced "$libdir" with "/usr/lib", as suggested in the "About
$libdir" thread.
-- 
     -William



More information about the postgis-users mailing list