0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

fputs$UNIX2003 fwrite$UNIX2003 でエラーが出たら

Posted at

開発環境

OS X 10.9.5
Xcode 6.1.1 (6A2008a)
Cocos2d-x 3.3

現象

Cocos2d-x 3.3 で作っていたアプリをシミュレータでビルドしようとした時に発生。
i386でシンボルが見つからないとの事。

Cocos2d-x 3.3rc0以前では、fwrite$UNIX2003やstrerror$UNIX2003が無いことでエラーになることはあったが、3.3 finalではCCImage内で定義されていてエラーは出なくなっている。

対処法

足りていない関数を.cにゴリゴリ書くことで解決。

UNIX2003.c
#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);
}
size_t fwrite$UNIX2003( const void *a, size_t b, size_t c, FILE *d )
{
    return fwrite(a, b, c, d);
}
char* strerror$UNIX2003(int errornum){
    return strerror(errornum);
}
*/

int fputs$UNIX2003(const char *res1, FILE *res2)
{
    return fputs(res1,res2);
}

int nanosleep$UNIX2003(int val)
{
    return usleep(val);
}
double strtod$UNIX2003(const char *nptr, char **endptr)
{
    return strtod(nptr, endptr);
}


0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?