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

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.

Related

Update g++ reached from NetBeans under OS X

I am trying to build a C++ project in NetBeans 8.2 under OS X with the C++14 standard. However, I am always getting the error while trying to build:
g++ -c -g -std=c++14 -MMD -MP -MF "build/Debug/GNU-MacOSX/test.o.d" -o build/Debug/GNU-MacOSX/test.o test.cpp
error: invalid value 'c++14' in '-std=c++14'
make[2]: *** [build/Debug/GNU-MacOSX/test.o] Error 1
make[1]: *** [.build-conf] Error 2
make: *** [.build-impl] Error 2
BUILD FAILED (exit value 2, total time: 570ms)
Nevertheless, I can run the same command from the terminal without any problems. My version of g++ is 7.0.0, and so the C++14 standard is fully supported.
Therefore, it seems like NetBeans tries to run some older version of g++, which was probably supplied with the system but now is replaced with a new one. To this I have two questions:
How can it be possible that default versions in the terminal and NetBeans are different?
How can I configure NetBeans to work with the terminal default version?
EDIT:
In the terminal which g++ yields /opt/local/bin/g++. The same is in the field Preferences -> C/C++ -> C++ compiler. Adding the --version argument in NetBeans yields Apple LLVM version 5.1 (clang-503.0.40) (based on LLVM 3.4svn), which is definitely different from the console version. So, I still do not understand: why calling g++ under the same path resolves to different versions in NetBeans and the terminal?

Compile c++ code with IDE, error at the second time

I'm a fresh c++ user in Windows 8 system. I have installed MinGW and setup the environment variables. I create the simplest hellow world code as below
#include<iostream>
#include<vector>
using namespace std;
int main(int argc, char **argv)
{
cout<<"hello world"<<endl;
return 0;
}
It works well at the first time, but when I do some small modification, for example delete "hello", and then build and run the project again. I found that the program will keep running without end. The command line keeps showing:
Current working directory: C:\Users\cr\Documents\project\helloworld\Debug
Running program: le_exec.exe ./helloworld
If I try to build it again, it shows
make.exe[1]: Entering directory 'C:/Users/cr/Documents/project/helloworld'
C:/Users/cr/MinGW/bin/g++.exe -c "C:/Users/cr/Documents/project/helloworld/main.cpp" -g -O0 -Wall -o ./Debug/main.cpp.o -I. -I.
C:/Users/cr/MinGW/bin/g++.exe -o ./Debug/helloworld #"helloworld.txt" -L.
c:/users/cr/mingw/bin/../lib/gcc/mingw32/4.8.1/../../../../mingw32/bin/ld.exe: cannot open output file ./Debug/helloworld.exe: Permission denied
collect2.exe: error: ld returned 1 exit status
make.exe[1]: *** [Debug/helloworld] Error 1
helloworld.mk:78: recipe for target 'Debug/helloworld' failed
make.exe[1]: Leaving directory 'C:/Users/cr/Documents/project/helloworld'
make.exe: *** [All] Error 2
Makefile:4: recipe for target 'All' failed
====1 errors, 0 warnings====
I could not even delete the executable file "helloworld.exe" because it is using in 'System' until I restart the computer.
Update:
I can compile it in the command line:
C:/Users/cr/Documents/project/helloworld>g++ main.cpp -o test.exe
C:/Users/cr/Documents/project/helloworld>test.exe
It will then keep running until I close the command line window. If I open a new command line window and compile the file again. There is no problem.
Update2:
Problem also happens when I compile the cpp file the second time even if the file has not been edited.
C:/Users/cr/Documents/project/helloworld>g++ main.cpp -o test.exe
C:/Users/cr/Documents/project/helloworld>test.exe
hello world
C:/Users/cr/Documents/project/helloworld>g++ main.cpp -o test2.exe
C:/Users/cr/Documents/project/helloworld>test2.exe
It keeps running here.
Thanks all, I struggled with it for a whole day. The problem is anti-virus software...... I set it inactive and all things do well...
I don't want to point out what this software is, but just want to give out a reminder for this problem....

Trouble compiling praat on Windows with cygwin - internal compiler error

I'm attempting to compile Praat (http://www.fon.hum.uva.nl/praat/) with Cygwin. I tried following the instructions on the GitHub page (https://github.com/praat/praat). When I run 'make', several files compile with no problem, but then I get:
x86_64-w64-mingw32-gcc -std=gnu99 -municode -D_FILE_OFFSET_BITS=64 -O1 -I ../../sys -I ../../dwsys -c -o gsl_complex__math.o gsl_complex__math.c
gsl_complex__math.c: In function ‘gsl_complex_log10’:
gsl_complex__math.c:425:3: internal compiler error: Segmentation fault
return gsl_complex_mul_real (gsl_complex_log (a), 1 / log (10.));
^
Please submit a full bug report,
with preprocessed source if appropriate.
See <http://gcc.gnu.org/bugs.html> for instructions.
<builtin>: recipe for target 'gsl_complex__math.o' failed
make[1]: *** [gsl_complex__math.o] Error 1
make[1]: Leaving directory '/cygdrive/c/Users/Colin/workspace/praat-master/external/gsl'
makefile:14: recipe for target 'all' failed
make: *** [all] Error 2
I tried posting a question on the Praat user group with no luck. My suspicion is that it will work with a previous version of x86_64-w64-mingw32-gcc, but I'm not sure how to identify which version will work, or honestly, how to downgrade. (I'm also not sure what the difference is between x86_64-w64-mingw32-gcc and plain ol' gcc.) I'd like to avoid any solution that involves editing the source code because it has clearly been compiled as-is before with no problems.
Any suggestions or pointers is the right direction would be greatly appreciated! :)

Can't build test application with WxWIdgets in Netbeans

I'm a total c++ Newbie.
I'm trying to build windows aplications with Wx-Widgets under Net Beans.
So far so good. I have instaled everything, configured, build wx-widgets and attached it to the new project - with help of a good man here: Can't make wx-widget work with net-beans.
Now I try to build my first app:
#include <wx/string.h>
int main(int argc, char **argv)
{
wxPuts(wxT("A wxWidgets console application"));
}
and this is what I get:
I'm not sure if this is readable so I paste the errors:
g++ `C:\WXWIN\wx-config --cxxflags` -c -g -I../../../WXWIN/include `C:\WXWIN\wx-config --cxxflags` -MMD -MP -MF build/Debug/MinGW-Windows/main.o.d -o build/Debug/MinGW-Windows/main.o main.cpp
/bin/sh.exe: C:WXWINwx-config: command not found
/bin/sh.exe: C:WXWINwx-config: command not found
In file included from ../../../WXWIN/include/wx/defs.h:21:0,
from ../../../WXWIN/include/wx/string.h:25,
from main.cpp:1:
../../../WXWIN/include/wx/platform.h:196:22: fatal error: wx/setup.h: No such file or directory
compilation terminated.
make[2]: *** [build/Debug/MinGW-Windows/main.o] Error 1
make[1]: *** [.build-conf] Error 2
make: *** [.build-impl] Error 2
make[2]: Leaving directory `/c/xampp/htdocs/WxWwigets_tutorial'
make[1]: Leaving directory `/c/xampp/htdocs/WxWwigets_tutorial'
BUILD FAILED (exit value 2, total time: 859ms)
Please notice that I have set everything in linker and compiler like ordered: http://wiki.wxwidgets.org/Compiling_using_Netbeans
The error is right in front of you: "command not found". If you use /bin/sh, you must use Unix style paths, e.g. C:/WXWIN/wx-config instead of DOS paths with the backslashes.
I seriously advise you to get familiar with the environment you're using instead of just following the Wiki instructions without understanding them, otherwise your problems won't be over any time soon.

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)