Migrate Cocos2d-x project from Mac to Ubuntu - c++

I'm developing a game on C++ using Cocos2d-x v3.5. I use latest Xcode and have no problems with make & run. But my friend who wishes help me can't run my project on his Ubuntu. We guess something is wrong with cocos2d make-files (we've found 2 named CMakeLists.txt ). Are there any ideas how to fix our makefiles and run project on Ubuntu?
(full size)
P.S.
Source codes are in private repository but I can provide any additional info
Thank you!

No, it's not the Makefile. The compiler does not know what USING_NS_CC means, which implies an error including header files.
If you are using Xcode (which is not clear given you say you "have no problems with make & run") then it's possible that the Cocos2d-x header files are included in the precompiled header file (prefix.pch) and therefore don't need to be explicitly #included in other files.
However these precompiled headers may not be set-up correctly under Linux/cmake.
The answer is to include the Cocos2d-x header files explicitly in any file that references the Cocos2d-x API.

Related

Missing headers file in C++ Windows project

I have inherited some ancient Windows C++ code and have created a project for it in Visual Studio 2010. When I build, I get missing header file errors for system files such as "precom.h" and "Classes.hpp". They do not exist on my machine. Is anyone familiar with these files and where they come from? Thanks.
They're not standard Windows files. My guess is that whoever you inherited the code from forgot to check the files into source control.
Go find that person, and glare at them until they find them!
The name precom.h is suggestive of a precompiled header. If that's true, then it may be a matter of getting the project set up to generate the precompiled header.

SuperLU library XCode issues

I'm a newbie when compiling and adding 3rd party C++ libraries into XCode... So here's the problem. I have .cpp files wich depend on 3 libraries. OpenCV-Eigen-SuperLU. So far think that I managed to add correctly OpenCV-Eigen, but I got trouble adding SuperLU.
I'm really confused on where should I include source files paths??. Some tutorials say that I need to create a static lib... other that I need a framework... on the other hand there are XCode project template which just include src files into a folder inside XCode project's and then reference them from build setting properties. Anyway I really need some guidance here.
So here's my setup for most of the libs. I have a folder within the XCode project with all dependencies.
Then... on project build settings I setup header search paths-- and library search paths. To point that folder
Headers for SuperLU are found correctly... but I get Linker errors.
So as you can see, I have no idea what to do... I'm Sorry but as I told on beginning I'm a newbie adding libs into XCode... plus documentation of procedures it's not good at all. So if anybody could help me with some guidance or links where I can start understanding how the linking process works would be great.
I'm a little desperate at this point, os any kind of help would be really really great.
Thanks a lot.
The problem is that both SuperLU and Objective-C define YES and NO. So you get a conflict.
In the end I was advised to create a different target to compile all SuperLU as a pure c++ project with gcc compiler. That made it possible for iOS app to use the lib as a dependency.

Does Boost::Context work on iOS?

I am trying to build boost::context for an iOS app. I tried following the instructions on boost's site, but I am finding them a little complicated. So I copied the /boost/context directory, and any other header's xcode asked for into my xcode project.
Now, I am trying to figure out which source files I should build.
My choices from the provided source:
http://svn.boost.org/svn/boost/trunk/libs/context/src/asm/
Which of these files, if any, are the correct ones?
Yes, Boost::Context works on iOS!
The correct files to compile are
jump_arm_aapcs_macho_gas.S
make_arm_aapcs_macho_gas.S

Can eclipse do auto-complete using external libraries like cocos2d?

I'm using Eclipse in linux. I have created a project using Cocos2D. It's a Java project, but im opening cpp and headers files to write native code.
Each time, i compile the native code with ./build_native.sh
I will like to know if eclipse could be configure to autocomplete functions in native code.
Example:
CCDirector::sharedDirector()->
Must show the options like getWinSize().
Some ideas? Thanks in advance.
I can't answer to the specifics of your question but in general I had this problem in C/C++ with iostream and STL libs. Even though everything would compile fine it wasn't supporting auto-complete. I ended up digging down into the supplied libraries to the root that held each .h file collection and added those to the directories path. Then I rebuilt the index and then auto-complete started working. So if cocos2d stores .h files in more than one location add each folder.
Have you installed the CDT? That give Eclipse C/C++ capabilities similar to what it already has for Java.

Code::Blocks cannot find vector header

EDIT: I have solved this problem, with Tomalak's help. It appears that I mistakenly uninstalled libstdc++6-4.4-dev_4.4.3 when I was making space to install code::blocks into, thus removing the STL headers. Code::Blocks now works perfectly fine.
Hey everyone, I'm back yet again to bug you.
I have recently installed Code::Blocks in order to follow along with a SDL tutorial, mainly to make it easier with the file creation process (i.e. not having to deal with makefiles for the time being)
I have been compiling/running the examples (so far) just fine, but I've now hit a snag.
On the tutorial for entities, the header file includes <vector> - yet code::blocks is stating it cannot find said header file. It's a .h header file, but it's recognizing it as C++ (I think, judging from the project options) - all my headers are .h, all my sources are .cpp...
I have searched Google for a solution, and many people state that this error occurs when they try to use in a .c file by mistake. This is not the case, unless Code::Blocks is recognizing my .h as a C-header.
In case you're wondering, I am running Lucid Puppy Linux 5.2 (aka LuPu), a Ubuntu derivative. (Installed Code::Blocks from the Ubuntu repositories)
In advance, thank you very much for the help.
As it turns out, it was not a Code::Blocks issue - I had mistakenly un-installed the libstdc++6-4.4-dev_4.4.3 package.
So, if any of you all get this same problem make sure the libstdc++ development files are installed! LOL