用Qt Creator构建斯坦福CS106B项目的问题
Problems building Stanford CS106B projects with Qt Creator
我正在尝试使用他们的免费在线资源参加斯坦福大学CS106B课程(我不是斯坦福大学的学生)。由于他们现在需要登录ID才能访问当前季度主页上的许多页面,我使用的是2015年第一季度的存档页面,位于这里:
http://stanford.edu/class/archive/cs/cs106b/cs106b.1154/我从其他人那里看到过一些类似的问题,他们在构建作业项目时遇到了麻烦,但他们都使用其他IDE和/或操作系统,并且他们都得到了不同的错误信息。
我首先尝试Qt Creator 5.5,但当我得到错误时,我卸载了它并安装了Qt Creator 5.4.1。这是存档的旧页面上推荐的版本,所以我认为同一页面上的作业应该与这个版本兼容。我在一台运行Windows 8.1的电脑和另一台运行Windows Vista的电脑上试用了它。无论我使用的是哪个版本的Qt Creator或Windows,每次我试图构建斯坦福大学的作业或示例项目之一时,我都会在Qt Creator的问题窗口中得到以下消息:
cannot find -liberty
error: Id returned 1 exit status
collect2.exe
编译输出窗口显示以下错误:
I:/Program Files/Qt Creator/Tools/mingw492_32/bin/../lib/gcc/i686-w64-mingw32/4.9.2/../../../../i686-w64-mingw32/bin/ld.exe: cannot find -liberty
collect2.exe: error: ld returned 1 exit status
Makefile.Debug:247: recipe for target 'debugsimple-project.exe' failed
mingw32-make[1]: *** [debugsimple-project.exe] Error 1
mingw32-make[1]: Leaving directory 'I:/Moved from Drive 1/Documents/QT Creator projects/build-simple-project-Desktop_Qt_5_5_0_MinGW_32bit-Debug'
makefile:34: recipe for target 'debug' failed
mingw32-make: *** [debug] Error 2
09:42:28: The process "I:Program FilesQt CreatorToolsmingw492_32binmingw32-make.exe" exited with code 2.
Error while building/deploying project simple-project (kit: Desktop Qt 5.5.0 MinGW 32bit)
When executing step "Make"
我还应该注意到,我下载了Qt Creator中提供的一个示例项目,并且我能够构建和运行这个项目。只有斯坦福的项目才会给我错误。
我是新的c++和Qt Creator,所以可能有一些简单的东西,我没能做到。
修改.pro文件,使其不再尝试链接"liberty"库。
在simple-project。Pro文件的第107行有一个对"liberty"库的引用。我将其注释掉,然后编译示例simple-project。
LIBS += -lDbghelp
LIBS += -lbfd
LIBS += -liberty <-place "#" in front of this line
LIBS += -limagehlp
相关文章:
- Eulers 项目问题 no 345 听不懂几行代码
- 基本 Cuda C++项目集成问题
- C++ 从链表中删除项目时出现问题
- 双向链表问题 - 包含项目但不显示
- 在单元测试项目中包括 .c 文件,并从多个 cpp 文件访问它而不会出现链接问题
- 如何解决在 clr 项目的特定文件中写入数据的问题?
- 在Android Studio项目中使用tensorflow lite C++API的问题
- 相同的代码,不同的结果?从其他项目包含有什么问题?
- 我的自定义 C++ DLL 的 C# 项目中的 DLL 端口有什么问题?
- 在QtCreator中配置c ++项目时出现问题
- 编译示例 Cinder 项目时存在大量未解决的外部问题
- 将C库链接到Qt项目时出现问题
- VS 2017 C 静态LIB与 /MD项目依赖性问题编辑
- 测试项目在访问私有静态方法时遇到问题,尽管我从未直接调用过它
- 在 win32 控制台项目 VS2015 中静态链接 libcurl 的问题
- 鸟类调查中的项目在代码中遇到问题.如何像数据库系统一样存储数据
- 小型学校项目存在多个问题
- 为该项目报告C++奇怪的Klocwork问题
- XCode 导入C++项目问题:"referenced from"
- Visual Studio 2010/2012插件项目问题