簡體   English   中英

將glew.lib鏈接為帶有eclipse的靜態庫

[英]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(*)'

所以我有兩個問題:

  1. 如何將源代碼正確編譯為可在eclipse中使用的靜態庫。
  2. 我可以添加.lib文件以與Eclipse一起使用嗎? 是,該怎么辦?

我用gcc編譯了它,然后用ar排列,最后得到了libglew.a

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM