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