1

我正在尝试在我的 Mac 机器上安装 Gammu。我已经安装了 cmake 以及 Apple Developer Command Line Tools。

当我跑步时./configure,我得到以下信息:

Avi-MacBook-Pro:gammu-1.32.0 avi$ ./configure
Wrapper script for configuring CMake for Gammu.

This provides limited compatibility with configure, if you want full
configuration control, use directly CMake. More information about CMake
is available at <http://www.cmake.org>.

-- Configuring Gammu 1.32.0
-- Could NOT find PkgConfig (missing:  PKG_CONFIG_EXECUTABLE) 
-- Could NOT find PkgConfig (missing:  PKG_CONFIG_EXECUTABLE) 
-- Could NOT find Doxygen (missing:  DOXYGEN_EXECUTABLE) 
-- Could NOT find Threads (missing:  Threads_FOUND) 
-- MySQL not found.
-- Found PostgreSQL: /usr/include, /usr/lib/libpq.dylib
-- libdbi not found.
-- Could NOT find Libintl (missing:  LIBINTL_INCLUDE_DIR LIBINTL_LIB_FOUND) 
-- glib-2.0 not found.
-- gobject-2.0 not found.
-- Bluez not found.
-- Using OSX Bluetooth stack
-- Bluetooth support enabled
-- libusb-1.0 not found.
-- Nokia support enabled
-- Nokia MBUS2 protocol enabled
-- Nokia FBUS2 protocol enabled
-- Nokia FBUS2DLR3 protocol enabled
-- Nokia DKU2PHONET protocol enabled
-- Nokia DKU2AT protocol enabled
-- Nokia DKU5FBUS2 protocol enabled
-- Nokia FBUS2PL2303 protocol enabled
-- Nokia FBUS2BLUE protocol enabled
-- Nokia PHONETBLUE protocol enabled
-- Nokia BLUEFBUS2 protocol enabled
-- Nokia BLUEPHONET protocol enabled
-- Nokia 3320 and compatible phones support enabled
-- Nokia 650 and compatible phones support enabled
-- Nokia 61xx and compatible phones support enabled
-- Nokia 6510 and compatible phones support enabled
-- Force using 6210 frames for calendar for DCT4 phones disabled
-- Nokia 7110 and compatible phones support enabled
-- Nokia 9210 and compatible phones support enabled
-- Nokia 3650 and compatible phones support enabled
-- AT support enabled
-- AT protocol enabled
-- AT protocol over Bluetooth enabled
-- AT phones support enabled
-- Alcatel support enabled
-- Alcatel protocol enabled
-- Alcatel phones support enabled
-- OBEX compatible phones support enabled
-- OBEX protocol over Bluetooth enabled
-- Generic OBEX phones support enabled
-- AT with OBEX phones support enabled
-- Symbian phones support (S60) enabled
-- Symbian phones support (gnapplet) enabled
-- GNAPBUS protocol over Bluetooth enabled
-- Gnapplet phones support enabled
-- S60 phones support enabled
-- Cell Broadcast messages support enabled
-- Backup/Restore functions enabled
/var/lock is not writable, skipping locking tests!
-- Init script not being installed, install it by -DINSTALL_LSB_INIT=ON
-- Udev rules not being installed, install it by -DINSTALL_UDEV_RULES=ON
-- Configuring done
-- Generating done
-- Build files have been written to: /Users/avi/Desktop/gam/gammu-1.32.0/build-configure

当我运行时make,我得到错误:

Avi-MacBook-Pro:gammu-1.32.0 avi$ make
make -C build-configure
[  1%] Building C object helper/CMakeFiles/string.dir/string.o
In file included from /Users/avi/Desktop/gam/gammu-1.32.0/helper/string.c:1:
/Users/avi/Desktop/gam/gammu-1.32.0/helper/string.h:14:10: error: 'string.h'
      file not found with <angled> include; use "quotes" instead
#include <string.h>
         ^~~~~~~~~~
         "string.h"
/Users/avi/Desktop/gam/gammu-1.32.0/helper/string.h:39:57: error: unknown type
      name 'size_t'
extern int strncasecmp (const char *s1, const char *s2, size_t n);
                                                        ^
/Users/avi/Desktop/gam/gammu-1.32.0/helper/string.h:58:1: error: unknown type
      name 'wchar_t'
wchar_t         towlower                        (wchar_t c);
^
/Users/avi/Desktop/gam/gammu-1.32.0/helper/string.h:58:22: error: unknown type
      name 'wchar_t'
wchar_t         towlower                        (wchar_t c);
                                                 ^
In file included from /Users/avi/Desktop/gam/gammu-1.32.0/helper/string.c:3:
/Users/avi/Desktop/gam/gammu-1.32.0/build-configure/helper/../include/gammu-unicode.h:18:10: fatal error: 
      'wchar.h' file not found
#include <wchar.h>
         ^
5 errors generated.
make[3]: *** [helper/CMakeFiles/string.dir/string.o] Error 1
make[2]: *** [helper/CMakeFiles/string.dir/all] Error 2
make[1]: *** [all] Error 2
make: *** [all] Error 2
4

2 回答 2

0

它丢失了很多文件,你必须得到几个丢失的文件,特别是当你为你的服务器使用 MAMP 时。这就是我在我的 Mac 上成功安装 gammu 的方式

要在 Mac OS X 上安装 gammu,您需要:来自 mysql.com 的 Mac OS X 10.8.4、Xcode 4.6.3、MAMP 2.1.4 和 Mysql(用于头文件和库文件) Gammu 1.33.0、Cmake 2.8.11.2 和使用 Homebrew 包管理器安装它。

使用命令行工具安装 xcode 安装 MAMP

要安装 Homebrew:

ruby -e "$(curl -fsSL https://raw.github.com/mxcl/homebrew/go)"

然后,您可以使用以下命令安装 cmake:

$ brew install cmake

下载游戏

http://sourceforge.net/projects/gammu/files/gammu/1.33.0/gammu-1.33.0.tar.gz

提取它并放入您的主文件夹

$ ./configure
$ make

使用 MAMP 时:

MAMP 没有必要的头文件和库文件,因此只需从 mysql.com 安装 mysql 选择 64 位 osx 10.8

将头文件从源代码安装或包含它们的二进制安装(Mountain Lion 的库存 MySQL 二进制文件包括这些)从 /usr/local/mysql/include 复制到 /Applications/MAMP/Library/include。

要访问 /usr/local,您可以在 safari 中键入 /usr/local/mysql/lib/libmysqlclient_r.dylib 并单击 Enter,您将被定向到查找器中的该文件。

$ /bin/ls -1 /usr/local/mysql/lib/libmysqlclient* | xargs -t -n1 -I% ln -fs % /Applications/MAMP/Library/lib/

ln -fs /usr/local/mysql/lib/libmysqlclient.18.dylib /Applications/MAMP/Library/lib/
ln -fs /usr/local/mysql/lib/libmysqlclient.a /Applications/MAMP/Library/lib/
ln -fs /usr/local/mysql/lib/libmysqlclient.dylib /Applications/MAMP/Library/lib/
ln -fs /usr/local/mysql/lib/libmysqlclient_r.18.dylib /Applications/MAMP/Library/lib/
ln -fs /usr/local/mysql/lib/libmysqlclient_r.a /Applications/MAMP/Library/lib/
ln -fs /usr/local/mysql/lib/libmysqlclient_r.dylib /Applications/MAMP/Library/lib/

现在,让我们编译带有mysql支持的gammu,像往常一样提取gammu,编辑cmake/FindMySQL.cmake,添加你的MAMP mysql路径,它应该是这样的:

find_program(MYSQL_CONFIG mysql_config
${MYSQL_CONFIG_PREFER_PATH}
/usr/local/bin/
/usr/bin/
/Applications/MAMP/Library/bin
/Applications/MAMP/Library
)

然后,让我们配置 cmake:

$ mkdir build
$ cd build
$ cmake -DMYSQL_LIBRARIES=/Applications/MAMP/Library/lib/libmysqlclient_r.dylib ..
$ make
$ sudo make install

我希望这将帮助您安装 gammu。

于 2014-09-04T15:57:26.627 回答
0

您的问题与 CMake 无关。您的 C 编译器找不到 C 标准中定义的某些头文件。这很奇怪,可能与Gammu无关。

你能检查一下你是否可以编译一个简单的 hello word C 测试程序,其中包括?如果失败,则必须修复编译器。

于 2014-01-18T08:14:48.820 回答