implicit declaration of function Error when building CPython on MacOS - cpython

I'm trying to build CPython from its 3.9 branch on a MacOS machine, but I'm getting the following errors when I run make -j2 -s:
./Modules/posixmodule.c:7192:9: error: implicit declaration of function 'openpty' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
if (openpty(&master_fd, &slave_fd, NULL, NULL, NULL) != 0)
^
./Modules/posixmodule.c:7192:9: note: did you mean 'openat'?
/usr/include/sys/fcntl.h:516:5: note: 'openat' declared here
int openat(int, const char *, int, ...) __DARWIN_NOCANCEL(openat) __OSX_AVAILABLE_STARTING(__MAC_10_10, __IPHONE_8_0);
^
./Modules/posixmodule.c:7192:9: warning: this function declaration is not a prototype [-Wstrict-prototypes]
if (openpty(&master_fd, &slave_fd, NULL, NULL, NULL) != 0)
^
./Modules/posixmodule.c:7293:11: error: implicit declaration of function 'forkpty' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
pid = forkpty(&master_fd, NULL, NULL, NULL);
^
./Modules/posixmodule.c:7293:11: warning: this function declaration is not a prototype [-Wstrict-prototypes]
2 warnings and 2 errors generated.
make: *** [Modules/posixmodule.o] Error 1
make: *** Waiting for unfinished jobs....
My Makefile was generated by running the following command:
CPPFLAGS="-I$(brew --prefix zlib)/include" \
LDFLAGS="-L$(brew --prefix zlib)/lib" \
./configure --with-openssl=$(brew --prefix openssl) \
--with-pydebug
Do you have any idea of what could be wrong or missing?
Update:
Apparently, this is a known and unresolved issue. https://bugs.python.org/issue34027

I've been plagued by this problem on a few different systems. In any case, I tried again, and found this GitHub issues thread for pyenv which had a lot of suggestions. In the end, this worked for me:
SDKROOT=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk pyenv install 3.10.0
Since this original question was not about pyenv I gave it a try separately. I was able to get through make but not make test and, unfortunately, I don't have time to sleuth it all out, but maybe this will help someone anyway.

Related

How to compile sqlite3 extension - CSV virtual table

I am trying to use the CSV Virtual Table extension for sqlite3. I get stuck on the first step of compiling the extension on a Mac (MacOS High Sierra 10.13.6).
I downloaded the source code for csv.c from this page. I also grabbed the sqlite source code amalgamation from here.
I used the following command to compile:
gcc -g -fPIC -dynamiclib csv.c -o csv.dylib
However, I get the following error:
csv.c:115:3: error: no member named '__builtin___vsnprintf_chk' in 'struct sqlite3_api_routines'
sqlite3_vsnprintf(CSV_MXERR, p->zErr, zFormat, ap);
^~~~~~~~~~~~~~~~~
/usr/include/sqlite3ext.h:437:53: note: expanded from macro 'sqlite3_vsnprintf'
#define sqlite3_vsnprintf sqlite3_api->vsnprintf
~~~~~~~~~~~ ^
/usr/include/secure/_stdio.h:75:3: note: expanded from macro 'vsnprintf'
__builtin___vsnprintf_chk (str, len, 0, __darwin_obsz(str), format, ap)
^
csv.c:115:21: warning: incompatible integer to pointer conversion passing 'int' to parameter of type 'const void *' [-Wint-conversion]
sqlite3_vsnprintf(CSV_MXERR, p->zErr, zFormat, ap);
^~~~~~~~~
csv.c:67:19: note: expanded from macro 'CSV_MXERR'
#define CSV_MXERR 200
^~~
/usr/include/secure/_stdio.h:75:57: note: expanded from macro 'vsnprintf'
__builtin___vsnprintf_chk (str, len, 0, __darwin_obsz(str), format, ap)
^~~
/usr/include/secure/_common.h:39:54: note: expanded from macro '__darwin_obsz'
#define __darwin_obsz(object) __builtin_object_size (object, _USE_FORTIFY_LEVEL > 1 ? 1 : 0)
^~~~~~
csv.c:568:5: error: use of undeclared identifier 'sqlite3_str'
sqlite3_str *pStr = sqlite3_str_new(0);
^
csv.c:568:18: error: use of undeclared identifier 'pStr'
sqlite3_str *pStr = sqlite3_str_new(0);
^
csv.c:568:25: warning: implicit declaration of function 'sqlite3_str_new' is invalid in C99 [-Wimplicit-function-declaration]
sqlite3_str *pStr = sqlite3_str_new(0);
^
csv.c:571:5: warning: implicit declaration of function 'sqlite3_str_appendf' is invalid in C99 [-Wimplicit-function-declaration]
sqlite3_str_appendf(pStr, "CREATE TABLE x(");
^
csv.c:571:25: error: use of undeclared identifier 'pStr'
sqlite3_str_appendf(pStr, "CREATE TABLE x(");
^
csv.c:581:29: error: use of undeclared identifier 'pStr'
sqlite3_str_appendf(pStr, "%sc%d TEXT", zSep, iCol);
^
csv.c:588:31: error: use of undeclared identifier 'pStr'
sqlite3_str_appendf(pStr,"%s\"%w\" TEXT", zSep, z);
^
csv.c:597:31: error: use of undeclared identifier 'pStr'
sqlite3_str_appendf(pStr,"%sc%d TEXT", zSep, ++iCol);
^
csv.c:603:25: error: use of undeclared identifier 'pStr'
sqlite3_str_appendf(pStr, ")");
^
csv.c:604:18: warning: implicit declaration of function 'sqlite3_str_finish' is invalid in C99 [-Wimplicit-function-declaration]
CSV_SCHEMA = sqlite3_str_finish(pStr);
^
csv.c:604:37: error: use of undeclared identifier 'pStr'
CSV_SCHEMA = sqlite3_str_finish(pStr);
^
csv.c:643:27: error: use of undeclared identifier 'SQLITE_VTAB_DIRECTONLY'
sqlite3_vtab_config(db, SQLITE_VTAB_DIRECTONLY);
^
4 warnings and 10 errors generated.
What am I doing wrong?
Richard Hipp at sqlite.org posted a solution on how to compile an SQLite extension.
The script for compiling the CSV extension looks like this (based on https://www.sqlite.org/loadext.html and https://github.com/sqlite/sqlite/blob/master/README.md):
wget https://www.sqlite.org/src/tarball/sqlite.tar.gz
tar xzf sqlite.tar.gz
mkdir bld
cd bld
../sqlite/configure
make
gcc -g -I. -fPIC -dynamiclib ../sqlite/ext/misc/csv.c -o csv.dylib
Testing the script:
echo -e 'col_text,col_int\napples,3\noranges,5' > sample.csv
./sqlite3 '' '.load csv' 'CREATE VIRTUAL TABLE temp.t1 USING csv(filename="sample.csv");' 'SELECT * FROM t1;'
That's it.
You can also try compiling csv.c with an existing sqlite3 installation. For sqlite3 installed with Homebrew, it would be:
curl -O https://raw.githubusercontent.com/sqlite/sqlite/master/ext/misc/csv.c
gcc -g -I/usr/local/opt/sqlite/include -fPIC -dynamiclib csv.c -o csv.dylib
/usr/local/opt/sqlite/bin/sqlite3 '' '.load csv'
The last line is testing the newly compiled library in the Homebrew sqlite3. The default $ sqlite3 comes from the MacOS bundle and is outdated sometimes.
I managed to find a workaround and use an Ubuntu docker container, where I was able to successfully compile and use the extension. Here are the steps I followed:
docker run -ti --rm -v $(pwd):/host ubuntu bash
# Steps to build SQLite and CSV Virtual Table extension from source inside an Ubuntu docker container
cd /host
apt update
apt install -y vim build-essential zip wget
wget https://sqlite.org/2020/sqlite-autoconf-3310100.tar.gz
tar xvf sqlite-autoconf-3310100.tar.gz
cd sqlite-autoconf-3310100
./configure
make
./sqlite3
# Obtain csv.c and change <sqlite3ext.h> to "sqlite3ext.h" in the file
vi csv.c
gcc -g -fPIC -shared csv.c -o csv.so
./sqlite3
#sqlite> .load ./csv
#sqlite> CREATE VIRTUAL TABLE temp.t1 USING csv(filename='/host/users.csv',header);
#sqlite> .headers on
#sqlite> SELECT * FROM t1 LIMIT 1;
You can use a similar process to build for a Lambda function (CentOS). See this github repo for more details.
I still haven't figured out how to get it to compile directly on Mac, so any help would be greatly appreciated!
Leveraging off of Anton's answer for an Ubuntu-like distro, the following is mostly workable:
wget https://www.sqlite.org/src/tarball/sqlite.tar.gz
tar xzf sqlite.tar.gz
mkdir bld
cd bld
../sqlite/configure
make
A gotchas in getting this far:
You may need to do this:
sudo apt-get install tcl8.6-dev
It will complain about not having access to tcl. If that's the case, you need to install and go back to the configure step.
Now, make should work unless you have other missing dependencies.
Assuming that works, now for the gcc:
gcc -I. -fPIC -shared ../sqlite/ext/misc/csv.c -o csv.so -lm
Now it's time to run. You need to set LD_LIBRARY_PATH. Assuming you are still in the bld directory:
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:`pwd`
or substitute the `pwd` for your full path to the csv.so file.
NOW! Now, you can run it. Enjoy.

error: qualified reference to 'QFixed' is a constructor name rather than a type in this context building Paraview

I have been trying to build ParaView to test the custom apps examples here on MacOS.
I have followed the site instructions for the superbuild here.
I seem to have a problem with the Qt part.
These are the steps I have done:
$ mkdir pv
$ cd pv
$ git clone https://gitlab.kitware.com/paraview/paraview-superbuild.git
$ cd paraview-superbuild
$ git fetch origin # ensure you have the latest state from the main repo
$ git submodule update
$ cd ..
$ mkdir paraview_build
$ cd paraview_build
$ cmake ../paraview-superbuild
$ ccmake -DCMAKE_OSX_SDK=macosx10.14 ../paraview-superbuild
I enabled the CMake variables:
ENABLE_qt5
ENABLE_python
ENABLE_python2
Then ran:
$ make
The error I got:
[ 87%] Performing build step for 'qt5'
Info: creating cache file /Users/username/Desktop/dev/pv/paraview_build/superbuild/qt5/build/qtbase/.qmake.cache
ld: warning: direct access in function 'QHash<QString, int>::insert(QString const&, int const&)' from file '/Users/username/Desktop/dev/pv/paraview_build/superbuild/qt5/build/qtbase/lib/libQt5Bootstrap.a(qcommandlineparser.o)' to global weak symbol 'QHash<QString, int>::deleteNode2(QHashData::Node*)' from file '.obj/rcc.o' means the weak symbol cannot be overridden at runtime. This was likely caused by different translation units being compiled with different visibility settings.
ld: warning: direct access in function 'QHash<QString, int>::insert(QString const&, int const&)' from file '/Users/username/Desktop/dev/pv/paraview_build/superbuild/qt5/build/qtbase/lib/libQt5Bootstrap.a(qcommandlineparser.o)' to global weak symbol 'QHash<QString, int>::deleteNode2(QHashData::Node*)' from file '.obj/rcc.o' means the weak symbol cannot be overridden at runtime. This was likely caused by different translation units being compiled with different visibility settings.
ld: warning: direct access in function 'QHash<QString, int>::insert(QString const&, int const&)' from file '/Users/username/Desktop/dev/pv/paraview_build/superbuild/qt5/build/qtbase/lib/libQt5Bootstrap.a(qcommandlineparser.o)' to global weak symbol 'QHash<QString, int>::duplicateNode(QHashData::Node*, void*)' from file '.obj/rcc.o' means the weak symbol cannot be overridden at runtime. This was likely caused by different translation units being compiled with different visibility settings.
ld: warning: direct access in function 'QCommandLineParserPrivate::~QCommandLineParserPrivate()' from file '/Users/username/Desktop/dev/pv/paraview_build/superbuild/qt5/build/qtbase/lib/libQt5Bootstrap.a(qcommandlineparser.o)' to global weak symbol 'QHash<QString, int>::deleteNode2(QHashData::Node*)' from file '.obj/rcc.o' means the weak symbol cannot be overridden at runtime. This was likely caused by different translation units being compiled with different visibility settings.
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib: file: ../../../lib/libqtharfbuzz.a(hb-warning.o) has no symbols
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib: file: ../../../lib/libqtharfbuzz.a(hb-warning.o) has no symbols
Makefile:2392: warning: overriding commands for target `../../lib/QtGui.framework/Versions/5/Headers/QGenericPlugin'
Makefile:2024: warning: ignoring old commands for target `../../lib/QtGui.framework/Versions/5/Headers/QGenericPlugin'
Makefile:2396: warning: overriding commands for target `../../lib/QtGui.framework/Versions/5/Headers/QGenericPluginFactory'
Makefile:2020: warning: ignoring old commands for target `../../lib/QtGui.framework/Versions/5/Headers/QGenericPluginFactory'
/Users/username/Desktop/dev/pv/paraview_build/superbuild/qt5/src/qtbase/src/network/access/qnetworkaccessdebugpipebackend_p.h:0: Note: No relevant classes found. No output generated.
/Users/username/Desktop/dev/pv/paraview_build/superbuild/qt5/src/qtbase/src/platformsupport/fontdatabases/mac/qfontengine_coretext.mm:833:20: error: qualified reference to 'QFixed' is a constructor name rather than a type in this context
return QFixed::QFixed(int(CTFontGetUnitsPerEm(ctfont)));
^
1 error generated.
make[7]: *** [.obj/qfontengine_coretext.o] Error 1
make[7]: *** Waiting for unfinished jobs....
make[6]: *** [sub-fontdatabases-make_first] Error 2
make[5]: *** [sub-platformsupport-make_first] Error 2
make[5]: *** Waiting for unfinished jobs....
/Users/username/Desktop/dev/pv/paraview_build/superbuild/qt5/src/qtbase/src/widgets/widgets/qdialogbuttonbox.cpp:868:14: warning: comparison of two values with different enumeration types in switch statement ('QDialogButtonBox::ButtonRole' and 'QPlatformDialogHelper::ButtonRole') [-Wenum-compare-switch]
case QPlatformDialogHelper::HelpRole:
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Users/username/Desktop/dev/pv/paraview_build/superbuild/qt5/src/qtbase/src/widgets/widgets/qdialogbuttonbox.cpp:865:14: warning: comparison of two values with different enumeration types in switch statement ('QDialogButtonBox::ButtonRole' and 'QPlatformDialogHelper::ButtonRole') [-Wenum-compare-switch]
case QPlatformDialogHelper::NoRole:
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Users/username/Desktop/dev/pv/paraview_build/superbuild/qt5/src/qtbase/src/widgets/widgets/qdialogbuttonbox.cpp:864:14: warning: comparison of two values with different enumeration types in switch statement ('QDialogButtonBox::ButtonRole' and 'QPlatformDialogHelper::ButtonRole') [-Wenum-compare-switch]
case QPlatformDialogHelper::RejectRole:
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Users/username/Desktop/dev/pv/paraview_build/superbuild/qt5/src/qtbase/src/widgets/widgets/qdialogbuttonbox.cpp:861:14: warning: comparison of two values with different enumeration types in switch statement ('QDialogButtonBox::ButtonRole' and 'QPlatformDialogHelper::ButtonRole') [-Wenum-compare-switch]
case QPlatformDialogHelper::YesRole:
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Users/username/Desktop/dev/pv/paraview_build/superbuild/qt5/src/qtbase/src/widgets/widgets/qdialogbuttonbox.cpp:860:14: warning: comparison of two values with different enumeration types in switch statement ('QDialogButtonBox::ButtonRole' and 'QPlatformDialogHelper::ButtonRole') [-Wenum-compare-switch]
case QPlatformDialogHelper::AcceptRole:
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
5 warnings generated.
make[4]: *** [sub-src-make_first] Error 2
make[3]: *** [module-qtbase-make_first] Error 2
CMake Error at /Users/username/Desktop/dev/pv/paraview_build/superbuild/sb-qt5-build.cmake:47 (message):
Failed with exit code 2
make[2]: *** [superbuild/qt5/stamp/qt5-build] Error 1
make[1]: *** [superbuild/CMakeFiles/qt5.dir/all] Error 2
make: *** [all] Error 2
What can I do?
The error in the log:
qfontengine_coretext.mm:833:20: error: qualified reference to 'QFixed' is a constructor name rather than a type in this context
is caused by a known bug with Qt 5.9.5, documented here. There is a MacOS fix available there as well, which involves modifying one line of code in the qfontengine_coretext.mm file. Your file is located here:
/Users/username/Desktop/dev/pv/paraview_build/superbuild/qt5/src/qtbase/src/platformsupport/fontdatabases/mac/qfontengine_coretext.mm
At line 833, change the return statement from this:
QFixed QCoreTextFontEngine::emSquareSize() const
{
return QFixed::QFixed(int(CTFontGetUnitsPerEm(ctfont)));
}
to this (removing the extra QFixed:: so that it is no longer designates a constructor):
QFixed QCoreTextFontEngine::emSquareSize() const
{
return QFixed(int(CTFontGetUnitsPerEm(ctfont)));
}
Then, re-run make to verify the updated source code fixes this issue.

Canot install edb in Ubuntu 11.10

I have tried to follow the steps as mentioned in http://samiux.blogspot.in/2012/12/howto-install-edb-debugger-on-ubuntu.html however I am getting an error
main.cpp: In function ‘void {anonymous}::usage()’:
main.cpp:158:18: error: request for member ‘toLocal8Bit’ in ‘plugin->QObject::metaObject()->QMetaObject::className()’, which is of non-class type ‘const char*’
make[1]: *** [.release-shared/obj/main.o] Error 1
...while doing make. Please help.
Just comment line 158 in file src/main.cpp

Cannot install passenger standalone 3.0.X on Mac OS X Mavericks, nginx compile fails

Trying to develop an existing Rails 3.0 application on a Mac with a clean install of Mavericks. Passenger Standalone was working fine under Mountain Lion. I upgraded to Mavericks, installed the command line tools, ruby, bundler, etc. When I get to this step:
passenger start
And passenger tries to compile nginx, it fails out with this error:
adding module in /Users/ben/.passenger/standalone/3.0.21-x86_64-ruby1.9.3-macosx-10.9/support/ext/nginx
*** The Phusion Passenger support files are not yet compiled. Compiling them for you... ***
*** Running 'rake nginx RELEASE=yes' in /Users/ben/.passenger/standalone/3.0.21-x86_64-ruby1.9.3-macosx-10.9/support/ext/nginx... ***
(in /Users/ben/.passenger/standalone/3.0.21-x86_64-ruby1.9.3-macosx-10.9/support)
g++ -Iext -D_REENTRANT -I/usr/local/include -DHASH_NAMESPACE="__gnu_cxx" -DHAS_ALLOCA_H -DHAS_SFENCE -DHAS_LFENCE -Wall -Wextra -Wno-unused-parameter -Wno-parentheses -Wpointer-arith -Wwrite-strings -Wno-long-long -Wno-missing-field-initializers -g -DPASSENGER_DEBUG -DBOOST_DISABLE_ASSERTS -o ext/common/libboost_oxt/aggregate.o -c ext/common/libboost_oxt/aggregate.cpp
In file included from ext/common/libboost_oxt/aggregate.cpp:8:
In file included from ext/oxt/system_calls.cpp:26:
In file included from ext/boost/thread.hpp:24:
In file included from ext/boost/thread/future.hpp:14:
In file included from ext/boost/exception_ptr.hpp:9:
In file included from ext/boost/exception/detail/exception_ptr.hpp:19:
In file included from ext/boost/exception/info.hpp:15:
In file included from ext/boost/exception/to_string_stub.hpp:15:
In file included from ext/boost/exception/detail/object_hex_dump.hpp:14:
ext/boost/exception/detail/type_info.hpp:53:9: error: cannot define the implicit default assignment operator for 'boost::exception_detail::type_info_', because non-static reference member 'type_' can't use default assignment operator
type_info_
^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/c++/v1/__tree:1246:35: note: in instantiation of member function 'std::__1::pair<boost::exception_detail::type_info_, boost::shared_ptr<boost::exception_detail::error_info_base> >::operator=' requested here
__cache->__value_ = *__first;
^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/c++/v1/__tree:1187:9: note: in instantiation of function template specialization 'std::__1::__tree<std::__1::pair<boost::exception_detail::type_info_, boost::shared_ptr<boost::exception_detail::error_info_base> >, std::__1::__map_value_compare<boost::exception_detail::type_info_, boost::shared_ptr<boost::exception_detail::error_info_base>, std::__1::less<boost::exception_detail::type_info_>, true>, std::__1::allocator<std::__1::pair<boost::exception_detail::type_info_, boost::shared_ptr<boost::exception_detail::error_info_base> > > >::__assign_multi<std::__1::__tree_const_iterator<std::__1::pair<boost::exception_detail::type_info_, boost::shared_ptr<boost::exception_detail::error_info_base> >, const std::__1::__tree_node<std::__1::pair<boost::exception_detail::type_info_, boost::shared_ptr<boost::exception_detail::error_info_base> >, void *> *, long> >' requested here
__assign_multi(__t.begin(), __t.end());
^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/c++/v1/map:766:21: note: in instantiation of member function 'std::__1::__tree<std::__1::pair<boost::exception_detail::type_info_, boost::shared_ptr<boost::exception_detail::error_info_base> >, std::__1::__map_value_compare<boost::exception_detail::type_info_, boost::shared_ptr<boost::exception_detail::error_info_base>, std::__1::less<boost::exception_detail::type_info_>, true>, std::__1::allocator<std::__1::pair<boost::exception_detail::type_info_, boost::shared_ptr<boost::exception_detail::error_info_base> > > >::operator=' requested here
__tree_ = __m.__tree_;
^
ext/boost/exception/info.hpp:160:26: note: in instantiation of member function 'std::__1::map<boost::exception_detail::type_info_, boost::shared_ptr<boost::exception_detail::error_info_base>, std::__1::less<boost::exception_detail::type_info_>, std::__1::allocator<std::__1::pair<const boost::exception_detail::type_info_, boost::shared_ptr<boost::exception_detail::error_info_base> > > >::operator=' requested here
c->info_ = info_;
^
ext/boost/exception/detail/type_info.hpp:55:41: note: declared here
detail::sp_typeinfo const & type_;
^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/c++/v1/utility:255:15: note: implicit default copy assignment operator for 'boost::exception_detail::type_info_' first required here
first = __p.first;
^
1 error generated.
rake aborted!
Command failed with status (1): [g++ -Iext -D_REENTRANT -I/usr/local/inclu...]
Tasks: TOP => nginx => agents/nginx/PassengerHelperAgent => ext/common/libboost_oxt.a => ext/common/libboost_oxt/aggregate.o
(See full trace by running task with --trace)
*** ERROR: command failed: sh ./configure --prefix=/tmp --with-cc-opt='-Wno-error' --without-pcre --without-http_rewrite_module --without-http_fastcgi_module '--add-module=/Users/ben/.passenger/standalone/3.0.21-x86_64-ruby1.9.3-macosx-10.9/support/ext/nginx'
You are using Phusion Passenger 3.0.21. That version does not work on Mavericks. Upgrade to 4.0.21 instead. By the way, the recommended way to install Passenger on OS X these days is via Homebrew. Follow the guide at https://www.phusionpassenger.com/download#open_source

Nginx-gridfs compiling #error must have a 64bit int type in Mac

running 10.7.2 follow the guide configure than append CFLAGS=-Wno-error to bypass the error, than I got stuck at
In file included from /usr/local/src/nginx-gridfs/mongo-c-driver/src/bson.h:24,
from /usr/local/src/nginx-gridfs/mongo-c-driver/src/mongo.h:24,
from /usr/local/src/nginx-gridfs/ngx_http_gridfs_module.c:43:
/usr/local/src/nginx-gridfs/mongo-c-driver/src/platform.h:50:2: error: #error must have a 64bit int type
make[1]: *** [objs/addon/nginx-gridfs/ngx_http_gridfs_module.o] Error 1
make: *** [build] Error 2
any idea?
I have had the same problem when compiling for Windows. You need to ensure you have a typedef for int64_t and uint64_t.
In order to address I needed to ensure that MONGO_USE__INT64 was defined.
For Mac you almost certainly have unistd.h available - so ensure you define MONGO_HAVE_UNISTD

Resources