adding Cascade infrastructure to Visual Studio 2015

Tomaeea00 21 Reputation points
2021-10-21T08:08:22.24+00:00

I want to use Cascade in Visual studio V.2015. The following is the hello world Cascade program:

#include <cascade/Cascade.hpp>

class Producer : public Component
{
    DECLARE_COMPONENT(Producer);
public:
    Producer(COMPONENT_CTOR) {}
    //----------------------------------
    // Interface
    //----------------------------------
    Output(char, out_ch);
    //----------------------------------
    // Simulation
    //----------------------------------
    void reset()
    {
        m_ch = "Hello World \n";
    }
    void update()
    {
        out_ch = *m_ch;
        if (*m_ch)
            m_ch++;
    }
private:
    const char *m_ch;
};
class Consumer : public Component
{
    DECLARE_COMPONENT(Consumer);
public:
    Consumer(COMPONENT_CTOR) {}
    //----------------------------------
    // Interface
    //----------------------------------
    Input(char, in_ch);
    //----------------------------------
    // Simulation
    //----------------------------------
    void update()
    {
        if (in_ch)
            putchar(in_ch);
    };
};
void main()
{
    Producer producer;
    Consumer consumer;
    consumer.in_ch << producer.out_ch;
    Sim::run(100000);
    Sim::reset();
    Sim::run(100000);
}

The problem is when I run the program. Numerous Linker errors appear, like:

Error   LNK2019 unresolved external symbol "class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > __cdecl getAssertionContext(void)" (?getAssertionContext@@YA?AV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@XZ) referenced in function "protected: virtual void __thiscall Consumer::setParentComponent(class Component *)" (?setParentComponent@Consumer@@MAEXPAVComponent@@@Z)            

I've done the following changes in the project properties in VS:

added the 'cascade-master/include' folder to c/c++->general->additional include directories

added the 'cascade-master/src' folder to Linker->general->additional library directories

I am suspecting that errors are due to undefined input liker dependencies: Linker->input->additional dependencies And I dont know what to add there, I tried cascade.lib but didn't work, any suggestion?

And I have no clue what is the right environment variable and its value. could you help me with this please?

Thanks in advance

Developer technologies | C++
Developer technologies | C++
A high-level, general-purpose programming language, created as an extension of the C programming language, that has object-oriented, generic, and functional features in addition to facilities for low-level memory manipulation.
{count} votes

Answer accepted by question author
  1. RLWA32 51,536 Reputation points
    2021-10-21T09:41:40.82+00:00

    Did you build the static libraries for cascade.lib, descore.lib and zlib.lib? There is a visual studio project that builds those libraries in the repo. After you have built the libraries you need to add them to Linker->Input->Additional Dependencies and add the path to the folder that contains them to Linker->General->Additional Library Directories.

    For example,

    142415-libs.png

    142398-paths.png


0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.