简体   繁体   English

在Qt中使用SOIL库时出错

[英]Error while using SOIL library in Qt

I get the following error ":-1: error: cannot find -llibSOIL" when trying to add SOIL. 尝试添加SOIL时出现以下错误“:-1:错误:找不到-llibSOIL”。 Here are the steps I am doing: 这是我正在执行的步骤:

1) Add the following to .pro file 1)将以下内容添加到.pro文件

SOILPATH = "/home/swayu/Desktop/color quantization/Simple OpenGL Image Library"
INCLUDEPATH += "$${SOILPATH}/src"
LIBS += -L"$$(SOILPATH)/lib" -llibSOIL

*libSOIL.a file resides in the lib folder but still I am getting the above error. * libSOIL.a文件驻留在lib文件夹中,但是仍然出现上述错误。

2) include soil.h in the cpp file where I want to use the functionality offered by this library. 2)在我要使用此库提供的功能的cpp文件中包含Soil.h。

Try: 尝试:

LIBS += "-L$${SOILPATH}/lib" -llibSOIL

rather than: 而不是:

LIBS += -L"$$(SOILPATH)/lib" -llibSOIL

According to Qt doc , that's the right syntax (quotes are inclusing -L and use curly braces for the path variable "SOILPATH"). 根据Qt doc的说法,这是正确的语法(引号包括-L并在路径变量“ SOILPATH”中使用花括号)。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM