I am super new to programming and my brother helped me write some code in Visual C++ that worked great on my home windows machine. I am now trying to compile it on a Linux machine at school with g++ and I get the following errors
error: no matching function for call to ‘std::basic_ifstream<char, std::char_traits<char> >::basic_ifstream(std::string&) {followed by a lot of information}
and
error: no matching function for call to ‘std::basic_ofstream<char, std::char_traits<char> >::open(std::string&) {followed by a lot of information}
I get the impression that it might have to do with my #includes, but online resources suggest something more is involved. I have tried every #include that I am familiar with with no results. Here are the #includes I currently have:
#include <string>
#include <sstream>
#include <vector>
#include <iostream>
#include <algorithm>
#include <fstream>
I have tried a construct approach (I think) and get the following error
error: expected primary-expression before ‘explicit’
and I don't understand what that or online sources are suggesting as a fix.
I may be in over my head, but any suggestions on how I can fix this would be wonderful. If this is too open-ended, I don't mean to be a bother and thanks for your time.
I do not see where is your explicit, but I think the first error means that you have an old version of the compiler that does not support the member function open that accepts as an argument a string. So use instead
wow! Thank-you vlad. Your correction got me passed those two errors beautifully, but then my terminal screen was filled to the max with some new errors. I can't even see what line is presenting the new problem to try and trouble shoot. However, I am going to talk to our administrator about updating our compiler before I trouble the forum further on this particular issue.