-
Notifications
You must be signed in to change notification settings - Fork 1
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
"[file error] file <> could not be opened" (update) #11
Comments
Hi Gabriel, This is so odd. Have you tried changing the parameter you pass as You should be using 64bit. Now, for the configuration, I think you only need to:
You probably can do (1) and (2) in the additional library and additional headers instead, but it is not necessary to add in both places. Also, the additional dependencies should not be needed because VS would find the dll and libraries from the library directory. |
I did, I also checked permissions. I think the problem isn't on the file or the filepath, given that I can access and get its content just fine using
That would be
That would be just Following these steps, my VC++ lib directories are:
If remove them, I get linker errors: Also, I tried saving the file content to a string and importing the .fis via string using #include <iostream>
#include <fl/Headers.h>
#include <fstream>
int main()
{
const std::string filePath = "C:\\Users\\amado\\logicaFuzzy\\regras.fis";
//std::cout << filePath << std::endl;
std::ifstream file(filePath);
std::stringstream buffer;
buffer << file.rdbuf();
std::string fisString = buffer.str();
//std::cout << fisString << std::endl;
fl::Engine* engine = new fl::Engine;
try
{
//engine = fl::FisImporter().fromFile(filePath);
engine = fl::FisImporter().fromString(fisString);
}
catch (fl::Exception& e)
{
std::cerr << e.what() << std::endl;
}
if (engine->isReady())
std::cout << "Ready\n";
else
std::cout << "Error\n";
return 0;
} and it seems to run just fine since no exceptions are thrown, but |
Good you found a workaround. It is an odd issue.
Yes, only that should be enough.
std::string message;
engine->isReady(&message);
// now message contains the reason why is not ready |
Oh yes, I forgot about the status string. But take a look: std::string status;
if (engine->isReady(&status))
std::cout << "Ready\n";
else
std::cout << status << std::endl; Output: This is exactly what the status string is printing to the console. I'm considering giving up :( your lib is amazing anyway. |
When you compiled from console, did it work? #10 (comment) |
Also, when you built the fuzzylite library, are you sure you are using the newly built binaries as opposed to the binaries provided in my distribution? Maybe make sure you first delete the binaries that you did not build, and then build the libraries. There must be some issue with the binaries or a funny flag when you are building your application.
|
@jcrada thank you so much for the help! That was the problem: the project was in Debug mode and I compiled the lib using Release. Now everything is working properly when I make them compatible. Thanks! |
Hi! It's me from my previous issue.
I changed
Importer.cpp
to print out the filepath it was receiving:And the ouptut is:
I tried rebuilding the library using
build.bat
, and already tried fiddling with all of the build options (backtrace, float=on). It builds just fine, the linker on Visual Studio seems to be doing okay and etc, but nothing seems to fix the problem. I also tried using the 32bit version of the lib.Here's my project setup on Visual Studio:
Am I missing a command line argument? A preprocessor parameter? Thanks for your time.
The text was updated successfully, but these errors were encountered: