本文介绍了将目标文件链接到我的项目Eclipse CDR的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在学校里的一个项目上工作,我们得到了一个.o和一个相应的.h文件.我们需要在.c程序中使用.o文件中的几个函数.只是将其放在同一目录中是行不通的.我试图在项目属性中查找类似的内容,但是效果不好.我不断收到../code_files/Search.c:116: undefined reference to 'reportError'

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'

我正在使用Windows 7下的Eclipse(Juno)CDT,gcc MinGW

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

我知道可以包含.a文件,但是我找不到有关如何包含.o文件的任何指示.#include "ErrorHandle.h"包含在主c文件中.

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.

任何人都知道如何在项目中包含.o文件吗?谢谢!

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

推荐答案

我找到了这个答案:

我尝试做类似的事情,只是我没想到其他事情

I tried doing something similar, only I didn't think of the miscellaneous thing

这篇关于将目标文件链接到我的项目Eclipse CDR的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-30 05:45