home Forums # Technical Support Unhandled exception at 0x751a9617 in test.exe Reply To: Unhandled exception at 0x751a9617 in test.exe

#1133
Unknown
Member

Hello,
I compiled fuzzylite solution in VS2010. it fails with following errors.

4>LINK : fatal error LNK1104: cannot open file ‘bin\Debug\fuzzylite-dbg.lib’
5>—— Rebuild All started: Project: ALL_BUILD, Configuration: Debug Win32 ——
5> Building Custom Rule C:/Users/Mongolkhuu/Downloads/fuzzylite-4.0.1-source/fuzzylite-4.0/fuzzylite/CMakeLists.txt
5> CMake does not need to re-run because C:\Users\Mongolkhuu\Downloads\fuzzylite-4.0.1-source\fuzzylite-4.0\fuzzylite\dddd\CMakeFiles\generate.stamp is up-to-date.
5> Build all projects
6>—— Skipped Rebuild All: Project: INSTALL, Configuration: Debug Win32 ——
6>Project not selected to build for this solution configuration
========== Rebuild All: 2 succeeded, 3 failed, 1 skipped ==========

Then i have changed following part of code as comment in Function.cpp

/* text = “(Temperature is High and Oxigen is Low) or ”
“(Temperature is Low and (Oxigen is Low or Oxigen is High))”;
FL_LOG(f.toPostfix(text));

f.variables[“pi”] = 3.14;
text = “-5 *4/sin(-pi/2)”;
FL_LOG(f.toPostfix(text));
try {
FL_LOG(f.parse(text)->evaluate());
} catch (fl::Exception& e) {
FL_LOG(e.getWhat());
}
f.variables[“pi”] = 3.14;
text = “~5 *4/sin(~pi/2)”;
FL_LOG(f.toPostfix(text));
try {
FL_LOG(f.parse(text)->evaluate(&f.variables));
} catch (fl::Exception& e) {
FL_LOG(e.getWhat());
} */

then it compiled in VS2010 without any errors. I also tried to run fuzzylite-dbg.exe. It also worked without any exception
here is the output of fuzzylite-dbg.exe:
========================================
fuzzylite: a fuzzy logic control library
version: 4.0b1401
author: Juan Rada-Vilela
========================================
usage: fuzzylite inputfile outputfile
or: fuzzylite [-i] [-if] [-o] [-of] [-ex] [-max] [-sep]

where: [-i inputfile]
[-if fll,fis,fcl]
[-o outputfile]
[-of fll,fis,fcl,cpp,java,fld]
[-ex (m)amdani,(t)akagi-sugeno]
[-max maximum]
[-sep separator]

Visit http://fuzzylite.com for more information.

after that i tried to use Dll and lib files in Fuzzy_API_Test project.
here is the code:
‘#include <fl/Headers.h>

int main(int argc, char** argv){

fl::Engine* engine = new fl::Engine(“simple-dimmer”);

fl::InputVariable* ambient = new fl::InputVariable;
ambient->setName(“Ambient”);
ambient->setRange(0.000, 1.000);
ambient->addTerm(new fl::Triangle(“DARK”, 0.000, 0.500));
ambient->addTerm(new fl::Triangle(“MEDIUM”, 0.250, 0.750));
ambient->addTerm(new fl::Triangle(“BRIGHT”, 0.500, 1.000));
engine->addInputVariable(ambient);

fl::OutputVariable* power = new fl::OutputVariable;
power->setName(“Power”);
power->setRange(0.000, 2.000);
power->setDefaultValue(fl::nan);
power->addTerm(new fl::Triangle(“LOW”, 0.000, 1.000));
power->addTerm(new fl::Triangle(“MEDIUM”, 0.500, 1.500));
power->addTerm(new fl::Triangle(“HIGH”, 1.000, 2.000));
engine->addOutputVariable(power);

fl::RuleBlock* ruleblock = new fl::RuleBlock;
ruleblock->addRule(fl::Rule::parse(“if Ambient is DARK then Power is HIGH”, engine));
ruleblock->addRule(fl::Rule::parse(“if Ambient is MEDIUM then Power is MEDIUM”, engine));
ruleblock->addRule(fl::Rule::parse(“if Ambient is BRIGHT then Power is LOW”, engine));
engine->addRuleBlock(ruleblock);

//No Conjunction or Disjunction is needed
engine->configure(“”, “”, “AlgebraicProduct”, “AlgebraicSum”, “Centroid”);

std::string status;
if (!(engine->isReady(&status)))
throw fl::Exception(“Engine not ready. ”
“The following errors were encountered:\n” + status, FL_AT);

for (int i = 0; i < 1; ++i){
fl::scalar light = ambient->getMinimum() + i * (ambient->range() / 50);
ambient->setInputValue(light);
std::cout << “light\n”<<fl::Op::str(light);
engine->process();
std::cout << “defuzzify\n”<<fl::Op::str(power->defuzzify());

}
}
its showing following error when i add this line ( engine->process(); ) to the main

Unhandled exception at 0x751a9617 in Fuzzy_API_Test.exe: Microsoft C++ exception: std::out_of_range at memory location 0x0014ea60..

when i add this line ( engine->process(); ) to the main,