I am trying to link libssh2.dylib (a 3rd party library compiled by Matthew Wilkinson using libssh2 library from http://www.libssh2.org) to my xcode project but when I try the following code:
const char * libssh2_version(int required_version);
printf("libssh2 version: %s", libssh2_version(0) );
Heres the error I get:
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
I get this error when I try any libssh2 API. Anybody have any clue to whats the problem? These are the files I've linked to the project:
// 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>
I have also linked the libssh2.dylib file to the frameworks and added a recursive path to "Search Header Files" on Build Tab to the files libssh2.a, libgcrypt.a, libgpg-error.a.
Please help.