Tôi đã cố gắng sử dụng tập tin glew32.lib để liên kết trong dự án của tôi, hơn tôi biên dịch Glew nguồn của bản thân mình để có được tập tin glew.a. Bây giờ, tôi có các lỗi liên kết này trong dự án của tôi:Làm thế nào để sử dụng GLEW với MinGW
g++ -o Chapter10(OpenCLTest).exe src\Chapter10(OpenCLTest).o -lopengl32 -lglew -lglut32 -lglu32 -lopencl
src\Chapter10(OpenCLTest).o:Chapter10(OpenCLTest).cpp:(.text+0x167): undefined reference to `_imp____glewBindBuffer'
src\Chapter10(OpenCLTest).o:Chapter10(OpenCLTest).cpp:(.text+0x39a): undefined reference to `_imp__glewInit'
src\Chapter10(OpenCLTest).o:Chapter10(OpenCLTest).cpp:(.text+0x3a7): undefined reference to `_imp__glewIsSupported'
src\Chapter10(OpenCLTest).o:Chapter10(OpenCLTest).cpp:(.text+0x48a): undefined reference to `_imp____glewGenBuffers'
src\Chapter10(OpenCLTest).o:Chapter10(OpenCLTest).cpp:(.text+0x495): undefined reference to `_imp____glewBindBuffer'
src\Chapter10(OpenCLTest).o:Chapter10(OpenCLTest).cpp:(.text+0x4dd): undefined reference to `_imp____glewBufferData'
src\Chapter10(OpenCLTest).o:Chapter10(OpenCLTest).cpp:(.text+0x50b): undefined reference to `_imp____glewGetBufferParameteriv'
src\Chapter10(OpenCLTest).o:Chapter10(OpenCLTest).cpp:(.text+0x1d67): undefined reference to `_imp____glewBindBuffer'
src\Chapter10(OpenCLTest).o:Chapter10(OpenCLTest).cpp:(.text+0x1d7f): undefined reference to `_imp____glewDeleteBuffers'
src\Chapter10(OpenCLTest).o:Chapter10(OpenCLTest).cpp:(.text+0x1d95): undefined reference to `_imp____glewBindBuffer'
src\Chapter10(OpenCLTest).o:Chapter10(OpenCLTest).cpp:(.text+0x1dad): undefined reference to `_imp____glewDeleteBuffers'
src\Chapter10(OpenCLTest).o:Chapter10(OpenCLTest).cpp:(.text+0x2078): undefined reference to `_imp____glewBindBuffer'
collect2: ld returned 1 exit status
Tốt nhất là giải quyết vấn đề này nhưng theo cách tôi muốn hỏi là có bất kỳ triển khai nào khác của gl extentl?
Tôi e rằng bạn sẽ cần tìm các thư viện được biên dịch bằng g ++ hoặc tự xây dựng chúng. – Mat
Bạn đang sử dụng trình biên dịch nào? Hệ điều hành nào? Tôi nghĩ rằng nó chỉ là một vấn đề để xác định trình biên dịch, nơi để tìm các tập tin lib (hoặc .so tùy thuộc vào hệ thống chúng ta đang nói về). Tôi sử dụng GLEW kể từ hơn một năm trên Linux Box của tôi và mọi thứ rất thẳng về phía trước. Làm ơn cho tôi biết. –
MinGW (tiêu đề bài viết) Windows 7 – itun