La bla bla
La bla bla

Reputation: 8708

Link object file to my project Eclipse CDR

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!

Upvotes: 3

Views: 7430

Answers (2)

La bla bla
La bla bla

Reputation: 8708

I found this answer:

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

Upvotes: 8

John Auld
John Auld

Reputation: 486

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

Upvotes: 2

Related Questions