home Forums # Technical Support strange problem on visual studio

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #2073
    Unknown
    Member

    Hi .
    thanks for wonderful work.
    my problem is very strange.
    In vsiual c++ I want to use fuzzylite library to create a dll.
    when I create my class that using library in the form (myclass.h , myclass.cpp)
    the project compiles fine.
    and fuzzylite headers are included in the myclass.h
    but if i add (#include “stdafx.h”) at the top of myclass.cpp or add (#include “fl/Headers.h”) to the stdafx.h I get about 100 errors.
    any idea?

    #2075

    Hi,

    thank you for your kind words.

    At some point I had the same issue, and I recall the problem was that I created a .Net project instead of a C++ Application. Let me know if this helps.

    Cheers.

    #2076
    Unknown
    Member

    I solved problem .
    the problem is because addition of windows.h in the file stdafx.h.
    in that file there are macro definitions such as min and max that conflict with fuzzylite library.
    by adding a #define NOMINMAX before that include problem solved the true way is:

     // stdafx.h : include file for standard system include files,
    // or project specific include files that are used frequently, but
    // are changed infrequently
    //
    
    #pragma once
    
    #include "targetver.h"
    
    #define WIN32_LEAN_AND_MEAN             // Exclude rarely-used stuff from Windows headers
    // Windows Header Files:
    #define NOMINMAX
    #include <windows.h>
    #include "fl/Headers.h"
    

    hope this helps others.

    #2077
    Unknown
    Member

    another question:
    how can i select my engine properties
    for example i want engine to work as a mamdani system with TNorm: algebricproduct ,SNorm:maximum , Defuzzification: Center Average

    #2078

    Thanks for posting the solution.

    Please, check the method Engine::configure(tnorm, snorm, implication, aggregation, defuzzifier). You should be able to do so: engine.configure("AlgebraicProduct", "Maximum", "Minimum", "Maximum", "Centroid"). Check QtFuzzyLite for more help.

    Cheers.

Viewing 5 posts - 1 through 5 (of 5 total)
  • You must be logged in to reply to this topic.