libssh2.dylib ( http://www.libssh2.orgのlibssh2 ライブラリを使用して Matthew Wilkinson によってコンパイルされたサードパーティ ライブラリ) を xcode プロジェクトにリンクしようとしていますが、次のコードを試してみると:
const char * libssh2_version(int required_version);
printf("libssh2 version: %s", libssh2_version(0));
エラーは次のとおりです。
ld: warning: in /iaN's Work/Developer/Apple/iPhone/apps/PortScanner/libssh2.1.dylib, file was built for armv6 which is not the architecture being linked (i386)
Undefined symbols:
"_libssh2_version", referenced from:
-[Request connect] in Request.o
ld: symbol(s) not found
collect2: ld returned 1 exit status
libssh2 API を試すと、このエラーが発生します。誰でも何が問題なのか手がかりを持っていますか? これらは私がプロジェクトにリンクしたファイルです:
// SSH Librarys
#include "libssh2_config.h"
#include "libssh2.h"
#include "libssh2_sftp.h"
#ifdef HAVE_WINDOWS_H
#include <windows.h>
#endif
#ifdef HAVE_WINSOCK2_H
#include <winsock2.h>
#endif
#ifdef HAVE_SYS_SOCKET_H
#include <sys/socket.h>
#endif
#ifdef HAVE_NETINET_IN_H
#include <netinet/in.h>
#endif
# ifdef HAVE_UNISTD_H
#include <unistd.h>
#endif
#include <sys/types.h>
#include <fcntl.h>
#include <errno.h>
#include <stdio.h>
#include <ctype.h>
また、libssh2.dylib ファイルをフレームワークにリンクし、[ビルド] タブの [ヘッダー ファイルの検索] への再帰パスをファイル libssh2.a、libgcrypt.a、libgpg-error.a に追加しました。