Pregunta

I'm working on a project from school, and we were given a .o and a corresponding .h file. We need to use several functions from the .o file in our .c program. Just placing it in the same directory doesn't work. I tried to look for something like this in the project properties, but no good. I keep getting ../code_files/Search.c:116: undefined reference to 'reportError'

I'm using Eclipse (Juno) CDT, gcc MinGW under Windows 7

I know it's possible to include .a files, but I couldn't find any indication on how to include a .o file #include "ErrorHandle.h" is included in the main c file.

Anyone knows how to include a .o file to a project? Thanks!

¿Fue útil?

Solución

I found this answer:

I tried doing something similar, only I didn't think of the miscellaneous thing enter image description here

Otros consejos

You can trivially turn the .o into a .a with ar cvs library.a object.o, and then add the .a to your project.

Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top