![](/img/trans.png)
[英](CMake build) fatal error LNK1181: cannot open input file 'glew.lib'
[英]Link glew.lib as a static library with eclipse
我是C ++的新手,在問一下之前,我進行了很多搜索,我開始使用C ++進行OpenGL教程,我在GNU交叉編譯器中使用eclipse,我知道如何喜歡libXXX.a
格式的靜態庫,然后我想使用GLEW
庫,我有其源代碼和Windows的預編譯版本libglew32.lib
,如果使用make
來編譯源代碼,則會收到錯誤消息
make (e=2): The system cannot find the file specified. Makefile:131: recipe for target 'tmp/cygwin/default/shared/glew.o' failed make: *** [tmp/cygwin/default/shared/glew.o] Error 2
make (e=2): The system cannot find the file specified. Makefile:131: recipe for target 'tmp/cygwin/default/shared/glew.o' failed make: *** [tmp/cygwin/default/shared/glew.o] Error 2
。
如果我將庫放在庫文件夾中,然后像其他庫一樣將其添加到鏈接器中,則會在編譯項目時出現錯誤,例如undefined reference to 'glewExperimental'
或Invalid arguments 'Candidates are:void glfwMakeContextCurrent(*)'
所以我有兩個問題:
.lib
文件以與Eclipse一起使用嗎? 是,該怎么辦? 我用gcc
編譯了它,然后用ar
排列,最后得到了libglew.a
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.