Search in
Sort by:

Question Status:

Search help

  • Simple searches use one or more words. Separate the words with spaces (cat dog) to search cat,dog or both. Separate the words with plus signs (cat +dog) to search for items that may contain cat but must contain dog.
  • You can further refine your search on the search results page, where you can search by keywords, author, topic. These can be combined with each other. Examples
    • cat dog --matches anything with cat,dog or both
    • cat +dog --searches for cat +dog where dog is a mandatory term
    • cat -dog -- searches for cat excluding any result containing dog
    • [cats] —will restrict your search to results with topic named "cats"
    • [cats] [dogs] —will restrict your search to results with both topics, "cats", and "dogs"

How do you migrate C++?

How to migrate C++ to another project is what the question is. Thank you.

Product Version: UE 4.11 Preview
more ▼

asked Mar 16 '16 at 09:00 AM in Using UE4

avatar image

0 4 5 9

avatar image MasterChiefJohn Mar 17 '16 at 01:48 AM

Yeah, but that doesn't really answer my question.

I'm not talking 2 files, I'm talking 100 and over. You're telling me to manually copy and paste each code one by one with compiling step which is practically impossible.

avatar image MiKom Mar 17 '16 at 10:39 AM

What prevents you from copying all the files at once?

avatar image MasterChiefJohn Dec 18 '16 at 02:15 PM

In the "Shooter Game," there are lot of C++ files, and you can't copy and paste 100+ documents from there into another version. Otherwise, it'll lag or gets you an extremely large bug. Try copy and paste C++ files from the game into another one without using "Add To Project."

avatar image MiKom Dec 31 '16 at 12:52 PM

Well, if you're bothered that you can introduce bugs or inefficiencies in the copied code, then why bother? Just write the code yourself from scratch

avatar image MasterChiefJohn Dec 18 '16 at 02:16 PM

Literally, its called migration.

avatar image dimitrov Aug 19 '18 at 08:45 PM

The problem is that the migration does not work.

I migrated a blueprint together with its dependencies to another project. Most things were migrated successfully, but none of the cpp files (or basically anything from the "source" folder). Since some of the dependencies of my blueprint are cpp files, it does not work. So the migration failed, and I have to do it manually.

The problem with doing it manually is that I don't immediately know which cpp files are dependencies I need, and which ones are unrelated.

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

2 answers: sort voted first

If code in your file doesn't depend on other files, just copy the file (.h header and .cpp) to the target project and regenerate visual studio project files (if UE is installed from launcher, right click on .uproject file of the target project and select "Generate Visual Studio project files"), then recompile the project.

more ▼

answered Mar 16 '16 at 09:06 AM

avatar image

535 17 9 39

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

I found a very easy and quick solution, first of all copy the .h and .cpp files to the "Source" folder of the project, then open both files, and you have to replace only one line of code for each file and that's it.

In the .h file, the line of code is searched for example "class MIGRATIONTEST_API UNewActorComponent: public UActorComponent" and it replaces "MIGRATIONTEST_API" by anyone who is in another file originally created in this project.

With the .cpp file is almost the same, the line of code to replace is for example #include "MigrationTest.h", once this is done just compile again and go.

more ▼

answered May 13 '17 at 03:13 PM

avatar image


(comments are locked)
10|2000 characters needed characters left
Viewable by all users
Your answer
toggle preview:

Up to 5 attachments (including images) can be used with a maximum of 5.2 MB each and 5.2 MB total.

Follow this question

Once you sign in you will be able to subscribe for any updates here

Answers to this question