Hi, I’m using cocos2dx v 3.16 with Visual Studio 2017. I am having trouble deploying my application with the deploy command. Whenever the application starts building it says return error code 1 claiming that it didn’t find any localized resources, as well as linking me to an error file.
It looks like you upgraded your solution file from a previous version of Visual Studio, so all those errors that it showed you need to be fixed before you can build your project.
First thing you need to do is figure out what those errors mean, then work out what you need to do to fix them. I’m sure an internet search engine can help with that. If I were to guess, it may just be missing entries in the configuration section of the vcxproj file for each of those projects. See if the configuration sections look something like this, and if not, then you’ll need to update them:
Note that this is just one example for a release configuration, so you need to update any configurations you have with the relevant lines for VS2017, which are these:
Well, at least now you know that it is most likely an issue with your development environment, or something that you’re doing incorrectly, that is causing the problem. What steps did you follow to create a new project and compile it? Take screenshots of each step as you do it, including a screenshot of Visual Studio (with the project tree visible) after you try to compile it, and post them here. Otherwise, type out the exact steps, and don’t miss anything, otherwise this will just be a lot of guesswork and time wastage.
If you don’t have CMake installed, then install it by going to cmake.org, and download the relevant cmake-3.12.4 for your operating system (most likely for you it would be cmake-3.12.4-win64-x64.msi. After it is installed, open a console window and run the command “cmake --version” to make sure that it’s working.
Create a new Cocos2d-x 3.17 project with this command:
cocos new Apophis -p com.example.apophis -l cpp -d .
Now, in a console window, go into the Apophis directory that has been created.
Type this in:
mkdir win32-build && cd win32-build
cmake .. -G"Visual Studio 15 2017" -Tv141
In Visual Studio, open the solution that located in the Apophis/win32-build/ folder. It may be called TemplateCpp.sln because of a bug inCocos2d-x 3.17. You can rename it later (from inside Visual Studio), but for now do not change the name of that file.
Compile and run it. It should work, and if it doesn’t, be very specific as to what errors you get, otherwise there’s little else I can help you with.
Hi R101, thanks for your help. I created a test project with cocos new command and then went into the directory and did the cmake command that you asked me to do, then I compiled and run it- which worked perfectly. But I tried using the deploy command to turn the application into a single executable but it showed me the same errors after calling -deploy. Here are some pictures:
To summarize:
cocos new Test -p com.InversePalindrome.Test -l cpp -d C:\Users\Bryan\Desktop
cd C:\Users\Bryan>cd C:\Users\Bryan\Desktop\Test
mkdir win32-build && cd win32-build
cmake … -G"Visual Studio 15 2017" -Tv141
compile and make sure it runs(which it did)
cocos deploy -p win32 → get return error return 1 which sends me to a log file that has the same errors as in the first picture of the thread. I basically want to deploy the application into a single executable as seen on this video
I have never used the deploy command, so I really don’t have any info that would help sort out your issue. Perhaps someone else here can jump in and help with that.
If the purpose is to create an executable that bundles everything into an installation file, then have you considered using something like InnoSetup (http://www.jrsoftware.org/isinfo.php)? It’s great, and it’s free.