如何将库添加到Eclipse项目中 [英] How to add a library to an Eclipse project
本文介绍了如何将库添加到Eclipse项目中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
库:gdi32.lib - >在MinGW中:libgdi32.a
无论我尝试什么,都不行。有没有人可以告诉我什么进入哪里,要完成这个?
详细信息:
我有功能调用:
wndclassex.hbrBackground =(HBRUSH)GetStockObject(WHITE_BRUSH);
...导致错误:
WinMain.o:功能WinMain:
Z:/ mtsts_workspace / MTSTS / Debug /../ WinMain.c:29:
undefined reference to` GetStockObject @ 4'
我有函数调用:
TextOut(hdc,0,0,TEXT(Hello World!),12);
...导致错误:
WinMain.o:在函数`WndProc':
Z:/ mtsts_workspace / MTSTS / Debug /../ WinMain.c:88:
undefined reference to` TextOutA @ 20'
解决方案
右键点击项目 - >属性 - > C / C ++ Build,转到Library并将其添加到
如果库是 libgdi32.a
您应该在库部分添加 gdi32
。
I'm trying to add a Library to Eclipse Galileo and it won't work out.
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 ?
Details:
I have the function call:
wndclassex.hbrBackground = (HBRUSH)GetStockObject(WHITE_BRUSH);
... lead's to error:
WinMain.o: In function `WinMain':
Z:/mtsts_workspace/MTSTS/Debug/../WinMain.c:29:
undefined reference to `GetStockObject@4'
And I have the function call:
TextOut(hdc, 0, 0, TEXT("Hello World!"), 12);
... lead's to error:
WinMain.o: In function `WndProc':
Z:/mtsts_workspace/MTSTS/Debug/../WinMain.c:88:
undefined reference to `TextOutA@20'
解决方案
right click to project -> Properties -> C/C++ Build, go to Library and add it there.
if the library is libgdi32.a
, you should add gdi32
in the library section.
这篇关于如何将库添加到Eclipse项目中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文