I have the 5 files as from the examples here - Dec.h, Dec.cpp, decInterface.h, decInterface.cpp and temp.c
How to use c++ objects in c? and Developing C wrapper API for Object-Oriented C++ code with the main in a file called temp.c which calls the cpp code implemented in Dec.cpp with help of interface files.
they all reside in one project in vs2008, I have set the compile as option to default instead of compile as c or compile as c++
I get the following link errors
1>Compiling...
1>decInterface.cpp
1>Generating Code...
1>Compiling...
1>temp.c
1>Generating Code...
1>Compiling manifest to resources...
1>Microsoft (R) Windows (R) Resource Compiler Version 6.0.5724.0
1>Copyright (C) Microsoft Corporation. All rights reserved.
1>Linking...
1>decInterface.obj : error LNK2005: "public: __thiscall Node::Node(class std::vector<float,class std::allocator<float> >)" (??0Node@@QAE@V?$vector@MV?$allocator@M@std@@@std@@@Z) already defined in Dec.obj
1>decInterface.obj : error LNK2005: "public: __thiscall Node::Node(float,float)" (??0Node@@QAE@MM@Z) already defined in Dec.obj
1>decInterface.obj : error LNK2005: "public: __thiscall Node::Node(class std::vector<float,class std::allocator<float> >,class std::vector<bool,class std::allocator<bool> >)" (??0Node@@QAE@V?$vector@MV?$allocator@M@std@@@std@@V?$vector@_NV?$allocator@_N@std@@@2@@Z) already defined in Dec.obj
1>decInterface.obj : error LNK2005: "public: __thiscall reprVectorsTree::reprVectorsTree(class std::vector<class Node *,class std::allocator<class Node *> >,int)" (??0reprVectorsTree@@QAE@V?$vector@PAVNode@@V?$allocator@PAVNode@@@std@@@std@@H@Z) already defined in Dec.obj
1>decInterface.obj : error LNK2005: "public: __thiscall reprVectorsT
ree::reprVectorsTree(float * *,int,int)" (??0reprVectorsTree@@QAE@PAPAMHH@Z) already defined in Dec.obj
1>decInterface.obj : error LNK2005: "private: class std::vector<bool,class std::allocator<bool> > __thiscall reprVectorsTree::binaryForm(int,int)" (?binaryForm@reprVectorsTree@@AAE?AV?$vector@_NV?$allocator@_N@std@@@std@@HH@Z) already defined in Dec.obj
1>decInterface.obj : error LNK2005: "public: class std::vector<float,class std::allocator<float> > __thiscall reprVectorsTree::decode(class std::vector<bool,class std::allocator<bool> >)" (?decode@reprVectorsTree@@QAE?AV?$vector@MV?$allocator@M@std@@@std@@V?$vector@_NV?$allocator@_N@std@@@3@@Z) already defined in Dec.obj
1>decInterface.obj : error LNK2005: "public: float * __thiscall reprVectorsTree::decode(int *,int)" (?decode@reprVe
ctorsTree@@QAEPAMPAHH@Z) already defined in Dec.obj
What kind of visual studio project settings should I use? I feel the problem is here? Which files to link? how to link? or the default project settings should work?