Skip to content
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

Seems doesnt work in Windows? #16

Open
realquantumcookie opened this issue May 10, 2018 · 2 comments
Open

Seems doesnt work in Windows? #16

realquantumcookie opened this issue May 10, 2018 · 2 comments

Comments

@realquantumcookie
Copy link

#include <FileWatch.hpp>
#include <iostream>
int main(int argc, char** args) {
	//FileWatch API, see here:
	//https:/ThomasMonkman/filewatch
	std::string FileName ="E:\\233.txt";
	filewatch::FileWatch<std::string>(
		FileName ,
		[](const std::string& path, const filewatch::Event change_type) {
			switch(change_type) {
			case filewatch::Event::added:
				std::cout << "The file was added to the directory." << '\n';
				break;
			case filewatch::Event::removed:
				std::cout << "The file was removed from the directory." << '\n';
				break;
			case filewatch::Event::modified:
				std::cout << "The file was modified. This can be a change in the time stamp or attributes." << '\n';
				break;
			case filewatch::Event::renamed_old:
				std::cout << "The file was renamed and this is the old name." << '\n';
				break;
			case filewatch::Event::renamed_new:
				std::cout << "The file was renamed and this is the new name." << '\n';
				break;
			}
		}
		);
	std::cin.get();
}

This is the code I put in Visual Studio 2017.
But it says cannot cast from initializer list to std::basic_string<char,std::char_traits,std::allocator> (which is the class of std::string) on line 366.

@ThomasMonkman
Copy link
Owner

ah yes, this might be due to windows using wchar_t, and also a mix of windows using the UNICODE and not using it.

Can you provide the full error output from visual studio? or the template error message?

I'll look in to this when I can.

@pezcode pezcode mentioned this issue Feb 7, 2020
@RicoP
Copy link

RicoP commented Nov 21, 2021

Is this still an issue?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants