Hello,
This problem might be a little bit more software but I am not sure how to deal with it.
I want to configure my apalis imx6 to connect to a Filezilla server on a different device.
I am writing code one C++ with VS Code and ApolloX Torizon.
The problem is that I am trying to use the library. At first it gives no errors but when I press run and debug then I get the ‘filesystem’ has not been declared error.
From what I understood I have to configure something in tasks.json like the following:
"tasks": [
{
"label": "build",
"type": "shell",
"command": "g++",
"args": [
"-g",
"${file}",
"-o",
"${fileDirname}/${fileBasenameNoExtension}",
"-lstdc++fs"
],
"group": {
"kind": "build",
"isDefault": true
}
}
]
But I don’t know where exactly to put it in the file and what parameters I need to put here: "${fileDirname}/${fileBasenameNoExtension.
Also this is my code:
void connectToFtpServer(const string& serverAddress, const string& username, const string& password) {
filesystem::path ftpUrl = "ftp://" + username + ":" + password + "@" + serverAddress + "/";
cout << "Connecting to FTP server " << serverAddress << " as user " << username << std::endl;
cout << "Listing directory contents:" << std::endl;
for (const auto& entry : filesystem::directory_iterator(ftpUrl)) {
cout << entry.path() << endl;
}
}
void uploadFileToFtpServer(const string& localFilePath, const string& remoteFilePath, const string& serverAddress, const string& username, const string& password) {
filesystem::path remoteFileUrl = "ftp://" + username + ":" + password + "@" + serverAddress + "/" + remoteFilePath;
cout << "Uploading file " << localFilePath << " to remote location " << remoteFileUrl << endl;
filesystem::copy(localFilePath, remoteFileUrl, filesystem::copy_options::skip_existing);
cout << "File uploaded succesfully" << endl;
}
I am not sure if this is because something is not configured in VS Code to use this library or something is not configured on my Torizon.
I checked the version of C++ in VS Code and it should be able to support the library.