I was having the exact same error, I fixed it by going into compiler options and taking out the check out of Add these commands to the linker command line. I don't know if you have anything in there but it works now for me. I've also been having a lot of problems with the Compiler not being able to create the Makefile.win but I think I've fixed that by putting an empty 'build' folder in the same directory as the project.

i get the same error even with dev's example projects, dev 4 works and dev 4.9.9.2 works on my bad comp which runs win95 i checked the path and its there and it works, i would like to use dev and getting some of the other compilers isn't really an option cos i still have dial up til i get a job and some compilers would take ages to download

compile log:

Compiler: Default compiler
Building Makefile: "C:\Dev-Cpp\Examples\Hello\Makefile.win"
Executing  make...
make.exe -f "C:\Dev-Cpp\Examples\Hello\Makefile.win" all
g++.exe -c Hello.cpp -o Hello.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"   

'[B]C:\DOCUME~1\JOSH'[/B] is not recognized as an internal or external command,operable program or batch file.[B](what is dev using this path for?)[/B]

The system cannot find the path specified.

make.exe: *** [Hello.o] Error 1

Execution terminated

Makefile:

# Project: Hello Sample
# Makefile created by Dev-C++ 4.9.9.2

CPP  = g++.exe
CC   = gcc.exe
WINDRES = windres.exe
RES  = 
OBJ  = Hello.o $(RES)
LINKOBJ  = Hello.o $(RES)
LIBS =  -L"C:/Dev-Cpp/lib"  
INCS =  -I"C:/Dev-Cpp/include" 
CXXINCS =  -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" 
BIN  = Hello.exe
CXXFLAGS = $(CXXINCS)  
CFLAGS = $(INCS)  
RM = rm -f

.PHONY: all all-before all-after clean clean-custom

all: all-before Hello.exe all-after


clean: clean-custom
    ${RM} $(OBJ) $(BIN)

$(BIN): $(OBJ)
    $(CPP) $(LINKOBJ) -o "Hello.exe" $(LIBS)

Hello.o: Hello.cpp
    $(CPP) -c Hello.cpp -o Hello.o $(CXXFLAGS)

could someone maybe post the same project compile log and makefile

I have exact the same problem. The funny thing is: If I save my project "directly" on any hard drive (C:\, D:\, E:\ ...) everything works fine, but as soon as I save the project in any folder (ie C:\newfolder), then I get the "Dev-C++ - [Build Error] [main.o] Error 1" error.

This is pretty strange, no?
I followed all the tips provided in this thread but to no avail :/ .

Anyone here knows any other solution?

Sorry, old post, but I figured out the reason for this problem (at least in my case). The liballeg.a file that is linked to under project options/parameters is RELATIVE to the project file. So if the project file is moved, you have to erase the linker settings under parameters, and redo them. In my case I had the project file in the devcpp directory, worked fine, then I moved it into devcpp\projects, got the error. The linker was set to \lib\liballeg.a, had to change it then to ..\..\lib\liballeg.a. Hope this helps people out,
GOD

I had the Error 1 message but no other message in the compile log. I got the Error 1 each time I created a target, no matter if it was the final .exe or an intermediate .o. If I compiled again, the error would not show, so compiling twice was a solution. Annoying one.

I tried most of the things reported in this thread, but could not solve it.

As a random test (in fact, I kind of remembered solving the same problem in the past) I changed configuration so to use a different GNU make and solved the problem.

The problem showed with GNU make 3.8 and didn't show with GNU make 3.79.1

I had the same problem, for me just moving the cc1 file into the same folder as the Makefile.win file solved the problem

Hey i was also suffering that problem when i came upon your thread, and i found however , when out of nowhere my brain said why did this work yesterday and not today, the answer is i had started a windows project today instead of a console application and that was giving me the error you had, alough i actually wanted a console program in the first place.

i have some suspicion to believe that dev c++ is not very happy to work with windows programs, you could try opening a console application templace project, then clear the main.cpp.
with this blank main.cpp paste your original main code and relink you other project files, its a wild guess but it might just work for you, my theory being that there is a problem with the default template for a windows program.

if that works id love it if you could message me back if not ... sorry

also if you understand my confused talking here you are doing very well.

good luck!!

I am having the same issue....

I am using XP on campus. The msg is as follows

Compiler: Default compiler
Building Makefile: "\\ls5-central.lab.cpcc.edu\home\zperkin0\Dev-Cpp\Makefile.win"
Executing make...
make.exe -f "\\ls5-central.lab.cpcc.edu\home\zperkin0\Dev-Cpp\Makefile.win" all
g++.exe -c grade1.cpp -o grade1.o -I"//ls5-central.lab.cpcc.edu/home/zperkin0/Dev-Cpp/lib/gcc/mingw32/3.4.2/include" -I"//ls5-central.lab.cpcc.edu/home/zperkin0/Dev-Cpp/include/c++/3.4.2/backward" -I"//ls5-central.lab.cpcc.edu/home/zperkin0/Dev-Cpp/include/c++/3.4.2/mingw32" -I"//ls5-central.lab.cpcc.edu/home/zperkin0/Dev-Cpp/include/c++/3.4.2" -I"//ls5-central.lab.cpcc.edu/home/zperkin0/Dev-Cpp/include"

'\\ls5-central.lab.cpcc.edu\home\zperkin0\Dev-Cpp'
CMD.EXE was started with the above path as the current directory.
UNC paths are not supported. Defaulting to Windows directory.

g++.exe: grade1.cpp: No such file or directory

g++.exe: no input files

make.exe: *** [grade1.o] Error 1

Execution terminated

Pls assist.

The only thing im concerned about there, is why are you using dos to complie when dev cpp has a very useful compilers which uses makefiles (which are a godsend in bigger projects)

ive never used g++ in cmd so im not sure what the correct syntax for it is, however if its declaring file not found then the only thing i can think of is , are your source files your trying to compile actually in that directory (seems a silly question but ive seen it happen)

I have done this successfully.

Say your Dev C++ is in C drive of Windows (C:\Dev-Cpp\)

Copy following text to Tools >> Compiler Options >> Directories >> Binaries and click OK.

C:\Dev-Cpp\Bin
C:\Dev-Cpp\libexec\gcc\mingw32\3.4.2

Hope this helps.

I will tell you about a problem similar to yours and how I could handle it.
I tried to compile and run Hello World as it follows:

#include <iostream>

using namespace std;

 

int main()

{

            cout << “Hello World!” << endl;

            return 0;

}

And I got the following compile log:

Compiler: Default compiler
Executing gcc.exe...
gcc.exe "C:\Users\jordanka\Documents\Uchebni resursi\Êîìïþòúðíà ãðàôèêà\Computer Graphic\Source Computer Graphics\KG_Main.c" -o "C:\Users\jordanka\Documents\Uchebni resursi\Êîìïþòúðíà ãðàôèêà\Computer Graphic\Source Computer Graphics\KG_Main.exe" -I"C:\Dev-Cpp\include" -L"C:\Dev-Cpp\lib"
C:\Users\jordanka\Documents\Uchebni resursi\Êîìïþòúðíà ãðàôèêà\Computer Graphic\Source Computer Graphics\KG_Main.c:1:20: iostream: No such file or directory
C:\Users\jordanka\Documents\Uchebni resursi\Êîìïþòúðíà ãðàôèêà\Computer Graphic\Source Computer Graphics\KG_Main.c:3: error: syntax error before "namespace"
C:\Users\jordanka\Documents\Uchebni resursi\Êîìïþòúðíà ãðàôèêà\Computer Graphic\Source Computer Graphics\KG_Main.c:3: warning: data definition has no type or storage class

C:\Users\jordanka\Documents\Uchebni resursi\Êîìïþòúðíà ãðàôèêà\Computer Graphic\Source Computer Graphics\KG_Main.c: In function `main':
C:\Users\jordanka\Documents\Uchebni resursi\Êîìïþòúðíà ãðàôèêà\Computer Graphic\Source Computer Graphics\KG_Main.c:11: error: `cout' undeclared (first use in this function)
C:\Users\jordanka\Documents\Uchebni resursi\Êîìïþòúðíà ãðàôèêà\Computer Graphic\Source Computer Graphics\KG_Main.c:11: error: (Each undeclared identifier is reported only once
C:\Users\jordanka\Documents\Uchebni resursi\Êîìïþòúðíà ãðàôèêà\Computer Graphic\Source Computer Graphics\KG_Main.c:11: error: for each function it appears in.)
C:\Users\jordanka\Documents\Uchebni resursi\Êîìïþòúðíà ãðàôèêà\Computer Graphic\Source Computer Graphics\KG_Main.c:11: error: stray '\147' in program

C:\Users\jordanka\Documents\Uchebni resursi\Êîìïþòúðíà ãðàôèêà\Computer Graphic\Source Computer Graphics\KG_Main.c:11: error: `Hello' undeclared (first use in this function)
C:\Users\jordanka\Documents\Uchebni resursi\Êîìïþòúðíà ãðàôèêà\Computer Graphic\Source Computer Graphics\KG_Main.c:11: error: syntax error before "World"
C:\Users\jordanka\Documents\Uchebni resursi\Êîìïþòúðíà ãðàôèêà\Computer Graphic\Source Computer Graphics\KG_Main.c:11: error: stray '\148' in program

Execution terminated

And this is what I did.

My Dev-cpp folder is in C as it must be. I created a folder "CPP_Programs" in it where I put my projects and treir files used by the program as someone here suggested.
I created a new project and added the file to it. Then I selected the file and entered alt+p. Went to Parameters tab and entered in the linkers field exactly this:

-lbgi
-lgdi32
-lcomdlg32
-luuid
-loleaut32
-lole32
-L "C:/Dev-Cpp/lib"
-L "C:/Dev-Cpp/include"

And it was just ok as the compiler log said :

Compiler: Default compiler
Building Makefile: "C:\Dev-Cpp\CPP_Programs\Makefile.win"
Executing make...
make.exe -f "C:\Dev-Cpp\CPP_Programs\Makefile.win" all
g++.exe -c "hello world.cpp" -o "hello world.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"

g++.exe "hello world.o" -o "hello_world.exe" -L"C:/Dev-Cpp/lib" -lbgi -lgdi32 -lcomdlg32 -luuid -loleaut32 -lole32 -L "C:/Dev-Cpp/lib" -L "C:/Dev-Cpp/include"

Execution terminated
Compilation successful

I believe this will be helpful.
Decided to share it with you as your topic helped me to figured it out as well as my colleage's help. Thank God!

i had a similar problem when trying to compile my project saved on an external hard drive connected to on my home pc (Dev cpp is installed on an XP Virtual machine inside Windows 7 on home pc).

All that need to be done was to map a dive from XP Virtual Machine to the appropriate folder on the external hard driveas follows:

In XP
-----
Right click Start button > Explore > Tools > Map Network Drive > Browse ...... browse to appropriate folder on external hard drive.

In DevC:
--------
Open project , click on MyComputer icon, click on the mapped drive letter , navigate to project folder, click on project file, click OK ...

Compile
Should be ok.

I am facing the same problem. I am using Dev C++ on Windows 2000. I created a project in which there are 2 cpp source files and 2 header files. All files are individually getting compiled successfully. But when I try to compile the whole project, it gives the following error.

Compiler: Default compiler
Building Makefile: "C:\Dev-Cpp\Makefile.win"
Executing make...
make.exe -f "C:\Dev-Cpp\Makefile.win" all
g++.exe Aadhaar/uid_auth.o Aadhaar/aadhaar.o -o "Aadhaar_Proj.exe" -L"C:/Dev-Cpp/lib" "../Borland/libxml library/lib/libxml2.a" "../Borland/libxml library/lib/libxml2.dll.a" "../Borland/libxml library/lib/libxml2.lib" "../Borland/libxml library/lib/libxml2-bcc.lib" ../Borland/BCC55/Include/openssl_lib/lib/libssl.a ../Borland/BCC55/Include/openssl_lib/lib/libcrypto.a ../Borland/BCC55/Include/openssl_lib/lib/libeay32.dll.a ../Borland/BCC55/Include/openssl_lib/lib/libssl32.dll.a

../Borland/libxml library/lib/libxml2-bcc.lib: file not recognized: File format not recognized
collect2: ld returned 1 exit status

make.exe: *** [Aadhaar_Proj.exe] Error 1

Execution terminated

The ".a" files are there on the specified path. I am not getting the meaning of "file not recognized: file format not recognized"

Please help me to solve this problem.
Thanks.

./Borland/libxml library/lib/libxml2-bcc.lib: file not recognized: File format not recognized

that error is referring to libxml2-bcc.lib. gcc and g++ do not recognize libraries wth *.lib file extension, only *.a file extension. That library was built for a different compiler.

Thanks for the reply Ancient Dragon. I am not able to run even a simple program with libxml2. Can you/anybody please tell me how to run a cpp program with libxml2 included? And where to copy the libxml2 files(*.a) while using DevC++?
Thanks

C:\Users\Desktop\q2\Makefile.win [Build Error] [Agent_private.res] Error 1

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.