_fopen$UNIX2003 referenced from OpenSSL problem
I'm using compiled OpenSSL for an iPhone app. I followed the instructions here http://www.x2on.de/kontakt/ so I could develop rsa operation on iPhone simulator. The problem is that I get this error when building the project:
_fopen$UNIX2003 referenced from
_BIO_new_file开发者_如何学JAVA in libcrypto_i386.a(bss_file.o) _file_ctrl in libcrypto_i386.a(bss_file.o) Symbol(s) not found
Every time I invoke this function to get a public key:
RSA * d2i_RSAPublicKey(RSA **a, const unsigned char **pp, long length);
Some places point this is a version problem so I should build openssl for a different architecture (currently using iPhoneOS3.2.sdk), is that right?
Thanks for your comments.
Just create new *.c
file and copy this code to it:
#include <stdio.h>
#include <unistd.h>
#include <string.h>
#include <stdlib.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);
}
Found this solution here: http://helpdesk.metaio.com/questions/35905/undefined-symbols-for-architecture-i386-xcode-6-ios-8-beta-6/36538
This and this both suggest for Mac OS X that your problem is two different components compiled for two different SDKs.
You should try cleaning the project's build output (make clean
) and rebuilding everything with the same compiler/SDK.
精彩评论