Error setting boost libraries path in Eclipse - c++

I have encountered a problem after setting the path of boost libraries in Eclipse. I get an error like:
No such file or directory
compilation terminated.
Here is my log:
15:32:06 **** Rebuild of configuration Debug for project Demo ****
Info: Internal Builder is used for build
g++ "-IC:\\boost\\boost_1_66_0" "-includeC:\\boost_1_66_0" -O0 -g3 -Wall -c -fmessage-length=0 -o "src\\Demo.o" "..\\src\\Demo.cpp"
cc1plus: fatal error: C:\boost_1_66_0: No such file or directory
compilation terminated.
15:32:06 Build Finished. 0 errors, 0 warnings. (took 147ms)

Looks like your paths aren’t aligned for the -l flag and the -include flag. It should be “-includeC:\boost\boost_1_66_0”, or the correct path to the boost root directory.
See this boost doc for more info.

Related

OpenCV + Eclipse on Linux - Build issues

I downloaded opencv from here and extracted it to /home/XXXX/Documents/opencv-4.4.0.
I want to link it to Eclipse. So I did this -
In the project settings -> GCC C++ Compiler -> include path I gave /home/XXXX/Documents/opencv-4.4.0.
Then in the linker section I added the libraries and set the library search path to /home/XXXX/Documents/opencv-4.4.0 and even /home/XXXX/Documents/opencv-4.4.0/include.
When I build the project, I get this error -
18:50:10 **** Incremental Build of configuration Debug for project displayImage ****
make all
Building file: ../src/displayIMage.cpp
Invoking: GCC C++ Compiler
g++ -I/home/XXXX/Documents/opencv-4.4.0 -I/home/XXXX/Documents/opencv-4.4.0/include -O0 -g3 -Wall -c -fmessage-length=0 -MMD -MP -MF"src/displayIMage.d" -MT"src/displayIMage.o" -o "src/displayIMage.o" "../src/displayIMage.cpp"
In file included from ../src/displayIMage.cpp:1:
/home/XXXX/Documents/opencv-4.4.0/include/opencv2/opencv.hpp:48:10: fatal error: opencv2/opencv_modules.hpp: No such file or directory
48 | #include "opencv2/opencv_modules.hpp"
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
make: *** [src/subdir.mk:20: src/displayIMage.o] Error 1
"make all" terminated with exit code 2. Build might be incomplete.
I followed everything according to this tutorial. I tried running pkg-config --cflags opencv to find the right paths but that gave me this error -
Package opencv was not found in the pkg-config search path.
Perhaps you should add the directory containing `opencv.pc'
to the PKG_CONFIG_PATH environment variable
No package 'opencv' found
What am I doing wrong?

CMake error: ROOT should be built as an out of source build

I am trying to build the project ROOT. There is a command to build using cmake ../root. Whenever, I try to run this command it gives me this error:
Harshits-Air:root harshitprasad$ cmake ../root
-- Found a Mac OS X System 10.13
-- Found a 64bit system
-- Found LLVM compiler collection
-- ROOT Platform: macosx
-- ROOT Architecture: macosx64
-- Build Type: RelWithDebInfo
-- Compiler Flags: -Wc++11-narrowing -Wsign-compare -Wsometimes-uninitialized -Wconditional-uninitialized -Wheader-guard -Warray-bounds -Wcomment -Wtautological-compare -Wstrncat-size -Wloop-analysis -Wbool-conversion -m64 -pipe -W -Wshadow -Wall -Woverloaded-virtual -fsigned-char -fno-common -Qunused-arguments -pthread -std=c++11 -stdlib=libc++ -O2 -g -DNDEBUG
CMake Error at cmake/modules/RootNewMacros.cmake:1041 (message):
ROOT should be built as an out of source build, to keep the source
directory clean. Please create a extra build directory and run the command
'cmake <path_to_source_dir>' in this newly created directory. You have
also to delete the directory CMakeFiles and the file CMakeCache.txt in the
source directory. Otherwise cmake will complain even if you run it from an
out-of-source directory.
Call Stack (most recent call first):
CMakeLists.txt:107 (ROOT_CHECK_OUT_OF_SOURCE_BUILD)
I'm not able to understand what this error means? It would be great if anyone can help me out with this issue. Thanks!
The error message simply tells you to create an additional build folder e.g. build next to the ROOT project folder root, change to this directory and call cmake ../root from there.
TLDR; To simply call the following sequence starting from the root folder:
cd ..
mkdir build
cd build
cmake ../root

Build opencv project fail on eclipse ubuntu

I want build simple opencv program on eclipse on ubuntu 16.04.
I add include path file:
/usr/include/opencv
to:
Properties-> c/c++Build -> Settings -> GCC C++ Compiler -> Includes -> include paths(-l).
And add library path:
/usr/lib/x86_64-linux-gnu/
to:
Properties-> c/c++Build -> Settings -> GCC C++ Linker -> Libraries -> Librav search path (-L).
And add:
opencv_core opencv_imgproc opencv_highgui
to Libraries(-l) but when I want build project this error occurred:
13:10:44 **** Build of configuration Debug for project Opencv ****
make all
Building file: ../src/OpencvTest.cpp
Invoking: GCC C++ Compiler
g++ -I/usr/include/opencv -I/home/aligoglos/Downloads/opencv-3.1.0/include/opencv -I/home/aligoglos/Downloads/opencv-3.1.0/include/opencv2 -include/home/aligoglos/Downloads/opencv-3.1.0/include/opencv/cv.h -include/home/aligoglos/Downloads/opencv-3.1.0/include/opencv2/opencv.hpp -include/home/aligoglos/Downloads/opencv-3.1.0/include/opencv/cv.hpp -include/home/aligoglos/Downloads/opencv-3.1.0/include/opencv/cvaux.h -include/home/aligoglos/Downloads/opencv-3.1.0/include/opencv/cvaux.hpp -include/home/aligoglos/Downloads/opencv-3.1.0/include/opencv/cvwimage.h -include/home/aligoglos/Downloads/opencv-3.1.0/include/opencv/cxcore.h -include/home/aligoglos/Downloads/opencv-3.1.0/include/opencv/cxcore.hpp -include/home/aligoglos/Downloads/opencv-3.1.0/include/opencv/cxeigen.hpp -include/home/aligoglos/Downloads/opencv-3.1.0/include/opencv/cxmisc.h -include/home/aligoglos/Downloads/opencv-3.1.0/include/opencv/highgui.h -include/home/aligoglos/Downloads/opencv-3.1.0/include/opencv/ml.h -O0 -g3 -Wall -c -fmessage-length=0 -MMD -MP -MF"src/OpencvTest.d" -MT"src/OpencvTest.d" -o "src/OpencvTest.o" "../src/OpencvTest.cpp"
In file included from :0:0:
/home/aligoglos/Downloads/opencv-3.1.0/include/opencv/cv.h:66:38: fatal error: opencv2/video/tracking_c.h: No such file or directory
compilation terminated.
src/subdir.mk:18: recipe for target 'src/OpencvTest.o' failed
make: *** [src/OpencvTest.o] Error 1
13:10:44 Build Finished (took 202ms)
why?
your library include file i guess is wrong it should end with /lib , u can find the right path using this command on terminal though :
pkg-config opencv --libs
hope it will help you

make: *** [src/Class.o] Error 1 eclipse

ok so i installed CDT for C++ development on my machine. I tried to make it work and followed these instructions to set everything up. By mistake i have gone into the Project>Properties>C++ Build>Enviorement and hit restore defaults by mistake. I dont know if that changed anything but i get the following error when i run my class.
I tried to switch the slashes in the given path "C:\Users\Nathan\workspace\Project\Debug" to forward slashes but that did nothing. I still get the same error. Any hints on what im doing wrong?
19:12:58 **** Incremental Build of configuration Debug for project Project ****
make all
Building file: ../src/Project.cpp
Invoking: Cross G++ Compiler
g++ -O0 -g3 -Wall -c -fmessage-length=0 -MMD -MP -MF"src/Project.d" -MT"src/Project.d" -o "src/Project.o" "../src/Project.cpp"
cygwin warning:
MS-DOS style path detected: C:\Users\Nathan\workspace\Project\Debug
Preferred POSIX equivalent is: /cygdrive/c/Users/Nathan/workspace/Project/Debug
CYGWIN environment variable option "nodosfilewarning" turns off this warning.
Consult the user's guide for more details about POSIX paths:
http://cygwin.com/cygwin-ug-net/using.html#using-pathnames
In file included from /usr/lib/gcc/i686-pc-cygwin/4.5.3/include/c++/cwchar:44:0,
from /usr/lib/gcc/i686-pc-cygwin/4.5.3/include/c++/bits/postypes.h:42,
from /usr/lib/gcc/i686-pc-cygwin/4.5.3/include/c++/iosfwd:42,
from /usr/lib/gcc/i686-pc-cygwin/4.5.3/include/c++/ios:39,
from /usr/lib/gcc/i686-pc-cygwin/4.5.3/include/c++/ostream:40,
from /usr/lib/gcc/i686-pc-cygwin/4.5.3/include/c++/iostream:40,
from ../src/Project.cpp:9:
/usr/lib/gcc/i686-pc-cygwin/4.5.3/include/c++/cstddef:44:20: fatal error: stddef.h: No such file or directory
src/subdir.mk:18: recipe for target `src/Project.o' failed
compilation terminated.
make: *** [src/Project.o] Error 1
19:12:59 Build Finished (took 535ms)

makefile error for c++

What is this error
:!make
g++ -g -I../direc1 -I./ -c final.cpp
make: g++: Command not found
make: *** [final.o] Error 127
?
You don't have g++ installed (or it's not in your $PATH variable).
The error message says it all.
You don't have g++ installed or
You have it installed but it is not in your PATH environment variable.
g++ not found indicates that your system can not find the executable file g++.
Ensure that your system knows where to search for g++.
On windows, this is done via the environment variable "path".
Add the g++ path in $PATH export PATH=$PATH:g++Path