コード:
#include <windows.h>
#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
void Step2()
{
vector<string> vTextAll;
int i;
for( i=0; i<DEF_NUM; i++ )
{
char szFile[256];
sprintf_s( szFile, "text%d.txt", i );
FILE *file = NULL;
fopen_s( &file, szFile, "rt" );
if( file != NULL )
{
char szBuf[8000];
while( !feof(file) )
{
memset( szBuf, 0, sizeof(szBuf) );
fgets( szBuf, sizeof(szBuf), file );
vTextAll.push_back( szBuf );
}
fclose(file);
file = NULL;
}
}
unsigned int j;
for( j=0; j<vTextAll.size(); j++ )
{
char szBuf[8000];
char szBuf2[8000];
strcpy_s( szBuf, vTextAll.at(j).c_str() );
if( strstr(szBuf,"<div class=\"home-img\"><a href=\"https://tsundora.com/") )
{
memset( szBuf2, 0, sizeof(szBuf2) );
char *s, *e;
s = strstr( szBuf, "https://tsundora.com" );
e = strstr( s, "\"" );
for( int k=0; k+s!=e; k++ )
{
szBuf2[k] = *(s+k);
}
g_vLink1.push_back( szBuf2 );
}
}
// sort( g_vLink1.begin(), g_vLink1.end() );
}
コンパイルエラーメッセージです。
1>コンパイルしています...
1>ツンドラから艦これの画像ダウンロードツール.cpp
1>c:\program files (x86)\microsoft visual studio 9.0\vc\include\algorithm(3032) : error C2784: 'bool std::operator <(const std::vector<_Ty,_Alloc> &,const std::vector<_Ty,_Alloc> &)' : テンプレート 引数を 'const std::vector<_Ty,_Alloc> &' に対して 'std::basic_string<_Elem,_Traits,_Ax>' から減少できませんでした
1> with
1> [
1> _Elem=char,
1> _Traits=std::char_traits<char>,
1> _Ax=std::allocator<char>
1> ]
1> c:\program files (x86)\microsoft visual studio 9.0\vc\include\vector(1322) : 'std::operator <' の宣言を確認してください。
1> c:\program files (x86)\microsoft visual studio 9.0\vc\include\algorithm(3087) : コンパイルされたクラスの テンプレート のインスタンス化 'std::pair<_Ty1,_Ty2> std::_Unguarded_partition<_RanIt>(_RanIt,_RanIt)' の参照を確認してください
1> with
1> [
1> _Ty1=std::_Vector_iterator<std::string,std::allocator<std::string>>,
1> _Ty2=std::_Vector_iterator<std::string,std::allocator<std::string>>,
1> _RanIt=std::_Vector_iterator<std::string,std::allocator<std::string>>
1> ]
1> c:\program files (x86)\microsoft visual studio 9.0\vc\include\algorithm(3115) : コンパイルされたクラスの テンプレート のインスタンス化 'void std::_Sort<std::_Vector_iterator<_Ty,_Alloc>,__w64 int>(_RanIt,_RanIt,_Diff)' の参照を確認してください
1> with
1> [
1> _Ty=std::string,
1> _Alloc=std::allocator<std::string>,
1> _RanIt=std::_Vector_iterator<std::string,std::allocator<std::string>>,
1> _Diff=__w64 int
1> ]
1> c:\users\user\documents\visual studio 2008\projects\ツンドラから艦これの画像ダウンロードツール - コピー\ツンドラから艦これの画像ダウンロードツール\ツンドラから艦これの画像ダウンロードツール.cpp(104) : コンパイルされたクラスの テンプレート のインスタンス化 'void std::sort<std::_Vector_iterator<_Ty,_Alloc>>(_RanIt,_RanIt)' の参照を確認してください
1> with
1> [
1> _Ty=std::string,
1> _Alloc=std::allocator<std::string>,
1> _RanIt=std::_Vector_iterator<std::string,std::allocator<std::string>>
1> ]
1>c:\program files (x86)\microsoft visual studio 9.0\vc\include\algorithm(3032) : error C2784: 'bool std::operator <(const std::vector<_Ty,_Alloc> &,const std::vector<_Ty,_Alloc> &)' : テンプレート 引数を 'const std::vector<_Ty,_Alloc> &' に対して 'std::basic_string<_Elem,_Traits,_Ax>' から減少できませんでした
1> with
1> [
1> _Elem=char,
1> _Traits=std::char_traits<char>,
1> _Ax=std::allocator<char>
1> ]
1> c:\program files (x86)\microsoft visual studio 9.0\vc\include\vector(1322) : 'std::operator <' の宣言を確認してください。
1>c:\program files (x86)\microsoft visual studio 9.0\vc\include\algorithm(3032) : error C2784: 'bool std::operator <(const std::vector<_Ty,_Alloc> &,const std::vector<_Ty,_Alloc> &)' : テンプレート 引数を 'const std::vector<_Ty,_Alloc> &' に対して 'std::basic_string<_Elem,_Traits,_Ax>' から減少できませんでした
1> with
1> [
1> _Elem=char,
1> _Traits=std::char_traits<char>,
1> _Ax=std::allocator<char>
1> ]
1> c:\program files (x86)\microsoft visual studio 9.0\vc\include\vector(1322) : 'std::operator <' の宣言を確認してください。
1>c:\program files (x86)\microsoft visual studio 9.0\vc\include\algorithm(3032) : error C2784: 'bool std::operator <(const std::vector<_Ty,_Alloc> &,const std::vector<_Ty,_Alloc> &)' : テンプレート 引数を 'const std::vector<_Ty,_Alloc> &' に対して 'std::basic_string<_Elem,_Traits,_Ax>' から減少できませんでした
1> with
1> [
1> _Elem=char,
1> _Traits=std::char_traits<char>,
1> _Ax=std::allocator<char>
1> ]
1> c:\program files (x86)\microsoft visual studio 9.0\vc\include\vector(1322) : 'std::operator <' の宣言を確認してください。
1>c:\program files (x86)\microsoft visual studio 9.0\vc\include\algorithm(3032) : error C2784: 'bool std::operator <(const std::reverse_iterator<_RanIt> &,const std::reverse_iterator<_RanIt2> &)' : テンプレート 引数を 'const std::reverse_iterator<_RanIt> &' に対して 'std::basic_string<_Elem,_Traits,_Ax>' から減少できませんでした
1> with
1> [
1> _Elem=char,
1> _Traits=std::char_traits<char>,
1> _Ax=std::allocator<char>
1> ]
1> c:\program files (x86)\microsoft visual studio 9.0\vc\include\xutility(2262) : 'std::operator <' の宣言を確認してください。
1>c:\program files (x86)\microsoft visual studio 9.0\vc\include\algorithm(3032) : error C2784: 'bool std::operator <(const std::reverse_iterator<_RanIt> &,const std::reverse_iterator<_RanIt2> &)' : テンプレート 引数を 'const std::reverse_iterator<_RanIt> &' に対して 'std::basic_string<_Elem,_Traits,_Ax>' から減少できませんでした
1> with
1> [
1> _Elem=char,
1> _Traits=std::char_traits<char>,
1> _Ax=std::allocator<char>
1> ]
1> c:\program files (x86)\microsoft visual studio 9.0\vc\include\xutility(2262) : 'std::operator <' の宣言を確認してください。
1>c:\program files (x86)\microsoft visual studio 9.0\vc\include\algorithm(3032) : error C2784: 'bool std::operator <(const std::reverse_iterator<_RanIt> &,const std::reverse_iterator<_RanIt2> &)' : テンプレート 引数を 'const std::reverse_iterator<_RanIt> &' に対して 'std::basic_string<_Elem,_Traits,_Ax>' から減少できませんでした
1> with
1> [
1> _Elem=char,
1> _Traits=std::char_traits<char>,
1> _Ax=std::allocator<char>
1> ]
1> c:\program files (x86)\microsoft visual studio 9.0\vc\include\xutility(2262) : 'std::operator <' の宣言を確認してください。
1>c:\program files (x86)\microsoft visual studio 9.0\vc\include\algorithm(3032) : error C2784: 'bool std::operator <(const std::reverse_iterator<_RanIt> &,const std::reverse_iterator<_RanIt2> &)' : テンプレート 引数を 'const std::reverse_iterator<_RanIt> &' に対して 'std::basic_string<_Elem,_Traits,_Ax>' から減少できませんでした
1> with
1> [
1> _Elem=char,
1> _Traits=std::char_traits<char>,
1> _Ax=std::allocator<char>
1> ]
1> c:\program files (x86)\microsoft visual studio 9.0\vc\include\xutility(2262) : 'std::operator <' の宣言を確認してください。
1>c:\program files (x86)\microsoft visual studio 9.0\vc\include\algorithm(3032) : error C2784: 'bool std::operator <(const std::_Revranit<_RanIt,_Base> &,const std::_Revranit<_RanIt2,_Base2> &)' : テンプレート 引数を 'const std::_Revranit<_RanIt,_Base> &' に対して 'std::basic_string<_Elem,_Traits,_Ax>' から減少できませんでした
1> with
1> [
1> _Elem=char,
1> _Traits=std::char_traits<char>,
1> _Ax=std::allocator<char>
1> ]
1> c:\program files (x86)\microsoft visual studio 9.0\vc\include\xutility(2072) : 'std::operator <' の宣言を確認してください。
1>c:\program files (x86)\microsoft visual studio 9.0\vc\include\algorithm(3032) : error C2784: 'bool std::operator <(const std::_Revranit<_RanIt,_Base> &,const std::_Revranit<_RanIt2,_Base2> &)' : テンプレート 引数を 'const std::_Revranit<_RanIt,_Base> &' に対して 'std::basic_string<_Elem,_Traits,_Ax>' から減少できませんでした
1> with
1> [
1> _Elem=char,
1> _Traits=std::char_traits<char>,
1> _Ax=std::allocator<char>
1> ]
1> c:\program files (x86)\microsoft visual studio 9.0\vc\include\xutility(2072) : 'std::operator <' の宣言を確認してください。
1>c:\program files (x86)\microsoft visual studio 9.0\vc\include\algorithm(3032) : error C2784: 'bool std::operator <(const std::_Revranit<_RanIt,_Base> &,const std::_Revranit<_RanIt2,_Base2> &)' : テンプレート 引数を 'const std::_Revranit<_RanIt,_Base> &' に対して 'std::basic_string<_Elem,_Traits,_Ax>' から減少できませんでした
1> with
1> [
1> _Elem=char,
1> _Traits=std::char_traits<char>,
1> _Ax=std::allocator<char>
1> ]
1> c:\program files (x86)\microsoft visual studio 9.0\vc\include\xutility(2072) : 'std::operator <' の宣言を確認してください。
1>c:\program files (x86)\microsoft visual studio 9.0\vc\include\algorithm(3032) : error C2784: 'bool std::operator <(const std::_Revranit<_RanIt,_Base> &,const std::_Revranit<_RanIt2,_Base2> &)' : テンプレート 引数を 'const std::_Revranit<_RanIt,_Base> &' に対して 'std::basic_string<_Elem,_Traits,_Ax>' から減少できませんでした
1> with
1> [
1> _Elem=char,
1> _Traits=std::char_traits<char>,
1> _Ax=std::allocator<char>
1> ]
1> c:\program files (x86)\microsoft visual studio 9.0\vc\include\xutility(2072) : 'std::operator <' の宣言を確認してください。
1>c:\program files (x86)\microsoft visual studio 9.0\vc\include\algorithm(3032) : error C2784: 'bool std::operator <(const std::pair<_Ty1,_Ty2> &,const std::pair<_Ty1,_Ty2> &)' : テンプレート 引数を 'const std::pair<_Ty1,_Ty2> &' に対して 'std::basic_string<_Elem,_Traits,_Ax>' から減少できませんでした
1> with
1> [
1> _Elem=char,
1> _Traits=std::char_traits<char>,
1> _Ax=std::allocator<char>
1> ]
1> c:\program files (x86)\microsoft visual studio 9.0\vc\include\utility(99) : 'std::operator <' の宣言を確認してください。
1>c:\program files (x86)\microsoft visual studio 9.0\vc\include\algorithm(3032) : error C2784: 'bool std::operator <(const std::pair<_Ty1,_Ty2> &,const std::pair<_Ty1,_Ty2> &)' : テンプレート 引数を 'const std::pair<_Ty1,_Ty2> &' に対して 'std::basic_string<_Elem,_Traits,_Ax>' から減少できませんでした
1> with
1> [
1> _Elem=char,
1> _Traits=std::char_traits<char>,
1> _Ax=std::allocator<char>
1> ]
1> c:\program files (x86)\microsoft visual studio 9.0\vc\include\utility(99) : 'std::operator <' の宣言を確認してください。
1>c:\program files (x86)\microsoft visual studio 9.0\vc\include\algorithm(3032) : error C2784: 'bool std::operator <(const std::pair<_Ty1,_Ty2> &,const std::pair<_Ty1,_Ty2> &)' : テンプレート 引数を 'const std::pair<_Ty1,_Ty2> &' に対して 'std::basic_string<_Elem,_Traits,_Ax>' から減少できませんでした
1> with
1> [
1> _Elem=char,
1> _Traits=std::char_traits<char>,
1> _Ax=std::allocator<char>
1> ]
1> c:\program files (x86)\microsoft visual studio 9.0\vc\include\utility(99) : 'std::operator <' の宣言を確認してください。
1>c:\program files (x86)\microsoft visual studio 9.0\vc\include\algorithm(3032) : error C2784: 'bool std::operator <(const std::pair<_Ty1,_Ty2> &,const std::pair<_Ty1,_Ty2> &)' : テンプレート 引数を 'const std::pair<_Ty1,_Ty2> &' に対して 'std::basic_string<_Elem,_Traits,_Ax>' から減少できませんでした
1> with
1> [
1> _Elem=char,
1> _Traits=std::char_traits<char>,
1> _Ax=std::allocator<char>
1> ]
1> c:\program files (x86)\microsoft visual studio 9.0\vc\include\utility(99) : 'std::operator <' の宣言を確認してください。
1>c:\program files (x86)\microsoft visual studio 9.0\vc\include\algorithm(3032) : error C2676: 二項演算子 '<' : 'std::basic_string<_Elem,_Traits,_Ax>' は、この演算子または定義済の演算子に適切な型への変換の定義を行いません。(新しい動作; ヘルプを参照)
1> with
1> [
1> _Elem=char,
1> _Traits=std::char_traits<char>,
1> _Ax=std::allocator<char>
1> ]
1>c:\program files (x86)\microsoft visual studio 9.0\vc\include\algorithm(3032) : fatal error C1903: 直前のエラーを修復できません。コンパイルを中止します。
1>ビルドログは "file://c:\Users\user\Documents\Visual Studio 2008\Projects\ツンドラから艦これの画像ダウンロードツール - コピー\ツンドラから艦これの画像ダウンロードツール\Debug\BuildLog.htm" に保存されました。
1>ツンドラから艦これの画像ダウンロードツール - エラー 18、警告 0
========== ビルド: 0 正常終了、1 失敗、0 更新不要、0 スキップ ==========