草庐IT

qmake-variable-reference

全部标签

c++ - 如何在 qmake 项目中使用 Boost 库?

前几天编译了Boostver.1.53.0用于VS2012。它工作正常,编译正常。现在我想将Boost与QtCreator一起使用。在我包含的.pro文件中INCLUDEPATH+=C:\boost\boost_1_53_0\-lboost_filesystemLIBS+=C:/boost/boost_1_53_0/stage/lib/但是当我编译时出现2个错误::-1:error:cannotfindC:/boost/boost_1_53_0/stage/lib/:Permissiondeniedcollect2.exe:-1:error:error:ldreturned1exits

c++ - 链接 boost 库时出现另一个 "undefined reference"错误

我已经看到其他几篇文章处理完全相同的问题。但是,他们的解决方案似乎都不适合我。我正在编译以下代码:#include#include#includeusingnamespaceboost::numeric::ublas;intmain(){matrixmat1(3,3);matrixmat2(3,3);matrixmat3(3,3);unsignedk=0;for(unsignedi=0;i我正在使用命令行编译:$g++matrix_test.cpp-omatrix_test-lboost_system-lboost_timer并收到以下错误:usr/lib/gcc/i686-redha

c++ - 对 `__imp_WSACleanup' 的 undefined reference

这是我使用winsock的第一个程序。如您所见,我有#include并链接ws2_32.dll,但代码仍然无法编译:#include#pragmacomment(lib,"ws2_32")classCInitSock{public:CInitSock(BYTEminorVer=2,BYTEmajorVer=2){//initializeWS2_32.dllWSADATAwsaData;WORDsockVersion=MAKEWORD(minorVer,majorVer);if(::WSAStartup(sockVersion,&wsaData)!=0){exit(0);}}//rele

c++ - 对静态函数的 undefined reference

当我在A类中创建一个静态函数并且我想从B类函数中调用它时,我遇到了一个奇怪的问题。我明白了undefinedreferenceto`A::funcA(int)'这是我的源代码:一个.cpp#include"a.h"voidfuncA(inti){std::cout啊啊#ifndefA_H#defineA_H#includeclassA{public:A();staticvoidfuncA(inti);};#endif//A_Hb.cpp#include"b.h"voidB::funcB(){A::funcA(5);}和b.h#ifndefB_H#defineB_H#include"a.

windows - 在 Windows 中,是什么让 qmake 将 "d"附加到调试目标?

我正在使用提供的.pro文件,出于某种原因,它被配置为调试库没有在其库名称后附加“d”。是什么原因造成的,我该如何恢复?例如QtGui4.dll(发布)和QtGuid4.dll(调试)谢谢。 最佳答案 将此添加到.pro文件,它将为mac附加_debug,为windows调试构建附加d。CONFIG+=debug_and_releaseCONFIG(debug,debug|release){mac:TARGET=$$join(TARGET,,,_debug)win32:TARGET=$$join(TARGET,,,d)}CONFIG

c++ - mingw 构建错误 : undefined reference to `__chkstk_ms'

我刚刚在windows上安装了mingw,写了一个helloWorld程序来测试一下。代码:#includeintmain(){printf("hello,world!\n");return0;}结果:C:/MinGW/lib/crt2.o:crt1.c:(.text+0x1f1):undefinedreferenceto`__chkstk_ms'C:/MinGW/lib/libmingwex.a(glob.o):glob.c:(.text+0x5e3):undefinedreferenceto`__chkstk_ms'C:/MinGW/lib/libmingwex.a(glob.o)

Windows bundle 安装 : HOME environment variable (or HOMEDRIVE and HOMEPATH) must be set and point to a directory (RuntimeError)

我成功安装了bundlergeminstallbundler然后我尝试做bundleinstall我收到以下错误:C:/Ruby22-x64/lib/ruby/site_ruby/2.2.0/rbreadline.rb:1097:in`':HOMEenvironmentvariable(orHOMEDRIVEandHOMEPATH)mustbesetandpointtoadirectory(RuntimeError)fromC:/Ruby22-x64/lib/ruby/site_ruby/2.2.0/rbreadline.rb:17:in`'fromC:/Ruby22-x64/lib/

windows - QMake:使用相对路径引用库

我有一个使用SQLite的Qt项目,所以我有以下目录结构:C:\Workspace\MyProject\MyProject.proC:\Workspace\MyProject\sqlite3\sqlite3.lib使用绝对路径添加sqlite3.lib效果很好:LIBS+=-L"c:/Workspace/MyProject/sqlite3"-lsqlite3但我不能让它与相对路径一起工作。我尝试:LIBS+=-L"sqlite3"-lsqlite3但是失败了::-1:error:LNK1104:cannotopenfile'sqlite3\sqlite3.lib'我试过了,但是LIBS

c++ - 对 'inflateInit2_' 的 undefined reference

我正在使用CodeBlocksIDE,我想为SFML安装TiledMapEditor。所以,我下载了源代码并将其导入到我的项目中。不幸的是,由于缺少zlib库,构建完成时出现错误。我下载了它并重新构建。这次我收到一条错误消息:undefinedreferenceto`inflateInit2_'|undefinedreferenceto`inflateEnd'|undefinedreferenceto`inflateEnd'|在网上我找到了加入链接器命令-lz的建议,但是编译器拒绝抛出错误:找不到-lz。有人知道怎么解决吗? 最佳答案

c - Windows 操作系统中 Code::Blocks 编辑器中对 fork() 的 undefined reference

当我在Windows操作系统的Code::Blocks中运行以下代码时。我曾经收到一个错误,称为对fork()的undefinedreference。我确实设置/选择了GCC编译器作为我的默认编译器。#include#includevoidmain(){intx;x=0;fork();x=1;.......}请帮我看看,我可以在windows环境下对Code::Blocks中的unix/linux程序进行正确处理吗?然后我写另一个程序,main(){intx=0;if(x==0){printf("X=%d",x);sleep(1000);//useddelayalsox=1;print