1

I am currently developing an application in which the first step its to load a text file and read its contents.

For example:

string file = "myfile.txt";

i am calling another function in which i want to look for a certain pattern/occurrence

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

   char subString [blocksize];
   int n;

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

   .....

The function works perfectly on my Mac, but once I try to compile the application the compiler throws some error ld : illegal text-relocation.

The text file is in the same folder as the target app. I'm assuming this has something to do with embedding the text file?

hope someone can help or give a hint ! thanks in advance

nevan king
  • 112,709
  • 45
  • 203
  • 241
chris
  • 171
  • 3
  • 10
  • check this post: http://stackoverflow.com/questions/6650178/illegal-text-reloc-to-non-lazy-ptr-error-while-building-in-xcode-4-with-libav-l – MasterBeta Oct 27 '15 at 02:04

0 Answers0