mandliya / algorithms_and_data_structures使用Qt打开编译报错解决办法

数据结构是程序员进及之路的关卡,Github上C++关注率最高的一份数据结构代码如下,但是在用Qt打开的时候发现有些小的细节上的报错,

Github:[https://github.com/mandliya/algorithms_and_data_structures]

1 CmakeList 增加pthread链接库,有些程序编译需要pthread依赖
        add_executable( ${demo_name} ${sourcefile} )
		if (${demo_name} STREQUAL "pstring_test")
                        target_link_libraries (${demo_name} pstring pUnitTest)
                endif()
                        target_link_libraries (${demo_name} pthread) #加上这句
2 reverse_word.cpp 添加头文件,否则std::reverse找不到该函数
#include <algorithm>
3 word_pattern.cpp 添加头文件,否则std::istream_iterator找不到该函数
#include <iterator>
4 最后一个是警告,即有符号整数与无符号整数进行了比较,更改如下:把int改为size_t
    for (size_t i = 0; i < pattern.size(); ++i)

最后开启你的data structure之路吧
在这里插入图片描述

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章