How can I export class file to another project?
I have a my c++ class in a project.
I would like to import that class to any other project.
How can I do this?
asked Apr 06 '15 at 09:06 AM in C++ Programming
For this, please do the following:
1) Copy the ClassForExport.h and ClassForExport.cpp from SourceProject\Source\SourceProject to DestinationProject\Source\DestinationProject.
2) In ClassForExport.cpp replace
3) In ClassForExport.h replace the SOURCEPROJECT_API macro with DESTINATIONPROJECT_API (it is located in the line
4) In Visual Studio, right-click on your destination project in solution explorer and select Add - Existing Item. Choose the appropriate .h and .cpp files of your class.
5) Rebuild the project.
This should do it. Please, however, note, that in case your class has some additional includes for files in its original project, you should also take care of them.
Hope this helped! Cheers!
Follow this question
Once you sign in you will be able to subscribe for any updates here