非法文本重定位错误,如何嵌入文本文件?

时间:2012-06-11 16:12:45

标签: ios ipad parsing

我目前正在开发一个应用程序,其中第一步是加载文本文件并读取其内容。

例如:

string file = "myfile.txt";

我正在调用另一个函数,我想在其中查找某个模式/事件

void read(string pattern, const char *content) {

   char subString [blocksize];
   int n;

   char *search = pattern;
   pos = strstr(content,search);

   .....

该功能在我的Mac上完美运行,但是一旦我尝试编译应用程序,编译器就会抛出一些错误ld : illegal text-relocation.

文本文件与目标应用程序位于同一文件夹中。 我假设这与嵌入文本文件有关?

希望有人可以提供帮助或提示! 提前谢谢

0 个答案:

没有答案
相关问题