file cannot create directory using xcode on mac - xcode

I am now compiling opencv source codes based on instructions in How to Build OpenCV Static Libraries Mac OS X. I have no problem with creating xcode project with CMake, and compilation goes on well. I can see that static libraries have been created. However, when I use the install function of the project, I receive the following errors:
/Applications/CMake\ 2.8-11.app/Contents/bin/cmake -DBUILD_TYPE=Debug -P cmake_install.cmake
-- Install configuration: "Debug"
CMake Error at cmake_install.cmake:31 (FILE):
file cannot create directory: /usr/local/include/opencv2. Maybe need
administrative privileges.
Any ideas on making installation possible?

I use the following command to make installation succeed:
cd /Applications/Xcode.app/Contents/MacOS/
sudo ./Xcode /Users/***/Desktop/directory_name/open_source/opencv/xcode/OpenCV.xcodeproj

Related

ninja: error: loading 'build.ninja': The system cannot find the file specified. when build hello world in Visual studio

I have followed esp-idf guideline to install and test to build the hello world and blink sample code but both the code met this problem.
Visual studio try to build hello world
> Executing task: ninja <
ninja: error: loading 'build.ninja': The system cannot find the file specified.
The terminal process "C:\WINDOWS\System32\WindowsPowerShell\v1.0\powershell.exe -Command ninja " terminated with exit code: 1.
I have tested all the ways I can find to fix it but I'm not sure anything I missed or not.
This is one of the way that I test but also met some problem.
cmd try to run the command below
C:\Espressif\frameworks\esp-idf-v4.4>python -m pip install --user -r %IDF_PATH%/requirements.txt
ERROR: Can not perform a '--user' install. User site-packages are not visible in this virtualenv.
This possible problem is the python environment is exist so I cannot do this command, but I try many ways to disabled or deactivated it still cannot.
python path
system environment
After trying to debug this for a long time, I made a backup copy of the entire project folder, then just went hog-wild deleting files. I deleted almost every file I didn't author. Only left the main/CMakeLists.txt, main/component.mk, main/main.c, main/main.h, .gitignore, CMakeLists.txt, and Makefile. Then I ran idf.py set-target esp32 and idf.py -p /dev/ttyACM0 flash monitor and it worked fine again.
VS Code & ESP-IDF on Ubuntu 20.04.05 LTS
Check if the compiler is properly selected. If you don't select a proper c/c++ compiler, then you might get this error. I had mingw in my system, but vs code did not auto detect the compiler. Then I manually added mingw and selected it for compilation after which this issue was resolved.
What worked for me after updating to the new stable release (v5.0) was
Go to the folder S:\esp\esp-idf\esp-idf-v5.0
Run command prompt at this directory and execute install.bat and later export.bat
After trying to build the program in VSCode the error "ninja: error: loading 'build.ninja'" shows up.
Update the path in the ESP-IDF extension in VSCode using ESP-IDF:Configure Paths
locate your project folder e.g. "V:\simpleTest_using_EspIDF_v5_0"
Open command prompt and execute: idf.py build
Now it builds also in VSCode using the Espressif IDF extension.
You not have a build.ninja file. Find this file on proje

GLEW and GLFW on Mac OS X (standalone)

I built a project on XCode using glew and glfw. The CMake file was given to me by a tutorial, so I don't actually know how to make one of the cpp files build by itself. When I pasted the code into a new standalone file, I got the errors:
error: GL/glew.h: No such file or directory
error: glfw3.h: No such file or directory
I googled these errors, but most of the solutions were for Linux and did not work for my Mac. GLEW and GLFW are indeed installed on my system, since I was using them successfully in my XCode project. I just don't know how to set the correct paths when I am compiling a standalone cpp file at the command line using g++.
use -I at the command line to indicate which include paths the compiler should search

build libzmq on mac os x

I am trying to use ZMQ library to communicate between python and c++ code.
I downloaded the source zip from http://zeromq.org/area:download and built it for the windows by using visual studio 2010.
I need to support MAX OS X also. So I tried the same above process by using xcode.
-> I downloaded the code from http://zeromq.org/area:download "POSIX tarball".
-> extract content of zeromq-4.0.4.tar.gz which is downloaded in the above step
-> created the project on xcode
-> included all the files from zeromq-4.0.4/src and zeromq-4.0.4/inc in the xcode project
-> build
Xcode is giving an error while compiling i.e. Unsupported browser in file poller.hpp (77).
I tried to understand from the zmq website but I could not built it.
Can anybody pleas help me building the static lib for the MAC OS X
Thank you.
As per official documentation
brew install zeromq
On the zeromq download page that you reference:
To build on UNIX-like systems
If you have free choice, the most comfortable OS for developing with
ZeroMQ is probably Ubuntu.
Make sure that libtool, autoconf, automake are installed. Check
whether uuid-dev package, uuid/e2fsprogs RPM or equivalent on your
system is installed. Unpack the .tar.gz source archive. Run
./configure, followed by make. To install ZeroMQ system-wide run sudo
make install. On Linux, run sudo ldconfig after installing ZeroMQ. To
see configuration options, run ./configure --help. Read INSTALL for
more details.
Tells you pretty clearly that on Mac OS X compilation uses automake/autoconf. Instead of importing the files into Xcode, install the Xcode command-line tools and do a simple ./configure --enable-static && make to build the static library. The configure script will generate the right headers for you. This is pretty much the default way most libraries that use automake/autoconf are built...
Just use cmake described here:
git clone https://github.com/zeromq/libzmq
mkdir cmake-build && cd cmake-build
cmake .. && make -j 4
make test && make install && sudo ldconfig
I failed 2 test, 1 exception, the other time out.
But building is fine except ldconfig is not on Mac, so need to use dyld
(i am not sure this part)
But it seems working
P.S. Read INSTALL doesn't not give much info

OpenCV in XCode -cmake error

I'm on a mac 10.7.5 trying to work with the OpenCV library in XCode 4.6.2. I'm following this tutorial http://sadeepj.blogspot.co.uk/2012/03/installing-and-configuring-opencv-to.html
So I've downloaded cmake and OpenCV2.3.1 I have written in terminal :
tar xvf OpenCV-2.3.1a.tar.bz2
cd OpenCV-2.3.1
mkdir build
cd build
cmake -G "Unix Makefiles" ..
It all works except at the Unix Makefiles command, where it says CMake Error: Could not create named generator Unix Makefiles..
Anyone know why this is happening or maybe there is another method of getting OpenCV running smoothly in Xcode?
I encourage you to avoid compiling OpenCV by yourself, whenever possible.
You can download the latest OpenCV compiled framework for iOS here, and here you can find some previous versions. To use the framework, just drag the opencv2.framework directory to your XCode project, and you're done.

Firebreath Cmake not found when cmake 2.8.8 is installed on MacOsX

When trying to build an xcode project with the following command line:
./firebreath/prepmac.sh projects/ build/
I get:
Using projects in: /Users/uwecerron/Desktop/Node/projects
Generating build files in: /Users/uwecerron/Desktop/Node/build
NOTE: The build files in /Users/uwecerron/Desktop/Node/build should NEVER be modified directly. Make changes in cmake and re-run this script.
~/Desktop/Node/build ~/Desktop/Node
./firebreath/prepmac.sh: line 10: cmake: command not found
CMake failed. Please check error messages
There are no error messages, and i have cmake 2.8-8 installed. Any suggestions on what to do? this is for a kinect project using depthjs.
When you installed cmake it would have ask you if you wanted to install the command line links; you probably accidentally told it not to. Install cmake again and tell it to install the command-line links and it should work fine.

Resources