I have a problem with merging two projects compiled separately. I created some classes (Qt and C++) to manage two mechanical stages (first project) and one class/interface for a laser scanner (second project). When I import the class/interface in the first project, the compiler gives me a lot of redefinition errors on some Windows api classes (the second project uses classes as winsock2).
Could someone help me to find my error? Not only my "grammatical" errors ;)
Thanks!
Just
clean
the project, rebuild and run again. One possibility that this may happen is you probably might have used a previous version of library in any of your project and now after merging two projects you may be using latest version of library in other project. The already existing compiled binaries of project which you have merged will be looking for different version of library, but you may have included another version of it in your 2nd project or vice versa!!After merging both appears to be in same project! So try cleaning the Project, use only latest version of library and rebuild and run.If you try to include both
winsock.h
andwinsock2.h
, this error will happen for sure. Becausewinsock2.h
is a complete rewrite ofwinsock.h
. So you would definitely get redefinition errors.One possible solution is ..
Or
Try using only 1 version of it