Here is a working code
#include "quickfix/FixFields.h"
#include "quickfix/Values.h"
int main()
{
FIX::BeginString beginString(FIX::BeginString_FIX42);
return 0;
}
It compiles and if I print the value of beginString I get the expected result.
Now I want to implement a class with the same type
#include "quickfix/FixFields.h"
#include "quickfix/Values.h"
class A {
FIX::BeginString beginString;
public:
A()
{
beginString = FIX::BeginString_FIX42;
}
};
int main()
{
return 0;
}
This code does not compile, the compilation error is
test.cpp: In constructor ‘A::A()’:
test.cpp:9:17: error: no match for ‘operator=’ (operand types are ‘FIX::BeginString’ and ‘const char [8]’)
beginString = FIX::BeginString_FIX42;
^
Any idea what is wrong and how to fix it?
rerun :
FIX::BeginString_FIX42 is a const i'm guessing. When you define a function which again I am guessing you want to do you need to specify a type of a value not a value. BeginString is a type BeginString_FIX42 is a constant that tells begin string which version of the begin to return. ",
2014-07-29T19:41:54