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