-
Notifications
You must be signed in to change notification settings - Fork 12
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Xiaokui third-party compilation error #7
Comments
Could you please post the entire stack trace? Also, what platform are you on and what version of c++ compiler are you using? |
I found a quick fix for the stated problem. The version used was C++ 11. The problem then was that in Utilities.cpp this part:
which has to be reformulated in versions 11 and higher to:
|
Yeah, that makes sense. In our testing we have not been compiling with
c++11.
…On Mon, Feb 3, 2020 at 11:03 AM SiQube ***@***.***> wrote:
I found a quick fix for the stated problem. The version used was C++ 11.
The problem then was that in Utilities.cpp this part:
void Utilities::readFile(const string file_name, vector& histogram){
ifstream in(file_name.c_str(), ios_base::in);
*if(in == NULL)*{
cout << "Error:open data file error.\n";
getchar();
exit(0);
}
string str;
const string delimiters = " ";
getline(in, str);
tokenize(str, histogram, delimiters);
}
which has to be reformulated in versions 11 and higher to:
void Utilities::readFile(const string file_name, vector& histogram){
ifstream in(file_name.c_str(), ios_base::in);
*if(!in)*{
cout << "Error:open data file error.\n";
getchar();
exit(0);
}
string str;
const string delimiters = " ";
getline(in, str);
tokenize(str, histogram, delimiters);
}
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#7?email_source=notifications&email_token=AAHVMOFLKEV2EBOPODGWUD3RBA53VA5CNFSM4KOOBX42YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEKUMLQY#issuecomment-581486019>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAHVMOAULQ7MNKPJYOS5CWDRBA53VANCNFSM4KOOBX4Q>
.
|
Thanks @SiQube ! I would never find how to solve that error. |
Thanks a lot for the fix @SiQube ! A PR about this patch would be awesome. |
While running ./setup.sh, and in particular xiaokui setup.sh, I get the following compilation error:
Utilities.cpp:33:11: note: ‘std::ifstream {aka std::basic_ifstream}’ is not derived from ‘const std::istreambuf_iterator<_CharT, _Traits>’
if(in == NULL){
I think everything is properly set-up before. What could be the problem?
The text was updated successfully, but these errors were encountered: