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

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)

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?

Error setting boost libraries path in Eclipse

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.

Building gold linker with MinGW on Windows, FLEX/bison 'YYSTYPE' was not declared in this scope

I'm trying to build the gold linker included with GNU binutils using mingw. The steps I have taken-
Install mingw with all packages using the installer.
Install the windows version of FLEX to the default location using the windows installer.
Run ./configure in the gold linker directory from the mingw shell which seems to work fine
Run make, this is where I'm getting some errors.
I've included the complete output of ./configure and make in a pastebin here:
http://pastebin.com/1XLkZVVm
But the important part is this:
make[2]: Entering directory `c:/binutils-2.23.1/binutils-2.23.1/gold'
g++ -DHAVE_CONFIG_H -I. -I. -I./../include -I./../elfcpp -DLOCALEDIR="\"/usr/lo
cal/share/locale\"" -DBINDIR="\"/usr/local/bin\"" -DTOOLBINDIR="\"/usr/local//bi
n\"" -DTOOLLIBDIR="\"/usr/local//lib\"" -W -Wall -Wno-format -Werror -D_LAR
GEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -frandom-seed=expression.o -MT expression.
o -MD -MP -MF .deps/expression.Tpo -c -o expression.o expression.cc
In file included from expression.cc:33:0:
script-c.h:221:7: エラー: 'yylex' initialized and declared 'extern' [-Werror]
script-c.h:221:7: エラー: 'YYSTYPE' was not declared in this scope
script-c.h:221:15: エラー: expected primary-expression before ',' token
script-c.h:221:17: エラー: expected primary-expression before 'void'
script-c.h:221:30: エラー: expression list treated as compound expression in ini
tializer [-fpermissive]
cc1plus.exe: all warnings being treated as errors
make[2]: *** [expression.o] Error 1
make[2]: Leaving directory `c:/binutils-2.23.1/binutils-2.23.1/gold'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `c:/binutils-2.23.1/binutils-2.23.1/gold'
make: *** [all] Error 2
I've looked in the script-c.h file and it has this function:
/* Called by the bison parser skeleton to return the next token. */
extern int
yylex(YYSTYPE*, void* closure);
However YYSTYPE is not defined anywhere that I can find.
I'm new to using mingw and msys so I may have missed some steps somewhere. Any help getting this to build would be really appreciated.
As this question had lain unanswered for some months, I looked into the problem.
I downloaded binutils-2.25 (latest at this date) and tried to follow your actions.
I discovered that if you only build gold without the rest of binutils it does not build. If you perform a ./configure and make at the top level it builds the gold fine. If you then cd gold and do the ./configure and make (albeit unnecessarily) then it works fine also.
I did find that when it failed on gold alone it got further than your build did.
My attention was also drawn to your phrase FLEX to the default location. The instructions with FLEX make it clear that you should not rely on the default location (which may be /Program Files/ or similar) but must use path that does not contain any spaces. If you had not noticed this, then that is your fault.
As the latest builds, you can get gold working by ensuring you have installed flex (and bison) properly in non-space paths, then downloading 2.25 and building the whole of binutils rather than gold alone.
I hope this analysis is useful for someone who comes later and finds similar issues.

Dev-C++ - [Build Error] [main.o] Error 1

Im running into big trouble with my compiler Dev-C++, every time i compile any project, whether it is 1 im working on, or a completely fresh 1 I get the same error every single time, I have been on the bloodshed forums and IRC channel but Im not getting anywhere with it... at the moment and every project I try to compile gives the same error...
C:\Dev-Cpp\MY_Project\Makefile.win [Build Error] [main.o] Error 1
Compiler log
Compiler: Default compiler
Building Makefile: "C:\Dev-Cpp\MY_Project\Makefile.win"
Executing make...
make.exe -f "C:\Dev-Cpp\MY_Project\Makefile.win" all
g++.exe -D__DEBUG__ -c main.cpp -o main.o -I"C:/Dev-Cpp/lib/gcc/mingw32/3.4.2/include" -I"C:/Dev-Cpp/include/c++/3.4.2/backward" -I"C:/Dev-Cpp/include/c++/3.4.2/mingw32" -I"C:/Dev-Cpp/include/c++/3.4.2" -I"C:/Dev-Cpp/include" -pg -g3
The system cannot find the path specified.
make.exe: *** [main.o] Error 1
Execution terminated
What is your OS? I think Bloodshed version of the program have some problems with Win8. However you can download Orwell version. It runs smoothly.
Have you looked at this thread? Specifically the first post on this page.

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