Opened 14 years ago

Closed 14 years ago

Last modified 14 years ago

#3465 closed defect (invalid)

Files not found in gdal-1.7.1/frmts/o/.libs

Reported by: jctilton Owned by: warmerdam
Priority: normal Milestone:
Component: ConfigBuild Version: 1.7.1
Severity: normal Keywords:
Cc:

Description

I am attempting to build GDAL with MinGW-64 for 64 bit Windows (native - not cross compile) on a 64 -bit Windows 7 machine.

I used the configuration:

./configure --with-expat=/usr/local --with-netcdf=/usr/local -with-jpeg=/usr/local \ --with-libtiff=internal --with-png=internal \ --enable-shared lt_cv_deplibs_check_method='pass_all'

and the build seems to proceed very normally for a very long time until it reaches the point where it makes libgdal.la.

At that point I get errors indicating that the ld.exe program cannot find various files that are in the gdal-1.7.1/frmts/o/.libs directory. What is most curious, is that when I look in the gdal-1.7.1/frmts/o/.libs directory, the files in question are indeed there!!!

What could be the problem? I thank you for any insight you can provide.

Here is a portion of the terminal output from the build:

... make libgdal.la make[1]: Entering directory `/home/JamesCTilton/Downloads/gdal-1.7.1' /bin/sh /home/JamesCTilton/Downloads/gdal-1.7.1/libtool --mode=link g++ -L/usr/local/lib -lexpat -ljasper -L/usr/local -L/usr/local/lib -ljpeg -L/usr/local -L/usr/local/lib -lnetcdf -o libgdal.la /home/JamesCTilton/Downloads/gdal-1.7.1/frmts/o/*.lo /home/JamesCTilton/Downloads/gdal-1.7.1/gcore/*.lo /home/JamesCTilton/Downloads/gdal-1.7.1/port/*.lo /home/JamesCTilton/Downloads/gdal-1.7.1/alg/*.lo /home/JamesCTilton/Downloads/gdal-1.7.1/ogr/ogrsf_frmts/o/*.lo ./ogr/ogrgeometryfactory.lo ./ogr/ogrpoint.lo ./ogr/ogrcurve.lo ./ogr/ogrlinestring.lo ./ogr/ogrlinearring.lo ./ogr/ogrpolygon.lo ./ogr/ogrutils.lo ./ogr/ogrgeometry.lo ./ogr/ogrgeometrycollection.lo ./ogr/ogrmultipolygon.lo ./ogr/ogrsurface.lo ./ogr/ogrmultipoint.lo ./ogr/ogrmultilinestring.lo ./ogr/ogr_api.lo ./ogr/ogrfeature.lo ./ogr/ogrfeaturedefn.lo ./ogr/ogrfeaturequery.lo ./ogr/ogrfeaturestyle.lo ./ogr/ogrfielddefn.lo ./ogr/ogrspatialreference.lo ./ogr/ogr_srsnode.lo ./ogr/ogr_srs_proj4.lo ./ogr/ogr_fromepsg.lo ./ogr/ogrct.lo ./ogr/ogr_opt.lo ./ogr/ogr_srs_esri.lo ./ogr/ogr_srs_pci.lo ./ogr/ogr_srs_usgs.lo ./ogr/ogr_srs_dict.lo./ogr/ogr_srs_panorama.lo ./ogr/ogr_srs_ozi.lo ./ogr/ogr_srs_erm.lo ./ogr/swq.lo ./ogr/ogr_srs_validate.lo ./ogr/ogr_srs_xml.lo ./ogr/ograssemblepolygon.lo ./ogr/ogr2gmlgeometry.lo ./ogr/gml2ogrgeometry.lo ./ogr/ogr_expat.lo \

-rpath /usr/local/lib \ -no-undefined \ -version-info 15:1:14

libtool: link: rm -fr .libs/libgdal.la.lnkscript libtool: link: creating GNU ld script: .libs/libgdal.la.lnkscript libtool: link: g++ -shared -nostdlib c:/mingw_w64/bin/../lib/gcc/x86_64-w64-mingw32/4.4.4/../../../../x86_64-w64-mingw32/lib/dllcrt2.o c:/mingw_w64/bin/../lib/gcc/x86_64-w64-mingw32/4.4.4/../../../../x86_64-w64-mingw32/lib/crtbegin.o .libs/libgdal.la.lnkscript -L/usr/local/lib /usr/local/lib/libexpat.dll.a /usr/local/lib/libjasper.a -L/usr/local /usr/local/lib/libjpeg.dll.a /usr/local/lib/libnetcdf.a -Lc:/mingw_w64/bin/../lib/gcc/x86_64-w64-mingw32/4.4.4 -Lc:/mingw_w64/bin/../lib/gcc -Lc:/mingw_w64/bin/../lib/gcc/x86_64-w64-mingw32/4.4.4/../../../../x86_64-w64-mingw32/lib -lstdc++ -lmingw32 -lgcc_s -lgcc -lmoldname -lmingwex -lmsvcrt -luser32 -lkernel32 -ladvapi32 -lshell32 -lmingw32 -lgcc_s -lgcc -lmoldname -lmingwex -lmsvcrt c:/mingw_w64/bin/../lib/gcc/x86_64-w64-mingw32/4.4.4/../../../../x86_64-w64-mingw32/lib/crtend.o

-o .libs/libgdal-1.dll -Wl,--enable-auto-image-base -Xlinker --out-implib

-Xlinker .libs/libgdal.dll.a c:/mingw_w64/bin/../lib/gcc/x86_64-w64-mingw32/4.4.4/../../../../x86_64-w64-mingw32/bin/ld.exe: cannot find /home/JamesCTilton/Downloads/gdal-1.7.1/frmts/o/.libs/EnvisatFile.o c:/mingw_w64/bin/../lib/gcc/x86_64-w64-mingw32/4.4.4/../../../../x86_64-w64-mingw32/bin/ld.exe: cannot find /home/JamesCTilton/Downloads/gdal-1.7.1/frmts/o/.libs/IdrisiDataset.o c:/mingw_w64/bin/../lib/gcc/x86_64-w64-mingw32/4.4.4/../../../../x86_64-w64-mingw32/bin/ld.exe: cannot find /home/JamesCTilton/Downloads/gdal-1.7.1/frmts/o/.libs/IngrTypes.o c:/mingw_w64/bin/../lib/gcc/x86_64-w64-mingw32/4.4.4/../../../../x86_64-w64-mingw32/bin/ld.exe: cannot find /home/JamesCTilton/Downloads/gdal-1.7.1/frmts/o/.libs/IntergraphBand.o c:/mingw_w64/bin/../lib/gcc/x86_64-w64-mingw32/4.4.4/../../../../x86_64-w64-mingw32/bin/ld.exe: cannot find /home/JamesCTilton/Downloads/gdal-1.7.1/frmts/o/.libs/IntergraphDataset.o ...

Change History (9)

comment:1 by warmerdam, 14 years ago

These otherwise seemingly unrelated files do happen to be amoung the few that are mixed case names. Perhaps that is related?

comment:2 by jctilton, 14 years ago

I only provided a very small subset of the terminal output. A very large number of files are listed as not found, including, for example:

/home/JamesCTilton/Downloads/gdal-1.7.1/org/ogrsf_frnts/o/.libs/vfkreader.o

which is not mixed case.

It appears that every single file in /home/JamesCTilton/Downloads/gdal-1.7.1/*/*/o/.libs/ is not found.

Is, perhaps, the ".libs" a problem?

comment:3 by jctilton, 14 years ago

I did a little experimenting, and found out that the build creates a file .libs/libgdal.la.lnkscript that contains all the objects that need to be included in the link.

The first entry in this file is:

/home/JamesCTilton/Downloads/gdal-1.71/frmts/o/.libs/EnvisatFile.o

If I edit this entry to be

frmts/o/.libs/EnvisatFile.o

and similarly edit every other entry of this file - and then manually launch the linked up command (I give a cleaned up version here):

g++ -shared -nostdlib /mingw/x86_64-w64-mingw32/lib/dllcrt2.o \ /mingw/x86_64-w64-mingw32/lib/crtbegin.o .libs/libgdal.la.lnkscript \ -L/usr/local/lib /usr/local/lib/libexpat.dll.a /usr/local/lib/libjasper.a \ -L/usr/local /usr/local/lib/libjpeg.dll.a /usr/local/lib/libnetcdf.a \ -L/mingw/lib/gcc/x86_64-w64-mingw32/4.4.4 -L/mingw/lib/gcc \ -L/mingw/x86_64-w64-mingw32/lib -lstdc++ -lmingw32 -lgcc_s -lgcc \ -lmoldname -lmingwex -lmsvcrt -luser32 -lkernel32 -ladvapi32 -lshell32 -lmingw32 \ -lgcc_s -lgcc -lmoldname -lmingwex -lmsvcrt /mingw/x86_64-w64-mingw32/lib/crtend.o \ -o .libs/libgdal-1.dll -Wl,--enable-auto-image-base -Xlinker
--out-implib -Xlinker .libs/libgdal.dll.a

The link proceeds properly, and the library file ./libs/libgdal.dll.a is created.

However, relaunching the make at this point rewrites the .libs/libgdal.la.lnkscript in its original format, and the link again fails because it again can't find the files.

How do I prevent the make from rewriting the ./libs/libgdal.la.lnkscript file so that it will use my edited version????

Or is there another way to correct this problem??

Thanks.

comment:4 by warmerdam, 14 years ago

Perhaps the problem with the full names is that the total length of the link command is too long? If that is the case, doing the build in /gdal-1.7.1 might keep the paths short enough.

Alternatively, you might try configuring and build with the --without-libtool configure switch which will avoid a whole bunch of this libtool magic.

comment:5 by jctilton, 14 years ago

Moving the build directory to /gdal-1.7.1 or /gdal doesn't help (I DID make the necessary change in the definition of GDAL_ROOT in GDALmake.opt). I get the exact same error - and the exact same edit of the ./libs/libgdal.la.lnkscript file fixes it.

I'll try redoing the build with the --without-libtool configure switch.

comment:6 by jctilton, 14 years ago

Reconfiguring with the --without-libtool configure switch solved the problem.

The build completed normally (thankfully, most of the build had completed already and did not have to be redone, so the completion of the build did not take long).

The 'make install' also completed normally.

A quick test of "gdalwarp --version" produced "GDAL 1.7.1, released 2010/02/08" as expected.

I was also able to build and link one of my GDAL dependent applications - and the program appears to run normally.

Thanks for all of your help!

comment:7 by Even Rouault, 14 years ago

Resolution: invalid
Status: newclosed

comment:8 by pracine, 14 years ago

On my side I tried to compile with GDAL. In the first attempt I try to compile GDAL following Regina advice:

./configure --without-libtool --with-libtiff=internal --with-libz=/c/gtk/include --prefix=/c/projects/GDAL/rel-1.7.1

When the makefile tries to make libgdal.a, I get:

rm -f libgdal.a ar r /c/thesrc/gdal/gdal-1.7.1/libgdal.a /c/thesrc/gdal/gdal-1.7.1/frmts/o/*.o / c/thesrc/gdal/gdal-1.7.1/gcore/*.o /c/thesrc/gdal/gdal-1.7.1/port/*.o /c/thesrc/ gdal/gdal-1.7.1/alg/*.o /c/thesrc/gdal/gdal-1.7.1/ogr/ogrsf_frmts/o/*.o ./ogr/og rgeometryfactory.o ./ogr/ogrpoint.o ./ogr/ogrcurve.o ./ogr/ogrlinestring.o ./ogr /ogrlinearring.o ./ogr/ogrpolygon.o ./ogr/ogrutils.o ./ogr/ogrgeometry.o ./ogr/o grgeometrycollection.o ./ogr/ogrmultipolygon.o ./ogr/ogrsurface.o ./ogr/ogrmulti point.o ./ogr/ogrmultilinestring.o ./ogr/ogr_api.o ./ogr/ogrfeature.o ./ogr/ogrf eaturedefn.o ./ogr/ogrfeaturequery.o ./ogr/ogrfeaturestyle.o ./ogr/ogrfielddefn. o ./ogr/ogrspatialreference.o ./ogr/ogr_srsnode.o ./ogr/ogr_srs_proj4.o ./ogr/og r_fromepsg.o ./ogr/ogrct.o ./ogr/ogr_opt.o ./ogr/ogr_srs_esri.o ./ogr/ogr_srs_pc i.o ./ogr/ogr_srs_usgs.o ./ogr/ogr_srs_dict.o ./ogr/ogr_srs_panorama.o ./ogr/ogr _srs_ozi.o ./ogr/ogr_srs_erm.o ./ogr/swq.o ./ogr/ogr_srs_validate.o ./ogr/ogr_sr s_xml.o ./ogr/ograssemblepolygon.o ./ogr/ogr2gmlgeometry.o ./ogr/gml2ogrgeometry .o ./ogr/ogr_expat.o /bin/sh: /mingw/bin/ar: Bad file number make[1]: * c/thesrc/gdal/gdal-1.7.1/libgdal.a Error 126 make[1]: Leaving directory `/c/thesrc/gdal/gdal-1.7.1' make: * [check-lib] Error 2

Apparently meaning that the "ar" command contains too many characters...

If I leave the --without-libtool parameter, GDAL compile fine (I get libgdal.a, libgdal.la and libgdal.lai in /c/thesrc/gdal/gdal-1.7.1\.libs) but when WKT Raster link I get a very long serie of things looking like this:

c:/MinGW/bin/../lib/gcc/mingw32/3.4.5/../../../../include/c++/3.4.5/bits/basic_s tring.h:217: r+®f+®rence ind+®finie vers -½ gnu_cxx::exchange_and_add(int vo latile*, int) -+ c:/MinGW/bin/../lib/gcc/mingw32/3.4.5/../../../../include/c++/3.4.5/bits/basic_s tring.h:218: r+®f+®rence ind+®finie vers -½ std::string::_Rep::_M_destroy(std::a llocator<char> const&) -+ c:/MinGW/bin/../lib/gcc/mingw32/3.4.5/../../../../include/c++/3.4.5/bits/basic_s tring.h:217: r+®f+®rence ind+®finie vers -½ gnu_cxx::exchange_and_add(int vo latile*, int) -+ c:/MinGW/bin/../lib/gcc/mingw32/3.4.5/../../../../include/c++/3.4.5/bits/basic_s tring.h:218: r+®f+®rence ind+®finie vers -½ std::string::_Rep::_M_destroy(std::a llocator<char> const&) -+ c:/MinGW/bin/../lib/gcc/mingw32/3.4.5/../../../../include/c++/3.4.5/bits/basic_s tring.h:217: r+®f+®rence ind+®finie vers -½ gnu_cxx::exchange_and_add(int vo latile*, int) -+ c:/MinGW/bin/../lib/gcc/mingw32/3.4.5/../../../../include/c++/3.4.5/bits/basic_s tring.h:218: r+®f+®rence ind+®finie vers -½ std::string::_Rep::_M_destroy(std::a llocator<char> const&) -+ collect2: ld returned 1 exit status c:\MinGW\bin\dllwrap.exe: c:\MinGW\bin\gcc a terminÚ avec le statut 1 make[1]: * [rtpostgis.dll] Error 1 make[1]: Leaving directory `/c/thesrc/wktraster/wktraster-svn/rt_pg' make: * [pglib] Error 2

Any idea?

comment:9 by jctilton, 14 years ago

I encountered a similar problem when in my gdal-1.7.1 build.

I was able to devise a work-around to this problem. To execute the same work-around you can do the following:

Use your version of the ./configure that includes the --withoug-libtool parameter.

Let the build proceed to the error complaining about the "ar" command containing too many characters.

Put yourself in the directory in which the "ar" command was when it failed.

Call up your favorite text editor and copy and paste the full "ar" command into it.

Edit the "ar" command replacing all occurrences of "/c/thesrc/gdal/gdal-1.7.1" with ".". Your command should now look like:

ar r ./libgdal.a ./frmts/o/*.o ./gcore/*.o ./port/*.o \ ./alg/*.o ./ogr/ogrsf_frmts/o/*.o ./ogr/ogrgeometryfactory.o ./ogr/ogrpoint.o \ ./ogr/ogrcurve.o ./ogr/ogrlinestring.o ./ogr/ogrlinearring.o ./ogr/ogrpolygon.o \ ./ogr/ogrutils.o ./ogr/ogrgeometry.o ./ogr/ogrgeometrycollection.o \ ./ogr/ogrmultipolygon.o ./ogr/ogrsurface.o ./ogr/ogrmultipoint.o \ ./ogr/ogrmultilinestring.o ./ogr/ogr_api.o ./ogr/ogrfeature.o \ ./ogr/ogrfeaturedefn.o ./ogr/ogrfeaturequery.o ./ogr/ogrfeaturestyle.o \ ./ogr/ogrfielddefn.o ./ogr/ogrspatialreference.o ./ogr/ogr_srsnode.o \ ./ogr/ogr_srs_proj4.o ./ogr/ogr_fromepsg.o ./ogr/ogrct.o ./ogr/ogr_opt.o \ ./ogr/ogr_srs_esri.o ./ogr/ogr_srs_pci.o ./ogr/ogr_srs_usgs.o \ ./ogr/ogr_srs_dict.o ./ogr/ogr_srs_panorama.o ./ogr/ogr_srs_ozi.o \ ./ogr/ogr_srs_erm.o ./ogr/swq.o ./ogr/ogr_srs_validate.o ./ogr/ogr_srs_xml.o \ ./ogr/ograssemblepolygon.o ./ogr/ogr2gmlgeometry.o ./ogr/gml2ogrgeometry.o \ ./ogr/ogr_expat.o

(I put "\"'s at the end of the lines to make sure there will be no problems with the long line.)

Copy this revised "ar" command line back to your command line and let it run. I should run with no error. Then reissue your "make all" and your build should proceed past this point successfully.

I'm relating this to you from my memory of the solution. I may have a minor error in my memory - but I hope this is enough to get you on the right track.

Note: See TracTickets for help on using tickets.