Cannot find libcocos2d ios.a library in Xcode - c++

I have downloaded the cocos2d-x 3.6 yesterday. And I do follow the steps in this tutorial page: http://cocos2d-x.org/wiki/How_to_Start_A_New_Cocos2D-X_Game.
I build and run my new project in Xcode successfully. But I notice that there is no "libcocos2d ios.a" library existed when I click my project setting. I try to search the answer from internet, but it seems doesn't have correct one.
One more thing, if I clean the whole project and rebuild it. It will compiling 621 source files to come out(I think it's cocos2d source files), it takes too long time! I don't want to wait so long every time when I clean and rebuild project. Is there a way to make it don't rebuild cocos2d-x source files every time?
the screenshot:
--------------- environment ---------------
Xcode 6.3.2
Mac OS 10.10.3
cocos2d-x 3.6
I find a possible solution here:
http://mcspot.com/build-cocos2d-x-static-library-on-ios/
After trying, the Xcode project failed to link those two generated "libcocos2d ios.a" files(one for arm7, the other for arm64). I still don't know why this happened. I am building project for iPhone 6(arm64), why it says require i386 architecture.
here is the error (build for iPhone 6 simulator):

Related

How to build Unreal C++ project on KDevelop on LInux?

I have been unsuccessfully trying to compile a c++/blueprint project using Plugins like SocketIO-for-UE or VA-REST. And now that i realize any C++ fails. creating C++ in Source folder also leads to the same error.
Cannot even start a new C++ Project. It Fails to compile and ask me to build through an IDE.
Starts with:
"Rebuild Now" gives:
I tried few approaches but nothing seems to work.
GenerateProjectFiles.sh /path/to/.uproject
the above generated a Makefile in the project root, Having that imported to Kdevelop, build seems to work fine but doesn't seem to compile or do any thing with the Plugins folder.
Any help would be much appreciated and will generate lot of good karma for you.
I'm Using:
UE4 4.26.1 (Crashes regularly) & 4.26.2
Ubuntu 20
Kdevelop 5.5

OpenCV 3.0 include tracker

I want to use a tracker, described on the OpenCV 3.0 documentation site. In OpenCV 2.x, it was necessary to recompile OpenCV including the contrib library. But as it is in the OpenCV 3 documentation, I guess that I do not have to recompile it anymore, right? But what do I have to #include in C++?
I'm trying to do this for quit a while and do not find any solution. Thank you!
EDIT
Thank you! The recompiling-process worked for me without any errors. I got still several errors: He does not find 'opencv_highgui300d.dll', 'opencv_imgcodecs300d.dll'and 'opencv_core300d.dll'.
I fixed this, because I had to change the 'Path' system variable to
...\cmake-output\vc12\x86\install\x86\vc12\bin
As far as I know the tracking module is still in the "contrib" module.
You have to re-compile OpenCV 3.0 using the contrib section that you may download from this github repo. When you compile OpenCV using CMake you have to specify the OPENCV_EXTRA_MODULES_PATH atribute as being the location where you have extracted the module.
If you have any issues, just let me know :)
[EDIT]
Download OpenCV from here and OpenCV_Contrib module from here. Unzip them and place them in the same directory (I have put mine in D:/OPENCV-BUILD)/
Open CMake and set the source code path to D:/OPENCV-BUILD/opencv-master
Set the "Where to build the binaries" path to D:/OPENCV-BUILD/cmake-output/vc12/x86. Here, vc12 is the platform toolset used by VS2013 and x86 is the platform target (you may build it for x64 also)
Press the configure button and select your generator (a.k.a the compiler you'd like to use). Select Visual Studio 12 2013 (for x86 build) or Visual Studio 12 2013 Win64 (for x64 build).
Wait until it's done configuring. A bunch of red lines will appear, dont't worry it's all good :)
Search for the following lines and uncheck them:
WITH_CUDA -> this will disable support for GPU accelerated algorithms using CUDA technology. You can build the library with CUDA support also, but it's a bit more complicated and it takes much longer. If you don't need it, un-check it :)
BUILD_DOCS, BUILD_PERF_TESTS, BUILD_TESTS. These are just some tests of the modules of the library (that I have never ever used)... Again, if you don't need them, un-check them :)
Everything related to Matlab (if you have these options). I have Matlab installed and CMake wanted to create some Matlab bindings for OpenCV. I had some issues at compiling the library with these options, so I deleted them (see the image below)
Search for "extra" and in the OPENCV_EXTRA_MODULES_PATH set the path to your "modules" folder from the contrib module (mine is D:/OPENCV-BUILD/opencv_contrib-master/modules)
Now click again on the "Configure" button. Wait until it says "Configuring done", and after that press on the "Generate" button. We're done with CMake!
In the output folder you have selected (D:\OPENCV-BUILD\cmake-output\vc12\x86) you'll find OpenCV.sln. Open it using VS2013.
In Visual Studio, select the configuration you'd like to build (I recommend you to build both for Debug and Release). Let's say you select 'Debug' first. Now right click on the solution and select "Build Solution". Wait until it's done.
In the 'CMakeTargets' folder you'll find a project named INSTALL. Right click on it and select 'Project Only -> Build Only INSTALL'). This creates a new folder named install and copies the result of the build there (libs, dlls, include files, etc.).
Repeat steps 10 and 11 for the 'Release' configuration.
After these steps, you'll have the files you need in your install folder (mine is D:\OPENCV-BUILD\cmake-output\vc12\x86\install)
The following link points to a very clear and nice explanation of how to install OpenCV properly and not have any problems with compilation and provided libraries.
This is the proper way to get a clean installation on Windows 7:
https://coderwall.com/p/wgaiwa/setup-opencv-with-vs2012-on-win7-64bit?p=1&q=author%3AVentsy
Hope it helps

"Launch failed. Binary not found." error on CDT Kepler Eclipse

Running or debugging anything gives me an extremely frustrating "Launch failed. Binary not found" error. I'm using Eclipse with a CDT plugin installed (specifically, I have the MinGW package installed).
I already tried setting both the user and system PATH variables to include my (MinGW directory)/bin
I also tried building the program before running it.
I also made sure that PE Windows Parser under the project's settings was enabled.
I went to Project Properties > Run/Debug Settings > New > C/C++ Application > Environment > Select > and I selected the Path
I also tried setting the C/C++ Application in the Main tab to the executable file that is made from building the program, but no such file is made when I do build my program. I seriously doubt that this is what's causing the problem, though.
I'm running out of options, and the problem still persists. What else needs to be done? What am I doing wrong?
When I was looking through the install instructions for MinGW, the tutorial referenced the mingw base package as the package to install after installing MinGW. But mingw base was not available to me. Instead, I saw mingw32 base. Could it be that Eclipse, a 64 bit program, is trying to run 32 bit code? Is that what's going on? If that's the problem, how do I fix it?
Build
Refresh the project. A new folder named Binaries will appear now in project explorer.
Now Run :)
It took me 3 days to figure out my problem. My Hello World C program would compile in eclipse using the Windows PE Parser, but there was NO EXE FILE!!!! AVAST Antivirus was identifying the exe file as a false positive and removing it....grrrrr. The solution was to add the eclipse workspace folder to the exclusions list. Voila!! Eclipse generated my test.exe file.
save the file first before you build and run... it works with me
Check the compiler you set while you created the project . If that is MINGW or Visual Studio ; check whether they are downloaded or not . If not do so and start a new project by closing the old one . Build the new project by pressing Ctrl + B and a new file 'Binaries' is created in the package explorer . Now you can use the run option to run the project .
First the solution: install "make"
I had the same issue.
I also tried the steps you did with no luck.
After some time i found a the solution!
The problem was that i did not have the application "make".
Apparently its not installed by default on Cygwin and eclipse doesn't give any indication for that...

Developing QT applications in Xcode?

My IDE of choice for the Mac (at least for C++ and Objective-C development) is Xcode. I have a 64-bit Intel Mac with OS X Lion installed, and Xcode version 4.2 downloaded from the Mac App Store.
My problem is that Qt is apparently not compatible with Xcode 4 (it crashes when launching projects generated by qmake), so I'm basically asking how I can integrate Qt with Xcode. I don't have to be able to run and debug the project from Xcode, just build it.
So I thought it might be a solution to use qmake as an external build system within Xcode, the problem is that I have no idea how to set up qmake as my build system, so that I can develop my Qt applications in Xcode 4.
Please help me! :)
Google shows up many pages, but this Qt4 with Xcode page appeared at first glance to be a fairly definitive resource. However, it was last changed in 2006.
Please check out: http://qt-project.org/doc/qt-5/macosx.html
There is a much more recent Qt Developer Network forum post that seems to have good info in it. Specifically, this reply from August 19, 2011 gives a complete recipe.
Update 25/05/2016:
The first two links are now dead, and not archived due to robots.txt.
However, I've updated the link to the forum post.
And here's a copy of emiguel's answer. It is now 5 years old, so I don't know how current it still is.
Hi,
To solve my problem I did the following.
First I`m going to have a subproject in Qt that mantains the graphical interface, I created this project as a C++ library, so I could include this in the main project.
The main project is a C++ project in Xcode (which is a plugin template with a lot of configurations).
Second, I ported the Qt project to Xcode using the spec macx-xcode parameter.
Third, having both projects in Xcode, I can attatch the library (in Qt) to the main project. To do this, right click in the xcode project and click in the "existing file..." option, select the xcodeproj file from the Qt project. Finally add the library to the linkage phase, this is done by dragging the lib file, wich is under the xcodeproj file, to the "Targets" section in the "Link binary with Libraries".
Fourth, import the Qt framewoks to the main project, to do that, right click in the main project, click in add a existing framework, select the Qt features used by the project (ex. QtSDK/lib/QtCore.framework)
And finally, add the header and library paths in the main project. Click in project menu->project settings, set the header search paths option with the Qt headers (ex QtSDK/include//) and the library search paths (ex QtSDK/lib//**).
That's all, now I can instantiate my own Qt widgets from the C++ project.
Note: I have to do an additional step because my target was i386 and the downloaded Qt version were 64 bit, so I downloaded the sources and compiled it for i386.
Now I have another problems about drawing inner the plugin... but I think that will be for another post.
Thanks a lot for your help
Finally, current information on building Qt in Xcode is available in Qt for OS X - which is too long to copy here, and will be maintained and updated by Qt...

OS X Eclipse C++ Launch Failed - Binary Not Found

I am quite troubled as this shouldn't be causing me such a headache. I've downloaded the most recent Eclipse Indigo and all CDT C++ plugins for MAC OS X 10.7.1/
Upon restarting after installing the above CDT plugins, I've developed a simple 'hello world' c++ application and have tried running the application, "Launch failed. Binary not found." error message. I've read multiple fixes but none have worked. I tried adding the -arch i386 flag to the linker and compiler commands, still no luck.
Has anyone successfully gotten Eclipse C++ running on 10.7.1?????? This blows my mind. I can simply write the same program in VIM and compile it just fine via the terminal and execute just fine. ECLIPSE DOESN'T WANT TO PLAY ALONG.
I will be deeply indebted to anyone who can help!!!!!
EDIT: compiler output
**** Build of configuration Debug for project HelloWorld ****
make all Building file: ../main.cpp
Invoking: GCC C++ Compiler g++ -I/Developer/SDKs/MacOSX10.6.sdk/usr/include -O0 -g3 -Wall -c -fmessage-length=0 -arch i386 -MMD -MP -MF"main.d" -MT"main.d" -o "main.o" "../main.cpp"
Finished building: ../main.cpp
Building target: libHelloWorld
Invoking: MacOS X C++ Linker g++ -arch i386 -dynamiclib -o "libHelloWorld" ./main.o
Finished building target: libHelloWorld
**** Build Finished ****
I am using Eclipse Juno with CDT on a 2007 Macbook running Snow Leopard. I have the two symptoms:
No Binaries folder in Project Explorer, and
The 'Launch failed. Binary not found' error.
I have spent hours searching on Google for an answer, long enough to ascertain that these two symptoms are indicative of any number of problems which have been reported for not quite a decade without adequate resolution. That is a problem right there because after a decade there should have been more than enough input data to provide one troubleshooting procedure somewhere which walks the user step by step through the elimination of all possible causes.
Instead, for hours I have read about a multitude of people, many of whom have resolved their particular problem but all of them seeming to have had to do something slightly different to get there.
This should not be that difficult to resolve. Particularly in cases such as mine [but I am not the only one] when the Console view displays a Build with no errors yet the user can copy the binary file [which Eclipse bizarrely says it can not find] to the Desktop and run it without any problems from either Finder or a bash terminal session.
All of this seems to be pointing rather emphatically toward the lack of adequate indicators in the Mach0 64 binary parser which should be designed to tell us exactly what it needs which it is not seeing.
Admittedly, this is exacerbated in the case of MacBooks like mine which are running a 64bit OS [Snow Leopard] on a 64bit CPU which the manufacturer, unfortunately, hamstrung with a 32-bit bootup kernel. But, be forewarned, I have already tried the -arch i386 g++ switch, and the relinking of g++ to g++-4.0 without any change in the symptoms.
ADDENDUM ADDED 10/07/2012:
I am adding this checklist in the hope of clarifying a Way for the undoubtedly many others who will ask this question in the years to come. This Way reflects what I found to be necessary when using Eclipse Juno with a Mac running Snow Leopard:
1) Go to Preferences->C/C++->New CDT Project Wizard, and under Preferred Toolchains, make sure all the Executable project types are set to MacOSX GCC.
2) This is a biggie. I was able to get a Binaries folder in Project Explorer, and hence be able to run the project after building it, by using a Project name which does not contain dots ['.']. This I learned from another answer here, edited a few hours after my previous message. This requirement is easy to miss, hence a common one particularly if you are Eclipse experienced but only with other languages, because tutorials for other language plugins [such as with PyDev or for Java] frequently have you create Projects with dots in the name. If you have developed that habit with other languages, break it when using CDT for C/C++. Be forewarned, however, that it is not enough to just do a Right-Click and Rename an existing project name this time not using dots. The simplest Way is to delete your old project and create a new one with a name without dots.
3) There are many websites cautioning you to make sure you either use the -arch i386 compiler switch or change the links for /usr/bin/gcc and /usr/bin/g++ to point to gcc-4.0 and g++-4.0 instead of gcc-4.2 and g++-4.2. I created a bash script to ease switching back and forth and investigated if this was necessary. It was not, at least not with my Macbook. Based on what I read at one site from a Mach-O developer, I suspect that the current version of Mach-0 64 goes both ways. Which is a good segue to ...
4) In the Project Properties, not Preferences, go to C/C++ Build->Settings and under Binary Parsers make sure Mach-O 64 Parser is checked. Make sure this, and not the deprecated Mach-O parser, is checked.
5) At this point, after you build your project, several things should be evident in the Project Explorer:
6) There should now be a Binaries folder under project's folder.
7) Within that Binaries folder should now be your executable file. It should have [x86_64/le] next to it if, like me, your Mac is effectively 32bit. Now is not the best time to get into the confusing topic of whether your Mac is effectively 32bit or 64bit. If you do not know, and a lot folks don't because Apple does make it confusing, check out the little app which can be downloaded from http://www.ahatfullofsky.comuv.com/English/Programs/SMS/SMS.html which will tell you What Is Truth. It is free, but the 'price' is that you have to scroll pass the ads at the top of the page reflecting the programmer's political disposition.
For those of you that are new to programming/eclipse/IDEs and get the same error but the solutions above don't work, I solved my "Launch Failed. Binary Not Found." error by doing the following: Simply be sure to build your project ("Project" > "Build All") before attempting to run or debug. I was thinking that the IDE would do the building when I clicked debug or run, but that is not the case (obviously, in retrospect). Newbie lesson learned. Once you build you should see a "Binaries" and "Debug" folder under the root directory of the project.
I was using OS X 10.7.3, if it matters, though I assume the mistake I made is fundamental and any eclipse distro would give the same error.
on mac:
Make sure you have xcode installed. Test it by writing "info g++" you must see proper information about the compiler.
Build your project.
Go to the folder of your project. You should see an executable file in Debug or realise folder, depending to your building configurations. If you d-click on the executable file you should see the result on the terminal.
Back to Ecliipse, from Run/Run Configurations... and then browse to the folder that you have the executable file - one you already found - you can also change build configurations as you wish in that window. And make build automatic for each run.
Run again it should work.
Good luck !
I had the same problem, then I found a solution on this site.
Let me explain shortly;
Create your c++ project,
Have a look at project properties(⌘I),
Select Mach-O parser under binary properties,
Write your codes down,
Do not forget building your project (⌘B) before run.
You should change the settings for your project to build an executable instead of a dynamic library:
Invoking: MacOS X C++ Linker g++ -arch i386 -dynamiclib -o "libHelloWorld" ./main.o`
Go to project properties -> C/C++ Build -> Settings -> Build artifact, and select Executable in the first drop down list.
I am using Eclipse Oxygen and the following fixed my problem:
Right-click on your project and go to properties. Navigate to C/C++ Build > Tool Chain Editor and select MacOSX GCC in the Current toolchain, and Apply and Close.
Build your project with CMD+B and then run it.
I was having the same problem. The answer can be hard to find as the "binary not found" issue has cropped up several times before, with different causes and solutions (selecting the 64-bit parser, etc.).
It turns out that, in my case, the fix was simple: you have to do a manual build, just once, for every new project you create. After that, works as usual.
Details: using a fresh fresh install of Eclipse Indigo Service Release 1 on Mac OS 10.7.2.
If your project name contains a "." (dot), the binary file will not be generated on building project.
Remove all the "."(dots) from the project name and rebuilt it or try creating a new project.
Happy coding!
If you can successfully built but when try to run it getting error:
Possible solution could be adding new configuration with full path to your binary output file
(Run->Run Configuration...->Main->C++ Application):
I solved a similar problem with Eclipse by creating a "Launch Configuration". I am using the Indigo release of Eclipse on OSX Lion with CDT (C/C++ dev environment). I found the option to create a new launch configuration in Project->Properties->Run/Debug Settings.
I encountered this problem after creating and building an empty "Hello World Ansi C Autotools Project". The build process created a working executable as src/a.out. I could run a.out successfully from the terminal but Eclipse did not understand that this was an executable for my project until I created a launch configuration pointing to it. Once I did that I was able to run a.out as usual using the green run button.
I had the same problem, even when i had set the artifact to executable. It was because the shared lib setting was ticked and this causes a dylib to be made even though you have specified an executable.
I go this to run by setting the Builder Type to Internal Builder on the C/C++ Build tab, in the project properties dialog.
No matter which approach to take to solve this issue on your workspace, this problem seemed to have become native to the project that I had created. Neither using the arguments or making sure the gcc version for linking did not work. I did find an intuitive solution. Here it is:to the "...binary not available..." error.
Do the following:(remember the following steps are after you have taken either of the above routes and none of those have solved the issue.
1.) delete everything - the project and the files.
2.) create new project and source files
I had the similar issue but code was different. In File.h file make sure
virtual ~Destructor () {}; //Don't forget Curly braces {}
Above statement shows destructor initialized () and defined with curly braces { } . In my code I forgot to define Destructor.
Hope this helps
I was having the same problem, so I fiddled around a littpe bit and found out that if I clicked on the "profile" button (green play icon with a little clock under it), to the right of the "run" button, my program would Run the next time I clicked on the Run button.
I actually dont know what that did, but it allowed me to run the code.
if anybody knows why this helped, and whether it is an actual solution or not dont hesitate to relpy!