I am trying to call a C function from a C++/Qt class. Basically, the C++ code gets the filename from the open file dialog, and passes it to a C function to read and parse the file. I am using g++ and gcc to compile the C++ and C code respectivly.

C header:
Qt Code:
  1. #ifndef READ_FILE
  2. #define READ_FILE
  3.  
  4. int readFile( FILE* fd, int a, int b, char *data);
  5.  
  6. #endif
To copy to clipboard, switch view to plain text mode 

C++ calling function just calls readFile( fd, a, b, data ) with a #include "readFile" preprocessor. I have tried putting in an extern line and prototyping the function in the C++/Qt file:
Qt Code:
  1. extern int readFile( FILE* fd, int a, int b, char *data);
  2.  
  3. int readFile( FILE* fd, int a, int b, char *data);
To copy to clipboard, switch view to plain text mode 
However, each time I compile, I get a linker error "Undefined Reference readFile(IO_FILE, int, int, char*)". Anyone have any thoughts on what my issue is? Also, if I comment out the call to readFile in the C++/Qt, the program builds and executes (but of course does not read through the file )

Thanks!!