home Forums Search Search Results for 'visual studio'

Viewing 10 results - 51 through 60 (of 65 total)
  • Author
    Search Results
  • #1407
    Unknown
    Member

    Hi Juan,

    Thanks for your reply, after some testing I now believe that there is no problem with the library, its linking the library to the project that’s giving me problems.

    I am trying different methods to link the library properly such as

    these: http://stackoverflow.com/questions/5487056/linking-library-in-visual-studio-2010

    It would be great if someone could share the right process to do this.

    Thanks!
    Allen

    #1402
    Unknown
    Member

    Hi Juan, first of all thanks for your work with this application. I am in need of a fuzzy logic library, and when I saw your video I really thought this is what I needed. I am not very experienced with developing software, just some simple procedural programs. I wanted to buy the QtFuzzylite as it would simplify my work a lot but I wanted to see first if I could make at least the example work. Unfortunately it has been more than 24 hours and I can’t seem to make it work. I hope you can help my with at least building and running the example.

    I will try to document everything I have done so far so that you will have an idea for my case and maybe it could help others in the future.

    1. I downloaded the Windows files from the Downloads page.
    2. I downloaded and installed CMake 3.0.1
    3. I tried to build the files using CMake and VS 2010 (I have Windows 7 64bit OS)
    4. Failure to build, I found out that .Net Framework 4.5 is giving me problems, I downgraded to .Net Framework 4.0
    5. I manually added the path of the cl.exe under Visual Studio directory to the environment variables in My Computer>Properties>Advanced>Environment Variables>System Variables>path
    5. Using CMake, I was able to generate the .sln and other files
    6. I opened the .sln file using Visual Studio 2010 and used Build Solution under the Build tab
    7. I was able to generate the .lib and .dll files
    8. I created a new Windows Forms Application in Visual Studio 2010
    9. I added the fuzzylite directory at the project’s Properties>C/C++>General>Additional Include directories
    10. Then I added the fuzzylited.lib at the project’s Properties>Linker>Input
    11. I tried to build the project and there were no errors
    12. Now I created a new source file named example.cpp and I copied the example code in the C++ page

    #include “fl/Headers.h”

    int main(int argc, char* argv[]){
    using namespace fl;
    Engine* engine = new Engine(“simple-dimmer”);

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

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

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

    engine->configure(“”, “”, “Minimum”, “Maximum”, “Centroid”);

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

    for (int i = 0; i < 50; ++i){
    scalar light = ambient->getMinimum() + i * (ambient->range() / 50);
    ambient->setInputValue(light);
    engine->process();
    FL_LOG(“Ambient.input = ” << Op::str(light) << ” -> ” <<
    “Power.output = ” << Op::str(power->getOutputValue()));
    }
    }

    13. I tried to build again but there was an error:

    error C1010: unexpected end of file while looking for precompiled header. Did you forget to add ‘#include “StdAfx.h”‘ to your source?

    14. So I added the header specified by the error:

    #include “StdAfx.h”
    #include “fl\Headers.h”

    15. Now I tried to build again but there are new errors that I don’t understand:

    Error 27 error LNK1120: 26 unresolved externals c:\users\amp23\documents\visual studio 2010\Projects\Vermiculture\Debug\Vermiculture.exe Vermiculture

    Error 16 error LNK2019: unresolved external symbol “public: __clrcall fl::Centroid::Centroid(int)” (??0Centroid@fl@@$$FQAM@H@Z) referenced in function “int __clrcall main1(int,char * * const)” (?main1@@$$FYMHHQAPAD@Z) c:\Users\AMP23\documents\visual studio 2010\Projects\Vermiculture\Vermiculture\example.obj Vermiculture

    Error 13 error LNK2028: unresolved token (0A00003A) “public: __clrcall fl::Engine::Engine(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &)” (??0Engine@fl@@$$FQAM@ABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@Z) referenced in function “int __clrcall main1(int,char * * const)” (?main1@@$$FYMHHQAPAD@Z) c:\Users\AMP23\documents\visual studio 2010\Projects\Vermiculture\Vermiculture\example.obj Vermiculture

    My plan was to try and solve these errors one by one until I can make the example work, but now I don’t know where to go next. Sorry for the long post, I hope someone could help me.

    Allen

    #1197
    Unknown
    Member

    Hi,

    I appear to have the same issue as bayanaa.

    My environment is Windows-7 Pro, my toolset is CMake 4.0.0, Visual Studio 2008, Fuzzylite 4.0. The Fuzzylite lib/dll/exe folders were successfully generated without errors. The Fuzzylite C++ code compiled and linked successfully in my application program (debug mode).

    When executing the application, upon reaching the line of code:
    engine->process();

    there is a runtime error:
    Unhandled exception at 0x75ffc41f in SIM.exe: Microsoft C++ exception: std::out_of_range at memory location 0x0290e60c..

    I have tried using fuzzylite-static-dbg.lib, then fuzzylite-dbg.lib/fuzzylite-dbg.dll, always the same error. I am not sure what to do with _fuzzylite-dbg.lib, if anything.

    As mentioned in your earlier post (July 3, 2014 at 08:40) you have a working MSVC APP (.sln, .proj) of the SimpleDimmer example in a single Main() file. It would be a great help if you could provide that working MSVC project. I suspect the problem lies in either the MSVC project Property settings, or a difference in the Fuzzylite bin files.

    Thanks so much for your assistance.

    Unknown
    Member

    Hello,
    Let’s say I would like to write my own app in C++ which uses fuzzylite and some fcl file. I did something similiar in JAVA, but unfortunately C++ is bit different in case of libraries.

    I’ve downloaded Windows package from site, there are sources and fuzzylite.dll.

    What should be the steps and compiler options to make it possible to make an app on windows? Preferably I will try to make this app in Visual Studio 2008.

    What I’m trying to do is making TORCS run based on fcl rules, I got TORCS running fine in VS, so I would like to stick with it.

    #1134

    Hi,

    I managed to create from scratch a Visual Studio C++ Solution using fuzzylite v4.0. I ran into issues mostly because I do not use Visual Studio, but I still managed to successfully run your example. I created an empty project with a single main.cpp in which I copied your code. Notice that I build fuzzylite from console and use the library in my empty project. Here are the issues I ran into:

    • As you mentioned, there is an issue with unreachable code in fuzzylite/Function.cpp, which is solved as you did, or alternatively adding #pragma warning(disable:4702) //Unreachable code under the Windows definitions in fl/fuzzylite.h
    • I had to compile fuzzylite using cmake . -G"NMake Makefiles" -DFL_DEBUG=ON to avoid error LNK2038: mismatch detected for '_ITERATOR_DEBUG_LEVEL'.... This error refers to the case when fuzzylite is built in release mode, but the VS solution is built in Debug mode. (I did not know how to build the solution in release mode)
    • I added fuzzylite-static-dbg.lib to the linked libraries in the project properties, and I also needed to add the dbghelp.lib linked library.
    • In the project properties, in C++ Code Generation, I have Enable C++ Exceptions: Yes with SEH Exceptions (/EHa)
    • I also added the directories: fuzzylite and fuzzylite/bin to include and library in VC++ directories (project properties).

    Try the steps mentioned above and let me know if it works now.

    #1131
    Unknown
    Member

    Hello
    Thank you for your quick respond.

    Following are my steps:

    a) Download the source code from
    b) In the CMake GUI I give fuzzylite source folder as the input folder and select Visual Studio 2010 as the compiler.
    in CMake, it does generate the Visual Studio fuzzylite solution without any errors.
    Then, I tried to build the Visual Studio solution, but it fails with following errors.

    4>  fl-bin.vcxproj -> C:\Users\Mongolkhuu\Downloads\fuzzylite-3.0-src\Hehe\bin\Debug\fuzzylite-bin-dbg.exe
    4>  Error copying file (if different) from "C:/Users/Mongolkhuu/Downloads/fuzzylite-3.0-src/fuzzylite-3.0/fuzzylite/lib/fuzzylite-dbg.dll" to "C:/Users/Mongolkhuu/Downloads/fuzzylite-3.0-src/fuzzylite-3.0/fuzzylite/bin".
    4>C:\Program Files\MSBuild\Microsoft.Cpp\v4.0\Microsoft.CppCommon.targets(113,5): error MSB3073: The command "setlocal
    4>C:\Program Files\MSBuild\Microsoft.Cpp\v4.0\Microsoft.CppCommon.targets(113,5): error MSB3073: "C:\Program Files\CMake\bin\cmake.exe" -E copy_if_different C:/Users/Mongolkhuu/Downloads/fuzzylite-3.0-src/fuzzylite-3.0/fuzzylite/lib/fuzzylite-dbg.dll C:/Users/Mongolkhuu/Downloads/fuzzylite-3.0-src/fuzzylite-3.0/fuzzylite/bin
    4>C:\Program Files\MSBuild\Microsoft.Cpp\v4.0\Microsoft.CppCommon.targets(113,5): error MSB3073: if %errorlevel% neq 0 goto :cmEnd
    4>C:\Program Files\MSBuild\Microsoft.Cpp\v4.0\Microsoft.CppCommon.targets(113,5): error MSB3073: :cmEnd
    4>C:\Program Files\MSBuild\Microsoft.Cpp\v4.0\Microsoft.CppCommon.targets(113,5): error MSB3073: endlocal & call :cmErrorLevel %errorlevel% & goto :cmDone
    4>C:\Program Files\MSBuild\Microsoft.Cpp\v4.0\Microsoft.CppCommon.targets(113,5): error MSB3073: :cmErrorLevel
    4>C:\Program Files\MSBuild\Microsoft.Cpp\v4.0\Microsoft.CppCommon.targets(113,5): error MSB3073: exit /b %1
    4>C:\Program Files\MSBuild\Microsoft.Cpp\v4.0\Microsoft.CppCommon.targets(113,5): error MSB3073: :cmDone
    4>C:\Program Files\MSBuild\Microsoft.Cpp\v4.0\Microsoft.CppCommon.targets(113,5): error MSB3073: if %errorlevel% neq 0 goto :VCEnd
    4>C:\Program Files\MSBuild\Microsoft.Cpp\v4.0\Microsoft.CppCommon.targets(113,5): error MSB3073: :VCEnd" exited with code 1.
    5>------ Build started: Project: ALL_BUILD, Configuration: Debug Win32 ------
    5>  Build all projects
    ========== Build: 4 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
    
    However, it does generate the fuzzylite-dbg.lib and fuzzylite-dbg.dll files.
    
    When i run fuzzylite.exe. its showing following exception
    
    

    Hello, fuzzylite!
    =================
    Version 3.0b?
    Built on Windows in Debug mode
    Floating-point fl::scalar is defined as ‘double’ using 8 bytes
    Precision is set to 1e-005
    Only 3 decimals are printed
    Infinity is printed as: (-inf , inf)
    NaN values are printed as: nan
    Defuzzifiers by default use 200 divisions
    FL_LOG is enabled and prints in console as follows:
    [unexpected exception] backtrace:
    6: fl::DefuzzifierFactory::DefuzzifierFactory at 0x261640543
    5: fl::DefuzzifierFactory::DefuzzifierFactory at 0x261640543
    4: terminate at 0x258188448
    3: __CxxUnhandledExceptionFilter at 0x2384976
    2: UnhandledExceptionFilter at 0x1981426485
    1: RtlGetThreadErrorMode at 0x2010143288
    0: RtlInitializeExceptionChain at 0x2010035090

    Unknown
    Member

    Hi everyone,

    I compile fuzzylite with cMake for visual studio 2010 and a small test with codes from this website just failed with warning irst-chance exception at 0x751a9617 in test.exe: Microsoft C++ exception: std::out_of_range at memory location 0x0016cff0..
    Unhandled exception at 0x751a9617 in test.exe: Microsoft C++ exception: std::out_of_range at memory location 0x0016cff0..
    The program ‘[6100] test.exe: Native’ has exited with code -529697949 (0xe06d7363). Would you please give me some suggestions on possible solutions? Thank you in advance.

    My test code:

    #include <fl/Headers.h>
    
    int main(int argc, char** argv){
    fl::Engine* engine = new fl::Engine;
    engine->setName("simple-dimmer");
    engine->addHedge(new fl::Any);
    engine->addHedge(new fl::Extremely);
    engine->addHedge(new fl::Not);
    engine->addHedge(new fl::Seldom);
    engine->addHedge(new fl::Somewhat);
    engine->addHedge(new fl::Very);
    
    fl::InputVariable* inputVariable1 = new fl::InputVariable;
    inputVariable1->setName("Ambient");
    inputVariable1->setRange(0.000, 1.000);
    
    inputVariable1->addTerm(new fl::Triangle("DARK", 0.000, 0.250, 0.500));
    inputVariable1->addTerm(new fl::Triangle("MEDIUM", 0.250, 0.500, 0.750));
    inputVariable1->addTerm(new fl::Triangle("BRIGHT", 0.500, 0.750, 1.000));
    engine->addInputVariable(inputVariable1);
    
    fl::OutputVariable* outputVariable1 = new fl::OutputVariable;
    outputVariable1->setName("Power");
    outputVariable1->setRange(0.000, 1.000);
    outputVariable1->setLockOutputRange(false);
    outputVariable1->setDefaultValue(fl::nan);
    outputVariable1->setLockValidOutput(false);
    outputVariable1->setDefuzzifier(new fl::Centroid(200));
    outputVariable1->output()->setAccumulation(new fl::Maximum);
    
    outputVariable1->addTerm(new fl::Triangle("LOW", 0.000, 0.250, 0.500));
    outputVariable1->addTerm(new fl::Triangle("MEDIUM", 0.250, 0.500, 0.750));
    outputVariable1->addTerm(new fl::Triangle("HIGH", 0.500, 0.750, 1.000));
    engine->addOutputVariable(outputVariable1);
    
    fl::RuleBlock* ruleblock1 = new fl::RuleBlock;
    ruleblock1->setName("");
    ruleblock1->setTnorm(new fl::Minimum);
    ruleblock1->setSnorm(new fl::Maximum);
    ruleblock1->setActivation(new fl::Minimum);
    
    ruleblock1->addRule(fl::FuzzyRule::parse("if Ambient is DARK then Power is HIGH", engine));
    ruleblock1->addRule(fl::FuzzyRule::parse("if Ambient is MEDIUM then Power is MEDIUM", engine));
    ruleblock1->addRule(fl::FuzzyRule::parse("if Ambient is BRIGHT then Power is LOW", engine));
    engine->addRuleBlock(ruleblock1);
    
    }
    #1086

    Hi Antoine,

    I am sorry for the delay in my answer. Were you able to solve your issue? If not, I will definitely help you next week. I have been very busy lately, and I am not familiar with Visual Studio at all. If you solved it, it would be great if you could post a few details on how you did. Otherwise, we’ll solve it next week.

    Cheers,

    Juan

    Unknown
    Member

    Hello Juan,

    Firstly i wanted to thank you for your work on this application, it’s way more intuitive and handy than the matlab version.
    I’m currently in Internship and i would like to use your fuzzylogic module in my application.

    I’m working on Microsoft Visual Studio C++ 2010 express and i used Cmake.

    I followed advice you gave in a previous thread :
    “#ifdef FL_WINDOWS
    “#pragma warning(disable:4702) //Ignore unreachable code

    to ignore warning about unreachable code.

    There is a new issue then, it compiles well but it writtes
    “Can’t start the program <pathwork>\debug\ALL_BUILD. Specified file not found”

    Could you put light on this please?

    Thank you for your Help
    Antoine

    #1080
    Unknown
    Member

    Hello.
    I try to build fuzzylite in C in MSVC.
    I added to enviroment path path to folder fl, where headers files are. I also added path to .dll file but only this file was in fuzzylite folder from the beggining, because I can’t build it with CMake but I think it’s enough.
    In linker options I also added -lfuzzylite.
    I created project in MSVC 2010, added include “path/headers.h” and put the code from FuzzyLite inside. I have some errors, all almost the same, like this one:
    Error 3 error LNK2019: unresolved external symbol "public: __thiscall fl::Engine::Engine(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &)" (??0Engine@fl@@QAE@ABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@Z) referenced in function _wmain c:\Users\Mariusz\documents\visual studio 2010\Projects\visual fuzzy\visual fuzzy\visual fuzzy.obj

    Thanks for any ideas which can help me.

Viewing 10 results - 51 through 60 (of 65 total)