Cocos2dx android Werror=format-security
Had some troubles with using CCLOG() together with c_str(). Received errors of type [-Werror=format-security]
To solve that I added this to my Application.mk
APP_CFLAGS += -Wno-error=format-security

oozey mess
YOU ARE THE REASON

blake kathryn

tannertan36
we're not kids anymore.

@theartofmadeline
Today's Document
Jules of Nature
he wasn't even looking at me and he found me
RMH

pixel skylines
Sweet Seals For You, Always

Origami Around
Mike Driver
One Nice Bug Per Day

Kaledo Art

titsay
KIROKAZE

No title available
let's talk about Bridgerton tea, my ask is open
seen from United States

seen from South Africa

seen from T1
seen from T1

seen from Malaysia

seen from Canada
seen from Italy
seen from Morocco

seen from Canada
seen from United States

seen from Malaysia
seen from Saudi Arabia

seen from Netherlands

seen from Switzerland
seen from Ecuador

seen from Malaysia
seen from United States

seen from United Kingdom

seen from Türkiye

seen from Malaysia
@lovedevshit
Cocos2dx android Werror=format-security
Had some troubles with using CCLOG() together with c_str(). Received errors of type [-Werror=format-security]
To solve that I added this to my Application.mk
APP_CFLAGS += -Wno-error=format-security
Converting int to string
#include <iostream> #include <sstream> const char* value = "1234567"; stringstream strValue; strValue << value; unsigned int intValue; strValue >> intValue; cout << value << endl; cout << intValue << endl;
Casting const unsigned char* to char*
char* c = (char*)methodThatReturnsConstUnsignedCharPointer();
Seems to work?
Comparing two char* with same string values.
char* a = "1"; char* b = "1"; if(a == b){...}
Yes. I thought this was just a simple comparison. Had no idea why the code above didn't work.
Instead you should use strcmp.
char* a = "1"; char* b = "1"; if(strcmp(a, b) == 0){...}
What does for(;;) mean?
You might, like I did, wonder what this mean:
for(;;){ ...}
It's an infinite loop, like while(true){...}
How to not waste time on stupid compiler errors.
Error 7 error LNK2019: unresolved external symbol _sqlite3_open referenced in function..
So what I learned was to solve the LNK2019 error I had to import the sqlite3.lib file in the Linker > Input > Additional Dependencies.
Boy I felt stupid.
CCLOG("debug");
Use CCLOG() for sending log messages. Very straight forward to make it work. The only thing you need to prepare is that you must add the text below to be able to use CCLOG() command on your mobile devices.
#define COCOS2D_DEBUG 1
ANDROID - Y U NO BUILD?
Maybe you ask yourself why your android build is not working.
Files are missing even though you added them.
Enter android.mk, add these lines. No more manually adding of files.
HELLOCPP_FILES := $(wildcard $(LOCAL_PATH)/hellocpp/*.cpp) HELLOCPP_FILES := $(HELLOCPP_FILES:$(LOCAL_PATH)/%=%) CLASSES_FILES := $(wildcard $(LOCAL_PATH)/../../Classes/*.cpp) CLASSES_FILES := $(CLASSES_FILES:$(LOCAL_PATH)/%=%) LOCAL_SRC_FILES := $(HELLOCPP_FILES) LOCAL_SRC_FILES += $(CLASSES_FILES)
set width, set height
Not sure yet if this is because of C++ or Cocos2dx but apparently there's no setWidth / setHeight methods so you have to use setScale(x,y);
wtf?
pre-introduction
Hey devs!
I'm about to start coding a cocos2dx project in C++. I've been working as a AS3 game developer for many years but c++ is new to me.
In this blog I will share the annoying part that gives me trouble on my path of developing a game.