# How can I export class file to another project?

**URL:** <https://forums.unrealengine.com/t/how-can-i-export-class-file-to-another-project/314006>\
**Category:** C++\
**Tags:** classes, unreal-engine, import, CPP, question\
**Created:** [April 6, 2015, 9:06am UTC](https://forums.unrealengine.com/t/how-can-i-export-class-file-to-another-project/314006 "2015-04-06T09:06:51Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![anonymous\_user\_7629d931](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_7629d931](https://forums.unrealengine.com/u/anonymous_user_7629d931)\
**Post date:** [April 6, 2015, 9:06am UTC](https://forums.unrealengine.com/t/how-can-i-export-class-file-to-another-project/314006/1 "2015-04-06T09:06:51Z")

</div>

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?

Thanks

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_8e2766aa](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_8e2766aa](https://forums.unrealengine.com/u/anonymous_user_8e2766aa)\
**Post date:** [May 5, 2015, 2:38pm UTC](https://forums.unrealengine.com/t/how-can-i-export-class-file-to-another-project/314006/2 "2015-05-05T14:38:29Z")

</div>

Hello, HamkenDevelop

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!

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_33e74471](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_33e74471](https://forums.unrealengine.com/u/anonymous_user_33e74471)\
**Post date:** [May 5, 2015, 2:45pm UTC](https://forums.unrealengine.com/t/how-can-i-export-class-file-to-another-project/314006/3 "2015-05-05T14:45:23Z")

</div>

Which IDE are you using for your code? VS? You should be able to just copy the classes if you want to go quick and easy, or you can package it as a plugin to be able to reuse it elsewhere also.

> **[A new, community-hosted Unreal Engine Wiki](https://forums.unrealengine.com/t/a-new-community-hosted-unreal-engine-wiki/141494)**
>
> After over a year in maintenance mode, the official Unreal Engine Wiki is now permanently offline. These resources now live on a new community-run Unreal Engine Community Wiki — https://unrealcommunity.wiki/! You will be able to find content from...

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_7629d931](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_7629d931](https://forums.unrealengine.com/u/anonymous_user_7629d931)\
**Post date:** [May 6, 2015, 4:28am UTC](https://forums.unrealengine.com/t/how-can-i-export-class-file-to-another-project/314006/4 "2015-05-06T04:28:33Z")

</div>

Hi,

Thanks for your assistance!

I was able to export a my c++ class to the other project.

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_f39c5262](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_f39c5262](https://forums.unrealengine.com/u/anonymous_user_f39c5262)\
**Post date:** [August 14, 2018, 8:11am UTC](https://forums.unrealengine.com/t/how-can-i-export-class-file-to-another-project/314006/5 "2018-08-14T08:11:24Z")

</div>

So, basically, I should behave as if I am writing these classes from scratch. Just instead of actually writing them, I copy them from another project?

I was hoping to find some option to export a project into some kind of package/plugin which I can easily import into another project…
