Issue on creating new template project in cocos2dx 3.0 - cocos2d-x

I have created a template project in cocos2dx 3.0. I finished the following command.
./create_project.py -n proj1 -k proj2 -l cpp -p mycompany
Proj1 is created successfully. But i got issue in utility file.
"No member named 'value' in 'std::_1::is_nothrow_copy_constructible
in the line 240 in utility.
_LIBCPP_INLINE_VISIBILITY
pair(const pair& __p)
_NOEXCEPT_(is_nothrow_copy_constructible<first_type>::value && is_nothrow_copy_constructible<second_type>::value)
: first(__p.first),
second(__p.second)
Can any one help me to fix the issue?
Thanks in advance.

Try running the following command for new project in cmd in this directory:
cocos new MyGame -p com.MyCompany.MyGame -l cpp -d DirectoryPath
After running this command, goto eclipse and select import of "Exisiting Android Code in Workspace", then select only "libcocos2dx" and "proj.android".
I hope it will work. Worked for me.
I hope it helps.

Related

Cannot run sikulix script from command prompt(Windows 10). I can launch the ide and run it though

Sikuli version -2.0.5 I can create a script created from the sikuli IDE and run it using the Run button located at the top.
However I cannot get it to run from a command line? Any ideas?
You can understand it better from here
[https://sikulix-2014.readthedocs.io/en/latest/faq/010-command-line.html][1]
But i would say that you have to write something like this to make it work.
1 - Run CMD in admin
2 - Type something like the following command:
java -jar <PATH_TO_SIKULI> -r (run) <PATH_FOR_SIKULI_PROJECT> (ends as .sikuli) -v (verbose in the console) -f (saves log file in path) <WANTED_LOG_FILE_PATH>
Example:
java -jar C:\Sikuli\Sikulli_2_0_5\sikulixide-2.0.5-win.jar -r C:\Sikuli\tests.sikuli -v -f C:\Sikuli\Sikulli_2_0_5\SikuliLog.txt
You can use help like java -jar <PATH_TO_SIKULI> -h to understand how you can adjust it for your needs.

html extra works in cli, but not in Jenkins

when running this in cli, it generates the report. but when I use the same command in Jenkins, no report is generated.
newman run "C:\WORK\getMix-REST.postman_collection.json" --reporters htmlextra --reporter-htmlextra-export "C:\Jenkins\workspace\getMix_report.html"
This is the message shown in Jenkins.
newman: could not find "htmlextra" reporter
ensure that the reporter is installed in the same directory as newman
please install reporter using npm
I have verified that newman and html extra are installed in the correct directories
newman installation:
I'm stuck. please help. Thanks
**Update: when I use just newman-reporter-html instead of newman-reporter-htmlextra, it works fine and report is generated. both reporters are installed on the same level, not sure why html extra doesn't work??
The solution was as follows:
1.- Look for the folder: C: \ Program Files (x86) \ Jenkins \ tools \ jenkins.plugins.nodejs.tools.NodeJSInstallation \ Node3 \ node_modules
** Node3 may vary the name you assigned in Jenkins.
2.- Copy and paste newman and newman-reporter-htmlextra on the folder and try again.

Cocos2Dx - Create APK from Visual Studio

I new with cocos2Dx and wanna create game for Android with using C++. I use proj.win32 and don't now how build .apk. Can I do this?
Make entry of your .cpp files in Android.mk that exist in jni folder. Find jni folder inside proj.android project module.
LOCAL_SRC_FILES := hellocpp/main.cpp \
../../Classes/AppDelegate.cpp \
../../Classes/HelloWorldScene.cpp
run this command on console
cocos deploy -s ./projects/MyGame -p andoird -m release
where ./projects/MyGame is your project root folder -m release indicated you want .apk in release mode otherwise use debug
If want some Android related code then first import your project into eclipse then put your Android related code then deploy or even through eclipse you can deploy.

No Such Module 'Alamofire'

I manually installed alamofire using the tutorial on their GitHub. It was working great until I accidentally changed what used to be Alamofire.xcodeproj to ParkR.xcodeproj. Ever since then I have received the error.
No Such Module 'Alamofire'
I would be so grateful to anyone who can solve this as I have VERY limited time to finish my project and this error has stopped me in my tracks for 5+ hours now! THANKS!
You can do it by another way by using cocoapod Depencency manager . It will take approx 10 minutes time to do . Create a new project and Just follow these steps :
1. Open the terminal and install cocoapod by just writing the command
$ gem install cocoapods
or $ sudo gem install cocoapods
After that go to the path of your project on the terminal.
$ cd "Write your path of the project or simply drag the project folder on the terminal"
Now crate the pod file by the command
$ pod init
4 . open the pod file and write your dependency name like "pod 'Alamofire' " in your case . To open pod file
$ open -a xcode podfile
and just copy past the following in your pod file (not forget to change your
target name , if you are pasting this)
source 'https://github.com/CocoaPods/Specs.git'
platform :ios, '10.0'
use_frameworks!
target '<Your Target Name>' do
pod 'Alamofire',
end
Now , install your dependencies by
$ pod install
Once the dependencies installation is successful . Close the project and open the newly crated .XCWORKSPACE file . And write import Alamofire on the top of your class . All the best and thanks

MySQL for Qt on Mac

I have wasted around 6 hours trying to get MySQL working with Qt following all sorts of instructions from the web. I want to cut my wrist off now!
Does anyone have a simple and a verbose explanation of how to install QMYSQL driver into Qt?
I have Mac 10.6 and I am a beginner n00b.
Your help will be appreciated from the bottom of my heart!
Sana.
EDIT:
I get the following files when I do the grep, so among these just for kicks I copied libqsqlmysql.dylib into all of the folders, but still I don't get to compile... I get an error saying that QSqlDatabase: QMYSQL driver not loaded
/Library/Application Support/DivX/QtPlugins/sqldrivers/libqsqlite.dylib
/Users/pfn368/QtSDK/Assistant.app/Contents/PlugIns/sqldrivers/libqsqlite.dylib
/Users/pfn368/QtSDK/Designer.app/Contents/PlugIns/sqldrivers/libqsqlite.dylib
/Users/pfn368/QtSDK/Desktop/Qt/4.8.0/gcc/plugins/sqldrivers/libqsqlite.dylib
/Users/pfn368/QtSDK/Desktop/Qt/4.8.0/gcc/plugins/sqldrivers/libqsqlite_debug.dylib
/Users/pfn368/QtSDK/Desktop/Qt/474/gcc/plugins/sqldrivers/libqsqlite.dylib
/Users/pfn368/QtSDK/Desktop/Qt/474/gcc/plugins/sqldrivers/libqsqlite_debug.dylib
/Users/pfn368/QtSDK/Madde/sysroots/harmattan-arm-sysroot/usr/lib/qt4/plugins/sqldrivers/libqsqlite.so
/Users/pfn368/QtSDK/Madde/sysroots/harmattan-nokia-arm-sysroot/usr/lib/qt4/plugins/sqldrivers/libqsqlite.so
/Users/pfn368/QtSDK/Maemo/4.6.2/sysroots/fremantle-arm-sysroot-20.2010.36-2-slim/usr/lib/qt4/plugins/sqldrivers/libqsqlite.so
/Users/pfn368/QtSDK/Qt Creator.app/Contents/MacOS/qmlpuppet.app/Contents/PlugIns/sqldrivers/libqsqlite.dylib
/Users/pfn368/QtSDK/Qt Creator.app/Contents/PlugIns/sqldrivers/libqsqlite.dylib
/Users/pfn368/QtSDK/QtSources/4.8.0/plugins/sqldrivers/libqsqlite.dylib
/Users/pfn368/QtSDK/QtSources/4.8.0/plugins/sqldrivers/libqsqlite_debug.dylib
/Users/pfn368/QtSDK/Simulator/Application/simulator.app/Contents/PlugIns/sqldrivers/libqsqlite.dylib
/Users/pfn368/QtSDK/Simulator/Qt/gcc/plugins/sqldrivers/libqsqlite.dylib
/Users/pfn368/QtSDK/Simulator/Qt/gcc/plugins/sqldrivers/libqsqlite_debug.dylib
This is my .pro file
QT += sql core gui\
network
TARGET = mini-stock-exchange
TEMPLATE = app
SOURCES += ./src/main.cpp\
./src/mainwindow.cpp
HEADERS += ./header/mainwindow.h
FORMS += ./ui/mainwindow.ui
My includes
#include "./header/mainwindow.h"
#include "ui_mainwindow.h"
#include <QtSql/QSqlDatabase>
#include <QtSql/QSqlQuery>
#include <QFile>
#include <QtSql/QSqlError>
#include <qsqldatabase.h>
#include <QtCore>
#include <QtSql>
Code to call the database
QSqlDatabase defaultDB = QSqlDatabase::addDatabase("QMYSQL3");
if ( !defaultDB.isValid() ) {
qWarning( "Failed to connect to the database driver" );
}
defaultDB.setDatabaseName( "nicu" );
defaultDB.setUserName( "root" );
defaultDB.setPassword( "root" );
defaultDB.setHostName( "http://localhost:8889" );
First download the Qt SDK sources and a version of the mysql server sources, extract them both.
Create Symlinks to MySQL's lib files:
sudo ln -s /Users/simon/Downloads/mysql-5.6.11-osx10.7-x86_64/lib/libmysqlclient.18.dylib /usr/lib/libmysqlclient.dylib
sudo ln -s /Users/simon/Downloads/mysql-5.6.11-osx10.7-x86_64/lib/libmysqlclient.18.dylib /usr/lib/libmysqlclient_r.dylib
sudo ln -s /Users/simon/Downloads/mysql-5.6.11-osx10.7-x86_64/lib/libmysqlclient.18.dylib /usr/lib/libmysqlclient.18.dylib
sudo ln -s /Users/simon/Downloads/mysql-5.6.11-osx10.7-x86_64/lib/libmysqlclient.18.dylib /usr/lib/libmysqlclient_r.18.dylib
After that cd to your extracted Qt SDK into the folder /Users/simon/Downloads/qt-everywhere-opensource-src-4.8.4/src/plugins/sqldrivers/mysql
Build the Libraries:
qmake -spec macx-g++ -o Makefile "INCLUDEPATH+=/Users/simon/Downloads/mysql-5.6.11-osx10.7-x86_64/include" "LIBS+=-L/usr/lib -lmysqlclient_r" mysql.pro
make
mv libqsqlmysql_debug.dylib libqsqlmysql.dylib
cp -R libqsqlmysql.dylib /Developer/Applications/Qt/plugins/sqldrivers/
After that you should be able to use the QMYSQL plugin. Check if the library was loaded correctly with this line of code (put it in some constructor so that you'll the the output right after starting the app):
qDebug() << QCoreApplication::libraryPaths();
qDebug() << QSqlDatabase::drivers();
For e.g. my output looks like this now:
("/Developer/Applications/Qt/plugins", "/Users/simon/Coding/qt4c/build-SQLtable-Desktop-Debug/SQLtable.app/Contents/MacOS")
("QSQLITE", "QMYSQL3", "QMYSQL", "QODBC3", "QODBC", "QPSQL7", "QPSQL")
The Qt 4 packages from Mac Homebrew have an option to install mysql-drivers as a Qt Plugin for default (it's not a default option, that's why you are missing this).
Download and install Mac OS X Homebrew software as described here: http://brew.sh.
After installing homebrew, remove the previously Qt4 installation.
If you have installed it using brew just type on the terminal:
$ brew remove qt4
To install it with mysql support run:
$ brew install qt4 --with-mysql
And everytime you need to install a package with some options in brew but you don't know the supported options just type:
$ brew options FORMULA_NAME
And it will show all the build options available for the given formula.
Sana, I'm going to try save that hand, alrighty.
First you need the Qt everywhere opensource package from the internets. I've got no idea what version of Qt you're running, but you need the same version as your core install.
Second, you get into the source package and go through the plugins until you find the sql drivers and the mysql plugin. At this stage make sure you know what path your mysql libs and includes are on, as you'll need them.
Third, modify the .pro for the mysql plugin and add your MySql include path to INCLUDEPATH+= and the libs to....LIBS+=
Fourth, run qmake on the .pro to generate a Makefile, then make the make file and you'll have some pretty little .dylib files looking at you with eyes full of joy.
Fifth, the fun part, you need to find where the other plugins are, and this varies system by system. Quickest way to find them is in Terminal type 'sudo find / | grep libqsqlite' and it'll give you the location of that, and that's your Qt sqldrivers plugin directory. Copy the dylib you just built into there.
And that should do it. It's worked for me on quite a few builds and rebuilds.