I am using a legacy lib that defines a struct in Foo.h:
typedef struct { int i; int j; } Foo
However in my C++ program I am trying to write the following in a header file.
// forward-declare the struct
struct Foo;
class Bar {
void myFunction(std::shared_ptr<Foo> foo);
};
And in my cpp file:
#include "Foo.h"
However this fails with an error:
typedef redefinition with different types ('struct Foo' vs 'Foo')
What is the correct syntax to do this?