如何将库添加到 Eclipse 项目 [英] How to add a library to an Eclipse project
本文介绍了如何将库添加到 Eclipse 项目的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在尝试向 Eclipse Galileo 添加一个库,但没有成功.
I'm trying to add a Library to Eclipse Galileo and it won't work out.
库:gdi32.lib -> 在 MinGW 中:libgdi32.a
Library: gdi32.lib -> In MinGW: libgdi32.a
无论我尝试什么,它都不起作用.任何人都可以确切地告诉我要在何处输入以完成此操作吗?
Whatever I try, it doesn't work. Can anyone tell me EXACTLY what to enter where, to accomplish this ?
详情:
我有函数调用:
wndclassex.hbrBackground = (HBRUSH)GetStockObject(WHITE_BRUSH);
...导致错误:
WinMain.o: In function `WinMain':
Z:/mtsts_workspace/MTSTS/Debug/../WinMain.c:29:
undefined reference to `GetStockObject@4'
我有函数调用:
TextOut(hdc, 0, 0, TEXT("Hello World!"), 12);
...导致错误:
WinMain.o: In function `WndProc':
Z:/mtsts_workspace/MTSTS/Debug/../WinMain.c:88:
undefined reference to `TextOutA@20'
推荐答案
右键单击项目 -> 属性 -> C/C++ Build,转到 Library 并在那里添加.
right click to project -> Properties -> C/C++ Build, go to Library and add it there.
如果库是libgdi32.a
,你应该在library部分添加gdi32
.
if the library is libgdi32.a
, you should add gdi32
in the library section.
这篇关于如何将库添加到 Eclipse 项目的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文