未找到libcrypto.a符号架构i386
问题描述:
xcode 6.3 beta未找到libcrypto.a符号架构i386
我在我的项目中使用libcrypto.a。
我的应用程序可以在我的ipod touch5(armv7)上编译和运行。
但是,当我尝试在iphone5的模拟器上运行我的应用程序,我得到的错误:
"_closedir$UNIX2003", referenced from:
_OPENSSL_DIR_end in libcrypto.a(o_dir.o)
"_fputs$UNIX2003", referenced from:
_write_string in libcrypto.a(ui_openssl.o)
_read_string in libcrypto.a(ui_openssl.o)
"_opendir$INODE64$UNIX2003", referenced from:
_OPENSSL_DIR_read in libcrypto.a(o_dir.o)
"_readdir$INODE64", referenced from:
_OPENSSL_DIR_read in libcrypto.a(o_dir.o)
ld: symbol(s) not found for architecture i386
后来我查了一下架构的libcrypto.a我使用的是支持使用命令:
lipo -info libcrypto.a
并得到结果:
Architectures in the fat file: libcrypto.a are: i386 armv7 armv7s arm64
任何建议将赞赏,感谢:)
答
在任何地方创建新的m文件。 和定义所有丢失的功能在这里:
#include <stdio.h>
#include <unistd.h>
#include <string.h>
#include <stdlib.h>
#include <dirent.h>
#include <fnmatch.h>
FILE *fopen$UNIX2003(const char *filename, const char *mode)
{
return fopen(filename, mode);
}
int fputs$UNIX2003(const char *res1, FILE *res2){
return fputs(res1,res2);
}
int nanosleep$UNIX2003(int val){
return usleep(val);
}
char* strerror$UNIX2003(int errornum){
return strerror(errornum);
}
double strtod$UNIX2003(const char *nptr, char **endptr){
return strtod(nptr, endptr);
}
size_t fwrite$UNIX2003(const void *a, size_t b, size_t c, FILE *d)
{
return fwrite(a, b, c, d);
}
DIR * opendir$INODE64(char * dirName)
{
return opendir(dirName);
}
struct dirent * readdir$INODE64(DIR * dir)
{
return readdir(dir);
}