home › Forums › # Technical Support › Fuzzylite + CPP (Windows) + Hopefully Visual Studio › Reply To: Fuzzylite + CPP (Windows) + Hopefully Visual Studio
July 8, 2014 at 08:16
#1157
Member
I did successful import of fcl file in simple DummyFuzzy project.
But when we are trying the same code (or some variations) in TORCS it fails.
What we can do, is to create “empty” engine like this:
Engine * engine = new Engine();
It works, we can sysout the allocated address.
But it fails if we give e.g.
Engine * engine = new Engine("NAME");
or:
Engine * engine = new Engine();
engine->setName("NAME");
So it also fails if we do this:
ifstream ifs("D:\\rules.fcl");
string rules2( (std::istreambuf_iterator<char>(ifs) ),
(std::istreambuf_iterator<char>() ) );
printf("%s\n--------------------------\n", rules2.c_str()); //this works
Engine * engine = fl::FllImporter().fromString(rules2.c_str());
printf("CREATED \n"); // this do not print
printf("%s\n", engine->getName().c_str());
And the last bit of code ends with:
-
This reply was modified 9 years, 2 months ago by
Unknown.