How to run the SFML template? - c++

I have installed the SFML templates (SFML App and SFML CLT) for Xcode to learn more about the library and improve my c++ skills. But I get an Error when I'm trying to run the template.
I have already installed the SFML framework and some external libraries, which SFML depends on.
But when I choose the template "SFML App" to create a new project and I try to run it, I get this error:
ditto: can't get real path for source '/Users/SFML/Desktop/packaging/tmp/install/Library/Frameworks/sfml-system.framework'
couldn't copy /Users/SFML/Desktop/packaging/tmp/install/Library/Frameworks/sfml-system.framework to /Users/seadkurtovic/Library/Developer/Xcode/DerivedData/My_First_SFML_App-bcabgonrxpifggalnkqaxhpyqygs/Build/Products/Debug/My First SFML App.app/Contents/Frameworks//sfml-system.framework
Command PhaseScriptExecution failed with a nonzero exit code
Does anyone know what I did wrong? Because I have actually followed everything carefully according to this tutorial: SFML and Xcode (macOS)

I had the same problem! And I found the answer here:
https://en.sfml-dev.org/forums/index.php?topic=24677.0
Build phases -> Run script -> check "Run script only when installing"
Here is the image:
https://imgur.com/LGZjxN7

Hmm, did you try installing the command line tools for XCode?
Try run this code inside the terminal:
xcode-select --install

Related

Build QT5 project on Ubuntu for Windows

I tried to build qt project on Ubuntu for windows, following the steps in this post
Building Qt 5 on Linux, for Windows
Everything is good except when I run make command, it complains about "i686-w64-mingw32.static-g++: Command not found". But I did see i686-w64-mingw32.static-g++ under /root/mxe/usr/bin. I have no idea what happen. Do I miss something?
You can try run the command directly in shell. If it goes wrong again, check the PATH.

Error when building C++ project

I tried to build a C++ project using Cygwin. I got the following error:
make all
Cannot run program "make": Launching failed
Error: Program "make" not found in PATH
I have C:\cygwin64\bin in the PATH, which contains the file makeg. Is there meant to be some other make file, and where can I find it?
You need to install make.
If you want to know how to do that see the answers to install python and make in cygwin.

SFML 2.1 and Xcode 4.6.3 - "The specified SDK "Current OS X" does not appear to have all of the necessary headers installed."

I'm using Xcode 4.6.3 and SFML 2.1. I just installed SFML and created a project using the "SFML App" template, and I get 202 errors and 2 warnings when I try to run it.
The two warnings are:
"warning: The specified SDK “Current OS X” does not appear to have all of the necessary headers installed. Update your project to use a built-in SDK (“Latest OS X” is recommended) or install the system headers (included with the “Command Line Tools” package) from the “Downloads” pane in the Xcode preferences."
and
"-Wuninitialized is not supported without -O"
I get the error "No such file or directory" for the headers "String", "Foundation/Foundation.h", "Ostream", "Locale", "Cstdlib", "Algorithm", "Vector", "Set" and "Map".
When I installed SFML I first tried to run the install.sh script that is included with SFML. I couldn't get it to work because I didn't use sudo when running the script. I then tried to copy the files to where they should be manually. It said that some; or maybe it was all, of the files already existed, and asked if I wanted to replace them. I said yes. When I tried create a new project in Xcode, none of the SFML templates appeared. I then realized that install.sh might work if I use sudo when running the script. I was then able to create a project using the SFML template but got these errors and warnings.
Highlighting part of the official tutorial you have already read:
With recent versions of Xcode you also need to install the Command Line Tools from Xcode > Preferences > Downloads > Components.
Did you follow these instructions?
SFML and XCode

How can I compile and build a program using external library with command line tools come with Xcode?

I am coding a computer vision program, which is using OpenCV 2.4, by Xcode 4.4. I want to compile and make it in the Terminal by g++ or make command. But the system shows a lot of errors that the compiler cannot find the "opencv2/opencv.hpp" file and Vec3d, etc..!
My question is how to configure the system the I can make and build the code in Terminal? Thanks.
First, you need to have command line tools (I guess you already have it)
Bring up Preference in Xcode
Select "Downloads" tab
Select "Components' tab
Click 'install' on the command line tools line.
Then, you need to install OpenCV. I suggest to use Homebrew
setup homebrew, then
brew install opencv
It will install library in /usr/local, which is in g++'s standard lookup path, thus should be ok.
If you still need help, post the log file.

Eclipse CDT Binary not found - Mac OS X Lion

On my MacBook Air I need to use Eclipse to make some c++ programs for school. So I downloaded Eclipse for C++ from the eclipse.org and made a little Hello World program. However, when I try to run the program, it just gives me the error "Launch failed. Binary not found".
When I try to build the program, this is the output:
**** Build of configuration Debug for project HelloWorldC ****
make all
Cannot run program "make": Unknown reason
Error: Program "make" is not found in PATH
PATH=[/usr/bin:/bin:/usr/sbin:/sbin]
**** Build Finished ****
However, I tried to make a hello world application in Xcode and that works perfect...
Unfortunately, I cannot use Xcode because the teacher is only allowing Eclipse projects...
I found the solution.
The problem is that you can install the latest Xcode (4.3) only from the app store, and by default it seems like the c++ compiler is only accessible through Xcode, to solve this you need to:
Open Xcode
Go to Preferences
Go to Downloads
Install Command Line Tools
Make sure the "UNIX Development Tools" are installed with the Xcode installer.
I don't have Eclipse here, but on my Mac book which make gives me:
correa$ which make
/usr/bin/make
which is one of the paths it's looking for.
If I remember correctly, it was installed simply installing Xcode from the app store. You should try to check if make is really installed in your system, if not, you could try reinstalling xcode to see if it fixes the problem.
Hope this little bit can give you a starting point. Can't yet comment on the question, otherwise would have just made a comment.