Closed sirosenberg closed 7 years ago
Use “DYLD_LIBRARY_PATH” instead of “LD_LIBRARY_PATH” and set it to /Users/steven/Desktop/FileGDB_API-64gcc/lib.
The make files only build the samples. The libraries that you need to build GDAL are in the lib directories.
It appears to run longer, but I'm still getting the same error. More on that later. First, let's focus on GDAL since that's my immediate goal here.
I tried copying the files from the include and lib directories to build GDAL without success, following directions at http://gis.stackexchange.com/questions/43652/esri-gdb-support-in-gdal-ogr2ogr-on-mac-os-x-10-8. Since those directions are a bit dated -- I couldn't find anything from the last couple of years -- I wasn't sure if that approach should still work (whether they would work with API 1.4, or GDAL 1.11.5 or 2.1.2).
If I copy the contents of the include and lib directories to /usr/local/lib with this API, should I be able to use 'brew install gdal --enable-unsupported' (or perhaps 'brew install gdal 2 --with-unsupported' or something similar) to be able to write to FileGDB?
If, instead, I have to get the make script to run, I'm still having problems, as I mentioned. See below:
iMac:samples steven$ pwd
/Users/steven/Desktop/FileGDB_API-64gcc/samples
iMac:samples steven$ DYLD_LIBRARY_PATH='/Users/steven/Desktop/FileGDB_API-64gcc/lib'
iMac:samples steven$ echo $DYLD_LIBRARY_PATH
/Users/steven/Desktop/FileGDB_API-64gcc/lib
iMac:samples steven$ export DYLD_LIBRARY_PATH
iMac:samples steven$ export CXX
iMac:samples steven$ echo $CXX
g++
iMac:samples steven$ make
/Applications/Xcode.app/Contents/Developer/usr/bin/make -C Domains
g++ -fPIC -O3 -m64 -arch x86_64 -stdlib=libstdc++ -W -fexceptions -D_CONSOLE -DUNICODE -D_UNICODE -DUNIX -D_REENTRANT -DFILEGDB_API -DUSE_FILE_OFFSET64 -DUNIX_FILEGDB_API -D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE -I../../include -I. -m64 -arch x86_64 -stdlib=libstdc++ -L"../../lib" -o ../bin/Domains ./Domains.o -lFileGDBAPI
clang: warning: libstdc++ is deprecated; move to libc++
Undefined symbols for architecture x86_64:
"FileGDBAPI::Geodatabase::AlterDomain(std::__1::basic_string<char, std::1::char_traits
Can you run ‘gcc -dumpversion’ and post the results.
It's 4.2.1
You may want to look at http://trac.osgeo.org/gdal/wiki/FileGDB.
That's among the sources I've uncovered. While it's more up-to-date than most, linking to the current version of the API, the only info there about installation on a mac is the link to the esri downloads page (where one of the two mac-download links is broken).
If there's more mac-specific installation notes in one of the links from that page that I'm missing, please let me know.
I found a repo on GitHub that seems to do what I want: https://github.com/OSGeo/homebrew-osgeo4mac.
I'm not sure why I'm unable to run the make script on my machine; but at least my short-term need appears to be addressed by that code.
@sirosenberg I think you gcc actually clang
I am successfully buld FileGDB_API-64clang/samples with minor fixes below
in Display/Display.cpp:
#include <glut.h>
->
#include <GLUT/glut.h>
in Display/Makefile:
LDFLAGS+= -L../../lib
->
LDFLAGS+= -L../../lib -framework OpenGL -framework GLUT
in ProcessTopologies/Makefile:
CXXFLAGS+=-W -fexceptions -D_CONSOLE $(CXXDEF) -I../../include -I/usr/include/libxml2 -I../../ThirdPartyDependencies/include/libxml2 $(CXXOTHER)
->
CXXFLAGS+=-W -fexceptions -D_CONSOLE $(CXXDEF) -I../../include -I/usr/include/libxml2 -I/opt/local/include/libxml2 $(CXXOTHER)
LDFLAGS+= -L../../lib -L../../ThirdPartyDependencies/$(3PLIBDIR)/lib/libxml2
->
LDFLAGS+= -L../../lib -L/opt/local/lib
then
bash-3.2$ export DYLD_LIBRARY_PATH=/Volumes/MyPassport/Downloads/_ARCGIS/Runtime/_filegdb/FileGDB_API-64clang/lib:$DYLD_LIBRARY_PATH
bash-3.2$ make
I am getting an error when trying to run the makefile script (FileGDB_API_1_4_64_gcc.zip). This was esri tech-support case 01891003.
My goal is to be able to write a fileGDB using GDAL (and ogr2ogr from postgis). I assume I need to successfully run the make script in order to have the right libraries to copy.
I’m running El Capitan (Mac OSX 10.11.5 15F34; Kernel Darwin 15.5.0) on a mac that’s a few years old (i7 processor, model iMac14,2).
As described in the README file, I checked the gcc version, set the LD_LIBRARY_PATH, set CXX and then tried to ‘make’ but got an error; see below for the error from make and the response to ‘make –v’ (which seems to refer to a version of GNU that was built for a MUCH older kernel).
prompt> gcc --version Configured with: --prefix=/Applications/Xcode.app/Contents/Developer/usr --with-gxx-include-dir=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.12.sdk/usr/include/c++/4.2.1 Apple LLVM version 8.0.0 (clang-800.0.42.1) Target: x86_64-apple-darwin15.5.0 Thread model: posix InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin
prompt> LD_LIBRARY_PATH='/Users/steven/Desktop/FileGDB_API-64gcc' prompt> echo $LD_LIBRARY_PATH /Users/steven/Desktop/FileGDB_API-64gcc
prompt> CXX=g++ prompt> echo $CXX g++ prompt> cd samples prompt> make /Applications/Xcode.app/Contents/Developer/usr/bin/make -C Domains c++ -fPIC -O3 -m64 -arch x86_64 -W -fexceptions -D_CONSOLE -DUNICODE -D_UNICODE -DUNIX -D_REENTRANT -DFILEGDB_API -DUSE_FILE_OFFSET64 -DUNIX_FILEGDB_API -D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE -I../../include -I. -m64 -arch x86_64 -L"../../lib" -o ../bin/Domains ./Domains.o -lFileGDBAPI Undefined symbols for architecture x86_64: "FileGDBAPI::Geodatabase::AlterDomain(std::__1::basic_string<char, std::1::char_traits, std::1::allocator > const&)", referenced from:
_main in Domains.o
"FileGDBAPI::Geodatabase::CreateDomain(std::__1::basic_string<char, std:: 1::char_traits, std::1::allocator > const&)", referenced from:
_main in Domains.o
"FileGDBAPI::Geodatabase::DeleteDomain(std::1::basic_string<wchar_t, std::1::char_traits, std::1::allocator > const&)", referenced from:
_main in Domains.o
"FileGDBAPI::Geodatabase::OpenTable(std:: 1::basic_string<wchar_t, std::1::char_traits, std:: 1::allocator > const&, FileGDBAPI::Table&)", referenced from:
_main in Domains.o
"FileGDBAPI::OpenGeodatabase(std::1::basic_string<wchar_t, std::1::char_traits, std::1::allocator > const&, FileGDBAPI::Geodatabase&)", referenced from:
_main in Domains.o
"FileGDBAPI::Table::AlterField(std:: 1::basic_string<char, std:: 1::char_traits, std::1::allocator > const&)", referenced from:
_main in Domains.o
"FileGDBAPI::ErrorInfo::GetErrorRecord(int, int&, std::1::basic_string<wchar_t, std::1::char_traits, std::1::allocator >&)", referenced from:
_main in Domains.o
"FileGDBAPI::ErrorInfo::GetErrorDescription(int, std:: 1::basic_string<wchar_t, std::1::char_traits, std:: 1::allocator >&)", referenced from:
_main in Domains.o
"FileGDBAPI::Geodatabase::GetDomainDefinition(std::1::basic_string<wchar_t, std::1::char_traits, std::__1::allocator > const&, std:: 1::basic_string<char, std::__1::char_traits, std::__1::allocator >&) const", referenced from:
_main in Domains.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make[1]: [../bin/Domains] Error 1
make: [Domains] Error 2
prompt> samples steven$ make -v GNU Make 3.81 Copyright (C) 2006 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
This program built for i386-apple-darwin11.3.0