How to install objective-c header files on ubuntu OS? - objective-c

I am trying to import #import<objc/object.h> in my code. But it is giving me an error "No such file or directory compilation terminated.". Is this because I didn't install the header files or because I didn't included the headers files path to the compiled object library.

Related

CMake Error: Cannot open file for write: C:/Program Files/vtk/bin/CMakeCache.txt.tmpc3fcf for VTK

I am trying to build VTK version 9.2.2 with CMake for a few days now, but no luck so far. I am getting the below error in CMake GUI:
CMake Error: Cannot open file for write: C:/Program Files/vtk/bin/CMakeCache.txt.tmpc3fcf
CMake Error: Unable to (re)create the private pkgRedirects directory:
C:/Program Files/vtk/bin/CMakeFiles/pkgRedirects
CMake Error: : System Error: No such file or directory
CMake Error: Unable to open cache file for save. C:/Program Files/vtk/bin/CMakeCache.txt
CMake Error: : System Error: No such file or directory
I am following the video here, but it still does not work for me. I have tried to search for answers for a while, but there doesn't seem to be the exact same error that I am having on the internet anywhere.
I am on Windows 10, using VTK 9.2.2 and my CMake version is 3.25.1. I also tried with multiple versions of visual studio in the configuration, but it returned the same error.
The steps I have taken were:
Download VTK from the site
Put the downloaded files into the program files directory
Made a /src and /bin folder under a /vtk folder, which is outside the downloaded package
Copied and pasted the downloaded files into the /src folder
Opened CMake GUI and chose the src folder as the source and chose the bin folder as the build folder
Clicked generate and it threw the errors above
The error message like
CMake Error: Cannot open file for write: ...
usually occurred when CMake has no permissions to write a given file.
Your case involves directories under C:/Program Files/, which are usually configured as read-only for normal users.
The file CMakeCache.txt is created in the build directory, so the error message about such file usually means problem with a build directory.
A build directory should always be writable by the regular user. Here CMake creates files for the build tool, and here a build tool creates intermediate and resulted files.

Not able to link HDF5 path in CMake configuration

I'm trying to create make files of C++ code on a server doing
cmake ../
and I get the error
-- Could NOT find HDF5 (missing: HDF5_INCLUDE_DIRS) (found version "1.10.7")
CMake Error at src/CMakeLists.txt:180 (message):
HDF5 support was requested, but no HDF5 library was found on this system
I have installed HDF5 in /home/directory/ so I have HDF5 include and library files in
/home/directory/include
/home/directory/lib
I've tried to add in CMakeLists.txt the following lines:
set(HDF5_LIBRARIES "/home/directory/")
set(HDF5_CXX_LIBRARIES "/home/directory/")
set(HDF5_INCLUDE_DIRS "/home/directory/")
set(HDF5_CXX_INCLUDE_DIRS "/home/directory/")
But still getting the error.
I've also tried to export HDF5_ROOT=/home/directory/ without success.
The error come from the following lines in the code:
if (HDF5_FOUND)
target_include_directories(soft PUBLIC ${HDF5_INCLUDE_DIRS})
target_link_libraries(soft PUBLIC ${HDF5_LIBRARIES})
else (HDF5_FOUND)
message(FATAL_ERROR "HDF5 support was requested, but no HDF5 library was found on this system")
endif (HDF5_FOUND)
Any help?
Using CMake 3.19.3 and hdf5-1.10.7

Qt5 not found by VLC build system

I'm trying to compile VLC on a Ubuntu machine. So after getting all the additional packages required for build, when I run ./configure it says Qt5Core along with a few other Qt related libraries are not found. The problem is that I know that a complete installation of Qt5 and it's libraries are available on my system in the home directory rather than global directory. When building it seems that pkg-config does not check the home directory. How do I inform the actual location of Qt5 installation to the build system?
Note: I have tried downloading Qt from apt sources but that installation was for Qt5.9 rather than the required Qt5.11.
configure needs to fnd the .pc files for Qt modules,
If you check config.log , it might be complaining about that :
configure:xxxx: $PKG_CONFIG --exists --print-errors "Qt5Core >= 5.11.0 Qt5Widgets Qt5Gui Qt5Quick Qt5QuickWidgets Qt5QuickControls2 Qt5Svg"
Package Qt5Quick was not found in the pkg-config search path.
Perhaps you should add the directory containing `Qt5Quick.pc'
to the PKG_CONFIG_PATH environment variable
No package 'Qt5Quick' found
Package Qt5QuickWidgets was not found in the pkg-config search path.
Perhaps you should add the directory containing `Qt5QuickWidgets.pc'
to the PKG_CONFIG_PATH environment variable
There, and to link configure to a specific Qt installation, you have a couple of options ,
Either export variable QT_LIBS
export QT_LIBS=/path/to/qt/libs/
OR , directly add Qt pkgconfig path containing the .pc files to shell PKG_CONFIG_PATH,
export PKG_CONFIG_PATH=$PKG_CONFIG_PATH:/path/to/qt/libs/pkgconfig/

How to run c++ Files using g++ and Cmake?

I am using Header Only Libraries. The libraries are included through Cmake. I am using the g++ Compiler.
Now what I am looking for is to compile the c++ source files via windows cmd. In this moment i am using clion to compile.
Does anyone know how to compile the source files?
If i am compiling the files without cmake , I am getting errors because the program cannot find the libraries.
You do not run a source file, you run an executable produced by a compiler from source file(s)
If you are under a Linux for instance enter the path(s) where the libraries are through the environment variable LD_LIBRARY_PATH
[edit after your remark]
I mean compile
To indicate to g++ where the library are to link use the option -L followed by the path of a directory where the libraries are. If your libraries are on different directories use several time the option, one per directory

Cmake Error for ITK with GDCM configuration

Following error found while configuring ITK with GDCM2.2
CMake Error at Modules/ThirdParty/GDCM/itk-module-init.cmake:5 (find_package):
By not providing "FindGDCM.cmake" in CMAKE_MODULE_PATH this project has
asked CMake to find a package configuration file provided by "GDCM", but
CMake did not find one.
Could not find a package configuration file provided by "GDCM" with any of
the following names:
GDCMConfig.cmake
gdcm-config.cmake
Add the installation prefix of "GDCM" to CMAKE_PREFIX_PATH or set
"GDCM_DIR" to a directory containing one of the above files. If "GDCM"
provides a separate development package or SDK, be sure it has been
installed.
Call Stack (most recent call first):
CMakeLists.txt:558 (include)
I have installed GDCM2.2 [not repository] and manually set path of gdcm directory but still this error returned by Cmake.
Please help.
To build ITK with gdcm download .zip file of gdcm2.2.1 or latest version cause installing gdcm by exe is not include any GDCMconfig.cmake file but zip have it. And in ITK configuration we have to give path of directory where GDCMconfig.cmake is present.