PORT To Linux

Hello All,

It sounds that there is no port for linux now.

I would be interested in porting it to linux.

Is there any document available for porting to new platform ?

I have checked all library is available readymade in ubuntu even gles1 & gles2 so what thing is stoping it to run on linux.

I think just we need to modify some os interaction part for input and rendering.

Any idea what is right place to start modification ?

Thanks & Regards

Piyush Verma

cocos2d-x on ubuntu is almost finished now.
You can read this blog by google translate http://blog.csdn.net/laschweinski/article/details/6726311 and see the last screenshots.
The repo is currently in http://github.com/laschweinski/cocos2d-x, After the porting completes, it will pull to master repo.
Any help will be appreciated. I will ask laschweinski to contact you.

Hello, I am the author who port cocos2dx to linux.
besides, I may write an English tutorial about how to compile it in eclipse with ubuntu. if you have any suggestion or require some help, please feel free to contact with me by laschweinski@gmail.com.
Thanks for your attention to my work…

Thanks Walzer thanks Cai

I am going to Try it today.

And let me know if any part I could do.

Hello Dear Team

i am going to try this port straightaway.Thank you for this incredible project as well, i just discover it this week ans woow, super interesting

david

I have wrote a tutorial about compile and run linux port in English
http://blog.csdn.net/laschweinski/article/details/6746567

besides, I recommend to use android ndk standalone toolchain to compile android project
tutorial is in
http://blog.csdn.net/laschweinski/article/details/6738049

finally, another tutorial is about creating an android and linux hybird project, which is based on ndk standalone toolchain

http://blog.csdn.net/laschweinski/article/details/6745008

and I will push these docs to the github tomorrow.

Thanks.

git clone -b LinuxPort https://github.com/laschweinski/cocos2d-x.git
for people that doesnt know git :slight_smile:

I followed your tutorial step by step and it work well for me except the tests cases but it my mistake i am not use with eclipse linker property.

Good job ,

thanks you

david

I have a question…

cat this port works on 32 and 64 bit distributions?

I can’t compile with my Archlinux 64 bits. I have fmod and glfw dependencies installed.
But from eclipse when compiler show some errors on CCTMXLayer.cpp:

rect = CCRect::CCRectMake(rect.origin.x / m_fContentScaleFactor, rect.origin.y / m_fContentScaleFactor, rect.size.width/ m_fContentScaleFactor, rect.size.height/ m_fContentScaleFactor);
can’t call directly to cocos2d::CCRect::CCRect constructor, I fix this error removing CCRect::

but have other error:
int index = ((int)item - (int)m_pAtlasIndexArray->arr) / sizeof(void**);
conversion from int** to int losses precision, and conversion from void** to int losses precision

Any suggestion
Thanks

At the moment it seems to work only on 32 Bit.

You should add the “~~m32" compile flag to the compiler and linker
The first error can be “fixed” by adding "~~fpermissive” to the GCC C++ Compiler Misc Flags.

Edit:
For this to work you’ll also need 32Bit versions of all dependency libraries.

sorry I test the version only on ubuntu 11.04 and 10.04 32 bit.
I may try to run it in 64 bit. But I don’t have a 64 bits os, I need to install it first.
Besides, do you like the way to compile android and linux targets in the same project, as what I introduce in my last blog http://blog.csdn.net/laschweinski/article/details/6745008
or using cmake to compile all of things is better than eclipse. As a eclipse lover, I think eclipse is more convenient, while the way cmake or makefile conform with the traditional linux way.