Cocos2dx Android and IOS build - cocos2d-iphone

I have downloaded latest version of cocos2d-x from this link.
And worked on Visual Studio Environment and finished.
Now I am going to build it to Android and IOS for extra processes.
What can I do?

There should be cocos2d-x/proj.android and cocos2d-x/build/your_projectname.xcodeproject in your project folder.
Open them in Eclipse & Xcode respectively.
Reference:
Open Project in iOS
Open Project in Android

Using command line:
cocos run -p android & cocos run -p ios~~

You can also write your code using visual studio and then to create the apk go to your project folder in the cmd and type cocos compile -p android. XCode I think is necessary to build the iOS project.

Related

Visual Studio 2019 x64 app using mongocxx driver

I'm trying to get a windows x64 C++ project working with the latest mongocxx driver using Visual Studio 2019. I installed the driver libraries using vcpkg:
vcpkg install mongo-cxx-driver[boost]
In VS 2019 I created a new console app and inserted the example code from the mongo driver page into main(). I built the app and ran it; everything works great. Then I noticed that it built as a win 32 app and switched it over to x64. Now the project won't build b/c it can't find the header files. Specifically (1rst error only...the others are similar)
Severity Code Description Project File Line Suppression State
Error C1083 Cannot open include file: 'bsoncxx/json.hpp': No such file or directory
What do I need to do to make it work on the x64 platform?
As I suspected, it was something I just didn't know to do. From Neumann-A on the vcpkg github site:
vcpkg install mongo-cxx-driver[boost]:x64-windows
or
vcpkg install mongo-cxx-driver[boost] --triplet x64-windows
or
set VCPKG_DEFAULT_TRIPLET=x64-windows
vcpkg install mongo-cxx-driver[boost]

Qt visual studio building

I have ms visual studio solution with qt project. When I working from visual studio all works fine. When I try to run *.exe file from building folder I see message that say Qt5Guid.dll(and other dll's) is not found.
What settings need to be changed that QT dll's moves to general building folder ?
You can find in Qt installation dir application windeployqt.
Run it like this:
windeployqt --debug <path-to-app-binary>
It will deploy all needed Qt files to your application's folder. You can read more about deploying here: https://doc.qt.io/qt-5/windows-deployment.html
Also you can try to add directory of Qt to PATH variable
(Thanks king_nak and drescherjm)

How to deploy a qt based app(developed on Mac) to Windows?

I developed a desktop Qt app on macOs. I want to execute my app on windows. I've looked that pages:
https://doc.qt.io/qt-5.9/osx-deployment.html
https://godhc.wordpress.com/2012/06/10/build-your-qt-project-on-windows-and-mac-osx/
But it did not make sense well.
Can someone explain me how to do that?
you have to recompile it on windows. you have to make sure your code doesn't use macos "framworks" or unix or linux specific functions.
i recommend downloading a precompiled static QT as building it is impossible. you can get that here and using the visual studio compiler, you will have to download visual studio and all the c++ addons and stuff.
!! edit what ever directory your cmd is in is the output of the qmake !!
you then open up cmd and run the static compiled QT's qmake on the .pro file of your project. e.g.
E:\QT_projects\QT\qt5-5.7.1-vs2015\qt5-x86-static-release\bin\qmake.exe E:\QT_projects\variable-length-string-editor-for-binaries\StringEditer.pro
that will make the makefile. and then open the visual studio cmd called "Developer Command Prompt for VS 2017" for me opening the start menu and typing it in will show it.
you then navigate to the folder where the make files that qmake generated e.g.
cd E:\QT_projects\variable-length-string-editor-for-binaries
then run nmake on release or debug or just nmake e.g.
nmake release

Configure Visual Studio 2017 to use existing Android SDK and NDK components

I have set up Visual Studio 2017 to work with Android NDK by installing Visual C++ Android tools, Apache ANT and configuring the locations of existing SDK, NDK and JDK locations.
I have installed LLDB, configured the clang.exe location and included all the headers from /ndk-bundle/sources.
I am trying to build the default Android Native Activity project. An older version can be found here: https://msdn.microsoft.com/en-us/library/dn707595.aspx
But still I am getting a lot of errors and all of the #includes underlined. When I try to build the solution I get the following error.
Severity Code Description Project File Line Suppression State
Error TRK0002 Failed to execute command:
"C:\Android\sdk\ndk-bundle\toolchains\llvm\prebuilt\windows-x86_64\bin\clang.exe
#C:\Users\Saminda\AppData\Local\Temp\tmpcecf4937c8a14139b9405a2aae30e2e6.rsp".
The handle is
invalid. NDKSample.NativeActivity C:\Users\Saminda\source\repos\NDKSample\NDKSample\NDKSample.NativeActivity\TRACKER 1
Any help would be appreciated.
Ant is no longer used by Android projects, replaced by Gradle.
After several experiments from the Android team, they ended up settling with Gradle + CMake, with ndk-build for legacy NDK projects.
Here is the Android documentation how to migrate to Gradle + CMake.
https://developer.android.com/studio/projects/add-native-code
https://developer.android.com/ndk/guides/cmake
I imagine you would need to update the build scripts in the generated project.

How to autocomplete code with C/C++ in Android Studio with Android NDK

I'm a newbie in Android development and I have to work with Android NDK in Android Studio. When I write code in Android Studio, code can't be suggested, so quite difficult to work better. Does Anyone have solution for that? Thank you
I had the same issue for an Eclipse project that I imported in Android Studio. It turns out that the NDK path in the file local.properties was pointing to a previously installed version of the NDK, and not to the NDK downloaded by the SDK manager in Android Studio as it should now be the case. Updating the path in that file allowed me to recover autocomplete.
This previous post seems linked to your issue: Android Studio - Auto complete and other features not working
Regards.
It works with C++ code as well. You need to specify your Cmakelists.txt file inside your build.gradle like this:
android {
externalNativeBuild {
cmake {
path file('jni/CMakeLists.txt')
version '3.18.1'
}
}
}
Also, make sure you have not enabled unity build with your Cmake build system as that leads to issues.
If you face any indexing issues, try to do Build -> Refresh Linked C++ projects in Android Studio.