I am executing a simple makefile that contait 3 parts but it does not work well these are details of my files .h and .c:
-
main.c
#include <stdio.h> #include <stdlib.h> #include "hello.h" int main (void) { hello(); return EXIT_SUCCESS; } -
hello.h
#ifndef hello #define hello void hello (void); #endif -
hello.c
#include <stdio.h> #include <stdlib.h> void hello (void) { printf("Hello Worldn"); } -
makefile
all: hello hello: hello.o main.o gcc -o hello hello.o main.o hello.o: hello.c gcc -o hello.o -c hello.c -W -Wall -ansi -pedantic main.o: main.c hello.h gcc -o main.o -c main.c -W -Wall -ansi -pedantic clean: rm -rf *.o mrproper: clean rm -rf hello
I get this error:
Donald Duck
8,08922 gold badges74 silver badges93 bronze badges
asked Oct 14, 2016 at 20:29
1
When you write #define hello you define hello to be an empty token. Thus the function declaration on the next string effectively becomes this:
void (void);
which is not valid C code.
What you are trying to do is probably the Include guard, its purpose is to avoid multiple inclusion of one header. The name of the guard have to differ from any other token you use. Usual naming is FILENAME_H:
#ifndef HELLO_H
#define HELLO_H
void hello(void);
#endif
answered Oct 14, 2016 at 20:38
Ivan SmirnovIvan Smirnov
4,21318 silver badges29 bronze badges
1
In hello.h, line 2 you are defining ‘hello’ as an empty token. Remove that line.
answered Oct 14, 2016 at 20:34
josuegomesjosuegomes
4494 silver badges13 bronze badges
2
17 Years Ago
Hi again everyone, 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…I am interested in working with Windows Programming in C/C++ at the moment and every project I try to compile gives the same error…
C:Dev-CppCurrent_ProjectMakefile.win [Build Error] [main.o] Error 1
and this is my compile log
Compiler: Default compiler
Building Makefile: "C:Dev-CppCurrent_ProjectMakefile.win"
Executing make...
make.exe -f "C:Dev-CppCurrent_ProjectMakefile.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
I have tried many times re-installing the program aswell as re-configuring it and installing with fresh configurations etc…nothing seems to work, I get the same error over and over again…anyone know why or how to overcome it ?
Recommended Answers
What is the code in main.cpp, and where is main.cpp located?
Jump to Post
Hi again…I have found out how to compile and link my program, I can only do it step by step using the command line but it works like that…however Im getting lots of error messages like these…
Main.o(.text+0x28d):Main.c: undefined reference to 'GetStockObject@4' Main.o(.text+0x311):Main.c: undefined reference to 'GetOpenFilename@4'Im sure …
Jump to Post
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 …
Jump to Post
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 …
Jump to Post
./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.
Jump to Post
All 45 Replies
Ancient Dragon
5,243
Achieved Level 70
Team Colleague
Featured Poster
17 Years Ago
might be a dumb question — but did you check your computer to see if those -I<path> paths actually exist?
17 Years Ago
Is C:Dev-Cppbin in your path?
C:TestGnuC>path
PATH=C:WINNTsystem32;C:WINNT;C:WINNTSystem32Wbem;C;iccbin;C:Dev-Cppbin;C:BC5BIN;C:watcomBINNT;C:watcomBINW;c:Perlbin;C:Program FilesActiveState Komodo 3.1;C:Program FilesCommon FilesGTK2.0bin;C:Program FilesCommon FilesAutodesk Shared;C:Program FilesAutodeskDWG TrueView;..tool;C:Program Filesdoxygenbin;C:Program FilesSubversionbin;C:Program FilesMicrosoft Visual StudioCommonToolsWinNT;C:Program FilesMicrosoft Visual StudioCommonMSDev98Bin;C:Program FilesMicrosoft Visual StudioCommonTools;C:Program FilesMicrosoft Visual StudioVC98bin;C:Program FilesMicrosoft Visual StudioCommonIDEIDE98;C:Program Filesvslickwin;C:NECTOOLSBIN;..tool;C:COSMICEVAL08;c:nectools32bin;
bops
1
Posting Whiz in Training
17 Years Ago
Yes I have checked all of the paths and they all exist…this even happens when I compile a project from scratch..ie…
C:Dev-CppNew_ProjectMakefile.win [Build Error] [main.o] Error 1
Compiler: Default compiler
Building Makefile: "C:Dev-CppNew_ProjectMakefile.win"
Executing make...
make.exe -f "C:Dev-CppNew_ProjectMakefile.win" all
gcc.exe -c main.c -o main.o -I"C:/Dev-Cpp/include"
The system cannot find the path specified.
make.exe: *** [main.o] Error 1
Execution terminated
Dave what do you mean by is C:Dev-Cppbin in my path ? and what is all of that within the code box? I thought it may have come from command prompt or something like that so i tried typing…
C:>path
PATH=C:WINDOWSsystem32;C:WINDOWS;C:WINDOWSSystem32Wbem
C:>
I dont have a clue what any of that is for, could you explain it? thanks.
Edited
10 Years Ago
by diafol because:
fixed formatting
17 Years Ago
I’m asking you what I think your make utility is asking you. Does it know where to look for g++?
The stuff in the box is a copy of my result when I execute the path command in a command shell. It is telling me that the path to g++ is indeed available to my system. Yours tells you this is not so.
When you install Dev-Cpp, do you need to reboot to update the path? (It’s been so long since I’ve done this that I forget.)
Ancient Dragon
5,243
Achieved Level 70
Team Colleague
Featured Poster
17 Years Ago
>>When you install Dev-Cpp, do you need to reboot to update the path?
I think it depends on which version of Windows is running. W2K/XP, definitely not. Win95/98/ME, I’m not sure either (I never used ME)
bops
1
Posting Whiz in Training
17 Years Ago
Oh right…Im running windows xp professional with sp1, im never prompted to reboot or anything like that, it has always worked perfect until now, im continuously getting these errors…yes g++.exe is in the c:Dev-Cppbin directory…do you have any suggestions on what i should do?
17 Years Ago
Add c:Dev-Cppbin to your path. Reboot.
(But it does appear to find the make utility, which I would assume is in the same directory, so I’m reaching for straws.)
Ancient Dragon
5,243
Achieved Level 70
Team Colleague
Featured Poster
17 Years Ago
Add c:Dev-Cppbin to your path. Reboot.
(But it does appear to find the make utility, which I would assume is in the same directory, so I’m reaching for straws.)
I use XP Pro too.
you might also check the length of the PATH environment variable. On my computer it’s so long that there isn’t any room left to add more. So I have a batch file to truncate the PATH to bare necessity so that I can run other command-line programs from command prompt.
Look at the end of the PATH as shown in command prompt — if the last path isn’t all there, then you probably have to same problem that I do.
dwks
149
Posting Whiz in Training
17 Years Ago
you might also check the length of the PATH environment variable. On my computer it’s so long that there isn’t any room left to add more. So I have a batch file to truncate the PATH to bare necessity so that I can run other command-line programs from command prompt.
You can change this. I’ve forgotten how I did it, but I ran into the same problem. Increasing the enviroment size fixed it.
I think it’s a parameter to command.com in config.sys.
Ancient Dragon
5,243
Achieved Level 70
Team Colleague
Featured Poster
17 Years Ago
bops
1
Posting Whiz in Training
17 Years Ago
Ah ok I will try to do that in a few moments once I find out how lol…but why isnt there lots of other .exe files (or directories) listed in path, I have many other applications installed…
bops
1
Posting Whiz in Training
17 Years Ago
That didnt work, but I dont think I did it correctly…how would i add that to path ?
17 Years Ago
I generally right-click My Computer, and select Properties to bring up the System Properties dialog. In the Advanced tab, click the Environment Variables… button. Then find the path variable and edit it. Alternatively, I think you can add it to the autoexec.bat which should be in the root directory.
You’ll know you’ve done it correctly when you go to a command shell and type path, like you did earlier, and it now shows the d:dev-cppbin as being part of the path.
bops
1
Posting Whiz in Training
17 Years Ago
Thanks, I have did that, It has been added to path successfully but Dev-C++ still doesnt work. I have rebooted as soon as i added C:Dev-Cppbin; to path but the error is still the same…any mroe suggestions ?
17 Years Ago
What is the code in main.cpp, and where is main.cpp located?
bops
1
Posting Whiz in Training
17 Years Ago
This happens every single time i try to compile any project whether it would be a template given by Dev-C++ when creating a windows application or something I have been working on…I save all the files like the source, resource, header and all the files created by the compiler in the same directory, «C:Dev-Cpp» from which I create a another directory depending on what Im creating for example «C:Dev-CppNew_Project» is where I have saved all the files of a brand new project…and here is what main.cpp contains…
#include <windows.h>
/* Declare Windows procedure */
LRESULT CALLBACK WindowProcedure (HWND, UINT, WPARAM, LPARAM);
/* Make the class name into a global variable */
char szClassName[ ] = "WindowsApp";
int WINAPI WinMain (HINSTANCE hThisInstance,
HINSTANCE hPrevInstance,
LPSTR lpszArgument,
int nFunsterStil)
{
HWND hwnd; /* This is the handle for our window */
MSG messages; /* Here messages to the application are saved */
WNDCLASSEX wincl; /* Data structure for the windowclass */
/* The Window structure */
wincl.hInstance = hThisInstance;
wincl.lpszClassName = szClassName;
wincl.lpfnWndProc = WindowProcedure; /* This function is called by windows */
wincl.style = CS_DBLCLKS; /* Catch double-clicks */
wincl.cbSize = sizeof (WNDCLASSEX);
/* Use default icon and mouse-pointer */
wincl.hIcon = LoadIcon (NULL, IDI_APPLICATION);
wincl.hIconSm = LoadIcon (NULL, IDI_APPLICATION);
wincl.hCursor = LoadCursor (NULL, IDC_ARROW);
wincl.lpszMenuName = NULL; /* No menu */
wincl.cbClsExtra = 0; /* No extra bytes after the window class */
wincl.cbWndExtra = 0; /* structure or the window instance */
/* Use Windows's default color as the background of the window */
wincl.hbrBackground = (HBRUSH) COLOR_BACKGROUND;
/* Register the window class, and if it fails quit the program */
if (!RegisterClassEx (&wincl))
return 0;
/* The class is registered, let's create the program*/
hwnd = CreateWindowEx (
0, /* Extended possibilites for variation */
szClassName, /* Classname */
"Windows App", /* Title Text */
WS_OVERLAPPEDWINDOW, /* default window */
CW_USEDEFAULT, /* Windows decides the position */
CW_USEDEFAULT, /* where the window ends up on the screen */
544, /* The programs width */
375, /* and height in pixels */
HWND_DESKTOP, /* The window is a child-window to desktop */
NULL, /* No menu */
hThisInstance, /* Program Instance handler */
NULL /* No Window Creation data */
);
/* Make the window visible on the screen */
ShowWindow (hwnd, nFunsterStil);
/* Run the message loop. It will run until GetMessage() returns 0 */
while (GetMessage (&messages, NULL, 0, 0))
{
/* Translate virtual-key messages into character messages */
TranslateMessage(&messages);
/* Send message to WindowProcedure */
DispatchMessage(&messages);
}
/* The program return-value is 0 - The value that PostQuitMessage() gave */
return messages.wParam;
}
/* This function is called by the Windows function DispatchMessage() */
LRESULT CALLBACK WindowProcedure (HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
{
switch (message) /* handle the messages */
{
case WM_DESTROY:
PostQuitMessage (0); /* send a WM_QUIT to the message queue */
break;
default: /* for messages that we don't deal with */
return DefWindowProc (hwnd, message, wParam, lParam);
}
return 0;
}
17 Years Ago
Have you tried compiling using the command-line?
bops
1
Posting Whiz in Training
17 Years Ago
yes I have tried that, it doesnt work.
17 Years Ago
I save all the files like the source, resource, header and all the files created by the compiler in the same directory, «C:Dev-Cpp» from which I create a another directory depending on what Im creating for example «C:Dev-CppNew_Project» is where I have saved all the files of a brand new project…and here is what main.cpp contains…
So you’re saying that you are saving main.cpp in the compiler’s home directory «C:Dev-Cpp»? First, that a practice I generally avoid. Though I doubt it’s the problem here.
It looks to me that the make utility is not finding the source file. Could you post your makefile and .dev file? And state which directory these are in? And am I correct in understanding that you have main.cpp saved in «C:Dev-Cpp»?
kon_t
0
Newbie Poster
17 Years Ago
Thanks, I have did that, It has been added to path successfully but Dev-C++ still doesnt work. I have rebooted as soon as i added C:Dev-Cppbin; to path but the error is still the same…any mroe suggestions ?
you definitely have a config problem. Your path is wrong &/or dev c++ isnt installed correctly.
some of the following has already been suggested, but ill put it here for completeness anyway.
1st start up a cmd prompt box (click on start, then run & then type ‘cmd’ in the text box).
from the cmd prompt box:
You can test the path setting by just typing ‘g++’. If the path is correct you will see something like:
g++: no input files
you can also try typing ‘make’, which should produce:
make: *** No targets specified and no makefile found. Stop.
If neither work, your path setting is definitely wrong.
If one works & not the other, you have a mixed up configuration.
You can try searching for «g++» and make sure that the folder that it is actually in is alos the folder in the path setting.
bops
1
Posting Whiz in Training
17 Years Ago
I have carried out both of those commands in command prompt, and they both produced what expected…
To keep things simple I will attempt to make another windows project and compile it on the root («C:»), I will post the makefile(*.win) and project file(*.dev) here…..
Project file…
[Project]
FileName=Project1.dev
Name=Project1
UnitCount=1
Type=0
Ver=1
ObjFiles=
Includes=
Libs=
PrivateResource=
ResourceIncludes=
MakeIncludes=
Compiler=
CppCompiler=
Linker=
IsCpp=1
Icon=
ExeOutput=
ObjectOutput=
OverrideOutput=0
OverrideOutputName=
HostApplication=
Folders=
CommandLine=
UseCustomMakefile=0
CustomMakefile=
IncludeVersionInfo=0
SupportXPThemes=0
CompilerSet=0
CompilerSettings=
[Unit1]
FileName=main.cpp
CompileCpp=1
Folder=
Compile=1
Link=1
Priority=1000
OverrideBuildCmd=0
BuildCmd=
[VersionInfo]
Major=0
Minor=1
Release=1
Build=1
LanguageID=1033
CharsetID=1252
CompanyName=
FileVersion=
FileDescription=Developed using the Dev-C++ IDE
InternalName=
LegalCopyright=
LegalTrademarks=
OriginalFilename=
ProductName=
ProductVersion=
AutoIncBuildNr=0
Makefile…
# Project: Project1
# Makefile created by Dev-C++ 4.9.9.2
CPP = g++.exe
CC = gcc.exe
WINDRES = windres.exe
RES =
OBJ = main.o $(RES)
LINKOBJ = main.o $(RES)
LIBS = -L"C:/Dev-Cpp/lib" -mwindows
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 = Project1.exe
CXXFLAGS = $(CXXINCS)
CFLAGS = $(INCS)
RM = rm -f
.PHONY: all all-before all-after clean clean-custom
all: all-before Project1.exe all-after
clean: clean-custom
${RM} $(OBJ) $(BIN)
$(BIN): $(OBJ)
$(CPP) $(LINKOBJ) -o "Project1.exe" $(LIBS)
main.o: main.cpp
$(CPP) -c main.cpp -o main.o $(CXXFLAGS)
As you can see this contains only the source file, and still produces the same error.
17 Years Ago
So is your main.cpp file in the same directoty as the .dev file and the make file?
bops
1
Posting Whiz in Training
17 Years Ago
Yes all of the files that have something to do with the project are stored in the same directory..source, resource, header, object, makefile, project, icons (this brand new project in C: only has a project file and source file and the makefile that is created..)
bops
1
Posting Whiz in Training
17 Years Ago
Do you have any idea about the problem or could you recommend me to try somewhere else please? I have tried on the IRC channel but the 2 people who ever replied didnt know and I did not get a solution ont he bloodshed forum…If not can you recommend any more free compilers that I could try to use?…Thanks for your help.
bops
1
Posting Whiz in Training
17 Years Ago
Ok, thanks a lot for all of your help on this…I will try something new, I will post back if I ever solve the problem..
bops
1
Posting Whiz in Training
17 Years Ago
Hi again…I have found out how to compile and link my program, I can only do it step by step using the command line but it works like that…however Im getting lots of error messages like these…
Main.o(.text+0x28d):Main.c: undefined reference to 'GetStockObject@4'
Main.o(.text+0x311):Main.c: undefined reference to 'GetOpenFilename@4'
Im sure I have had these before when actually using the IDE…but I cant remember how to correct them…do you know how ? (these functions are within libraries that require me only to include windows.h I think…which I have)
17 Years Ago
Hi again everyone, 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…I am interested in working with Windows Programming in C/C++ at the moment and every project I try to compile gives the same error…
C:Dev-CppCurrent_ProjectMakefile.win [Build Error] [main.o] Error 1and this is my compile log
Compiler: Default compiler Building Makefile: "C:Dev-CppCurrent_ProjectMakefile.win" Executing make... make.exe -f "C:Dev-CppCurrent_ProjectMakefile.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 terminatedI have tried many times re-installing the program aswell as re-configuring it and installing with fresh configurations etc…nothing seems to work, I get the same error over and over again…anyone know why or how to overcome it ?
I was getting this EXACT same error, and i fixed it by renaming my initial file from test to test.cpp (duuhh) and moving the project into a different folder Dev-Cppprojects
In my case it seems it was just the stupppid mistake of creating the new file and not renaming it properly.
cheers 
WolfPack
491
Posting Virtuoso
Team Colleague
17 Years Ago
Hi again…I have found out how to compile and link my program, I can only do it step by step using the command line but it works like that…however Im getting lots of error messages like these…
Main.o(.text+0x28d):Main.c: undefined reference to 'GetStockObject@4' Main.o(.text+0x311):Main.c: undefined reference to 'GetOpenFilename@4'Im sure I have had these before when actually using the IDE…but I cant remember how to correct them…do you know how ? (these functions are within libraries that require me only to include windows.h I think…which I have)
I dont use dev-cpp, only MSVC++. Including windows.h is okay for compilation, but you should specifythe required libraries when you link them in the command prompt. For the MSVC I use something like cl main.cpp /link user32.lib gdi32.lib You would need to do something like that in dev-cpp also.
Reply to this topic
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.
-
Summary
-
Files
-
Reviews
-
Support
-
Wiki
-
Mailing Lists
-
Code
-
Tickets ▾
- Feature Requests
- Bugs
- Patches
-
News
-
Discussion
Menu
▾
▴
make.exe: *** [main.o] Error 1 ? =)
Created:
2006-11-19
Updated:
2012-09-26
-
Both computers have the same dev-c++ versions 4.9.9.2,
Both are identical (99%) Installs…Computer 1 will not complile, computer 2 compiles and works as it should =)
Please help, i’ve searched wide and far and this problem is beyond my ability.CPU 1: Win XP Pro, Service pack 2
CPU 2: Win XP Pro(no service pack)— Compile Logs —
Computer #1 (half works…I compile, it shows error, but still allows me to «run» it)Compiler: Default compiler
Building Makefile: «C:Dev-CppSelfMakefile.win»
Executing make clean
rm -f main.o Project1.exeg++.exe -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»
make.exe: *** [main.o] Error 1
Execution terminated
Computer #2 (works)
Compiler: Default compiler
Building Makefile: «C:Dev-CppSelfProject1Makefile.win»
Executing make clean
rm -f main.o Project1.exeg++.exe -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»
g++.exe main.o -o «Project1.exe» -L»C:/Dev-Cpp/lib»
Execution terminated
Compilation successful-
>> Not quite. Many users, including myself, use the browse option for lib files.
But his log shows that he is not linking any additional libraries. Invalid paths would be ignored, missing paths would on the errors you have in your example — the OP has no such errors. I suggest that responses should be based on the evidence presented and when personal experience is used, the evidence should be checked to deterimine of teh situation is in fact the same.
Nonetheless the OP really should have made the build environment the same in both cases for the prurposes of comparison — if only to avoid any doubt.
-
He first posted this:
Computer #1 (half works…I compile, it shows error, but still allows me to «run» it)So you are saying that you tested this by copying your projects folder(which resided outside the DevC++ folder) into your DevC++ folder and you also experienced eratic problems just like this.
-
I am saying that a number of people have reported this problem, and found that moving the project solves teh problem. I was sceptical until I created a project myself under Dev-C++ and had the same problem, but it does not seem to happen in all circumstances, some people seem to get away with it.
It is not a matter of moving a project, the act of creating the project their causes the problem.
The symptoms being an «Error 1» from make.exe but no apparent error from any commands invoked by make.exe — make issues «Error 1» when a command it executes returns a non-zero error level, so you normally expect to see some other message from the command executed. Here the compilation of main.cpp is shown but issues no error, then make terminated with «Error 1».
Clifford
-
A basic rule with this IDE is to not have your projects reside within the DevC++ directory. Put your projects in another directory outside of the IDE’s directory, one WITHOUT any whitespaces.
error 1 usually means a file needed for the compilation cannot be found(lib, ect)
If you started a project here: C:Dev-CppSelfProject1
and then copied the same project to here: C:Dev-CppSelf
then the paths are out of whack for the project.So, create the myProjects directory as above, and start a new project. If you use an empty project, you will have to link to the needed libs manually. When you get a project all linked up the way you like, create a template of that project for future use.
-
The previous post is correct. It is a mystery to me why, but recently we have seen a number of reports where projects placed in subfolders of the Dev-C++ install folder fail. I have even reproduced the error myself. Moving the project to say c:devprojectsSelf for example seems to solve the problem.
The fact that you have it working on a system without an SP may provide a clue to the problem — perhaps some MS update. Nonetheless I would suggest that an SP free installation is vulnerable if connected to the Internet and reccommend that you update it.
I would also suggest that even without the bug, the Dev install folder is not a good place to keep projects — just in case you ever need to delete and reinstall.
Clifford
-
«The fact that you have it working on a system without an SP may provide a clue to the problem»
SP version had no effect on the problem:
he used the path <C:Dev-CppSelf> on one computer,
and then used the same project in <C:Dev-CppSelfProject1> on the other.Doing this sort of thing causes the same problem on all my computers — one is updated, the other is not.
The damage can always be repaired in the project options, but I did not want to get into that with the original poster.
-
Your analysis is flawed, Dev-C++ project files use relative paths, so projects may be moved between paths so long as the relationship between the .dev file and the sources is maintained.
It may therefore be related to the location only, but not specifically ‘any’ folder under Dev-C++. This would concurr with my experience and user reports, since I have had some projects fail, and others succeed when placed under c:dev-c++.
Clifford
-
«Your analysis is flawed»
Not quite. Many users, including myself, use the browse option for lib files. If you manually browse for a library file in the linker page within project settings, and then move the .dev and the source with it, you will have to change those linking paths. If you have have manually set the paths to the include folders/libs, those will have to be repaired also — aka «delete invalid».
This is what happened when I moved the project I just compiled up one folder in it’s path:
Compiler: Default compiler
Building Makefile: «D:DeveloperDevC++EditorMakefile.win»
Executing make clean
rm -f Object/allwindows.o Object/main.o Object/map.o Object/glDraw.o Object/initialize.o Object/procedure.o Object/camera.o Object/glFonts.o Object/glConfig.o Object/glRefresh.o Object/timerHiRes.o Object/selection.o Object/coords.o Object/win32Font.o Object/assets.o Object/glExtension.o Object/glShader.o Object/debug.o Object/selectionMove.o Object/mouse.o Object/actor.o Object/libraries.o Object/glTnails.o Object/keyboard.o Object/EditorII_private.res Editor.exe//Omitted for breverity
g++.exe -DDEBUG Object/allwindows.o Object/main.o Object/map.o Object/glDraw.o Object/initialize.o Object/procedure.o Object/camera.o Object/glFonts.o Object/glConfig.o Object/glRefresh.o Object/timerHiRes.o Object/selection.o Object/coords.o Object/win32Font.o Object/assets.o Object/glExtension.o Object/glShader.o Object/debug.o Object/selectionMove.o Object/mouse.o Object/actor.o Object/libraries.o Object/glTnails.o Object/keyboard.o Object/EditorII_private.res -o «Editor.exe» -L»D:/Developer/Tools/Dev-Cpp/lib» -L»D:/Developer/Tools/Dev-Cpp/lib/» -mwindows LeanMath.a libTextures.a ../../../Tools/Dev-Cpp/lib/libopengl32.a ../../../Tools/Dev-Cpp/lib/libglu32.a ../../../Tools/Dev-Cpp/lib/libcomctl32.a -Wl,-Map,./Text/MemoryMap.map -g3 -fmessage-length=0
g++.exe: ../../../Tools/Dev-Cpp/lib/libopengl32.a: No such file or directory
g++.exe: ../../../Tools/Dev-Cpp/lib/libglu32.a: No such file or directory
g++.exe: ../../../Tools/Dev-Cpp/lib/libcomctl32.a: No such file or directorymake.exe: *** [Editor.exe] Error 1
Execution terminated
About clues to the IDE’s directory woes:
I use this ide quite a bit. An odd thing I have noticed — many times I will find an empty copy of a project’s root folder in various locations. I did not create these empty copies! The location varies and can be anywhere in the devC++ tree, other times in the folder tree where I keep my devC++ projects. Another odd thing is this — I like to copy/paste my current project to another partition on the same computer, and also to another computer. I do this quite often. Many times when I copy the projects folder, I cannot paste because windows will not allow it. When this occurs, simply deleting any file(.h, .txt, .tga, ect..) within the projects tree will allow me to copy/paste the project’s folder all of the sudden. These two «odd things» seem to occur when I have used the browsing option for linking/including files, but I can’t really say for sure. I am sure these two «odd thangs», and the other directory problems known to the ide are related.Michael
Log in to post a comment.
Dev-C++ — не хочет компилять
- Подписаться на тему
- Сообщить другу
- Скачать/распечатать тему
|
|
|
|
Full Member Рейтинг (т): 2 |
Dev-C++ Совершенно не хочет компилить никакие проекты. «F:DOCUME~1Smoke» ¥ ï¥âáï ¢ãâ॥© ¨«¨ ¢¥è¥© make.exe: *** [main.o] Error 1 Execution terminated и так всегда Вроде бы все настроил, все фолдеры указал, а он все равно упирается. Мож где че позабыл? |
|
nnn |
|
|
Ты бы код проекта полностью привел… |
|
Zmoukie |
|
|
Full Member Рейтинг (т): 2 |
версия — Dev-C++ 4.9.8.0. <br>#include <windows.h><br><br>/* Declare Windows procedure */<br>LRESULT CALLBACK WindowProcedure (HWND, UINT, WPARAM, LPARAM);<br><br>/* Make the class name into a global variable */<br>char szClassName[ ] = «WindowsApp»;<br><br>int WINAPI WinMain (HINSTANCE hThisInstance,<br> HINSTANCE hPrevInstance,<br> LPSTR lpszArgument,<br> int nFunsterStil)<br><br>{<br> HWND hwnd; /* This is the handle for our window */<br> MSG messages; /* Here messages to the application are saved */<br> WNDCLASSEX wincl; /* Data structure for the windowclass */<br><br> /* The Window structure */<br> wincl.hInstance = hThisInstance;<br> wincl.lpszClassName = szClassName;<br> wincl.lpfnWndProc = WindowProcedure; /* This function is called by windows */<br> wincl.style = CS_DBLCLKS; /* Catch double-clicks */<br> wincl.cbSize = sizeof (WNDCLASSEX);<br><br> /* Use default icon and mouse-pointer */<br> wincl.hIcon = LoadIcon (NULL, IDI_APPLICATION);<br> wincl.hIconSm = LoadIcon (NULL, IDI_APPLICATION);<br> wincl.hCursor = LoadCursor (NULL, IDC_ARROW);<br> wincl.lpszMenuName = NULL; /* No menu */<br> wincl.cbClsExtra = 0; /* No extra bytes after the window class */<br> wincl.cbWndExtra = 0; /* structure or the window instance */<br> /* Use Windows’s default color as the background of the window */<br> wincl.hbrBackground = (HBRUSH) COLOR_BACKGROUND;<br><br> /* Register the window class, and if it fails quit the program */<br> if (!RegisterClassEx (&wincl))<br> return 0;<br><br> /* The class is registered, let’s create the program*/<br> hwnd = CreateWindowEx (<br> 0, /* Extended possibilites for variation */<br> szClassName, /* Classname */<br> «Windows App», /* Title Text */<br> WS_OVERLAPPEDWINDOW, /* default window */<br> CW_USEDEFAULT, /* Windows decides the position */<br> CW_USEDEFAULT, /* where the window ends up on the screen */<br> 544, /* The programs width */<br> 375, /* and height in pixels */<br> HWND_DESKTOP, /* The window is a child-window to desktop */<br> NULL, /* No menu */<br> hThisInstance, /* Program Instance handler */<br> NULL /* No Window Creation data */<br> );<br><br> /* Make the window visible on the screen */<br> ShowWindow (hwnd, nFunsterStil);<br><br> /* Run the message loop. It will run until GetMessage() returns 0 */<br> while (GetMessage (&messages, NULL, 0, 0))<br> {<br> /* Translate virtual-key messages into character messages */<br> TranslateMessage(&messages);<br> /* Send message to WindowProcedure */<br> DispatchMessage(&messages);<br> }<br><br> /* The program return-value is 0 — The value that PostQuitMessage() gave */<br> return messages.wParam;<br>}<br><br><br>/* This function is called by the Windows function DispatchMessage() */<br><br>LRESULT CALLBACK WindowProcedure (HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)<br>{<br> switch (message) /* handle the messages */<br> {<br> case WM_DESTROY:<br> PostQuitMessage (0); /* send a WM_QUIT to the message queue */<br> break;<br> default: /* for messages that we don’t deal with */<br> return DefWindowProc (hwnd, message, wParam, lParam);<br> }<br><br> return 0;<br>}<br> в закладке compiler пишет «f:dev-cppprojectsproject1makefile.win [buils error] [main.o] Error1» меня тревожит этот «main.o» — что это за файл и че там должно быть? |
|
nnn |
|
|
main.o — объектный файл, генерируемый компилятором, потом он линкуется в твоем случае в экзешник… |
|
Zmoukie |
|
|
Full Member Рейтинг (т): 2 |
все включено (include in compilation, include in linking). |
|
Zmoukie |
|
|
Full Member Рейтинг (т): 2 |
что самое удивительное — 4ый devcpp работает без проблем! |
|
nnn |
|
|
Да. без проблем… |
|
nnn |
|
|
Могу тебе заслать готовый проект под Dev-Cpp |
|
Zmoukie |
|
|
Full Member Рейтинг (т): 2 |
Все прописал, та же фигня. четвертый работает на ура, а пятый не хочет. Сообщение отредактировано: Smoke — 10.06.03, 10:27 |
|
Zmoukie |
|
|
Full Member Рейтинг (т): 2 |
Ха! если создавать не проект, а просто отдельный цпп-файл, то все компилится! Бредятина какая-то ??? |
ElcnU |
|
|
Moderator Рейтинг (т): 823 |
! уже не актуально. |
0 пользователей читают эту тему (0 гостей и 0 скрытых пользователей)
0 пользователей:
- Предыдущая тема
- Visual C++ / MFC / WTL
- Следующая тема
[ Script execution time: 0,0389 ] [ 16 queries used ] [ Generated: 9.02.23, 21:21 GMT ]
OS: POP OS
Architecture: x64
Update Status: Executed sudo apt update and upgrade beforehand.
I tried installing this, but got the following error while executing make
gcc -I. -I. -I./tgl -g -O2 -I/usr/local/include -I/usr/include -I/usr/include -I/usr/include/lua5.2 -DHAVE_CONFIG_H -Wall -Werror -Wextra -Wno-missing-field-initializers -Wno-deprecated-declarations -fno-strict-aliasing -fno-omit-frame-pointer -ggdb -Wno-unused-parameter -fPIC -c -MP -MD -MF dep/main.d -MQ objs/main.o -o objs/main.o main.c
main.c: In function ‘termination_signal_handler’:
main.c:824:7: error: ‘write’ reading 18 bytes from a region of size 17 [-Werror=stringop-overflow=]
824 | if (write (1, "SIGNAL receivedn", 18) < 0) {
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from main.c:29:
/usr/include/unistd.h:367:16: note: in a call to function ‘write’ declared with attribute ‘read_only (2, 3)’
367 | extern ssize_t write (int __fd, const void *__buf, size_t __n) __wur
| ^~~~~
cc1: all warnings being treated as errors
make: *** [Makefile:48: objs/main.o] Error 1
One thing of interest is that installtion of libpython-dev failed (probably as dev packages were being merged into python3).
Things already tried: Even though libpython2-dev was available, installing it did not help. Executing ./configure -disable—python gave the following error
`checking for gcc... gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables...
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
checking for library containing clock_gettime... none required
checking for library containing backtrace... none required
checking for event_base_new in -levent... yes
checking how to run the C preprocessor... gcc -E
checking for grep that handles long lines and -e... /usr/bin/grep
checking for egrep... /usr/bin/grep -E
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking event2/event.h usability... yes
checking event2/event.h presence... yes
checking for event2/event.h... yes
checking for pkg-config... /usr/bin/pkg-config
checking whether compiling and linking against OpenSSL works... yes
checking if zlib is wanted... yes
checking for inflateEnd in -lz... yes
checking zlib.h usability... yes
checking zlib.h presence... yes
checking for zlib.h... yes
checking for rl_save_prompt in -lreadline... yes
checking for libconfig... enabled
checking for config_init in -lconfig... yes
checking for liblua... enabled
checking for lua... /usr/bin/lua
checking if /usr/bin/lua is a Lua interpreter... yes
checking for lua version... 5.2
checking for lua platform... unknown
checking for lua script directory... ${prefix}/share/lua/5.2
checking for lua module directory... ${exec_prefix}/lib/lua/5.2
checking if LUA_VERSION is defined... yes
checking lua.h usability... no
checking lua.h presence... no
checking for lua.h... no
checking lualib.h usability... no
checking lualib.h presence... no
checking for lualib.h... no
checking lauxlib.h usability... no
checking lauxlib.h presence... no
checking for lauxlib.h... no
checking luaconf.h usability... no
checking luaconf.h presence... no
checking for luaconf.h... no
checking for Lua headers in... /usr/include/lua5.2
checking lua.h usability... yes
checking lua.h presence... yes
checking for lua.h... yes
checking lualib.h usability... yes
checking lualib.h presence... yes
checking for lualib.h... yes
checking lauxlib.h usability... yes
checking lauxlib.h presence... yes
checking for lauxlib.h... yes
checking luaconf.h usability... yes
checking luaconf.h presence... yes
checking for luaconf.h... yes
checking for Lua header version... 5.2
checking if Lua header version matches 5.2... yes
checking if LUA_VERSION is defined... yes
checking for library containing exp... -lm
checking for library containing dlopen... -ldl
checking for library containing lua_load... -llua5.2
checking for python... enabled
checking for python build information...
checking for python3.5... no
checking for python3.4... no
checking for python3.3... no
checking for python3.2... no
checking for python3.1... no
checking for python3... python3
checking for main in -lpython3... no
checking for main in -lpython3m... no
checking for main in -lpython3mu... no
checking for python2.7... no
checking for python2.6... no
checking for python2... no
checking for python... no
results of the Python check:
Binary: no
Library: no
Include Dir: no
configure: error: No supported python lib version found. Try --disable-python
`
(recursive?:))
Also tried searching for the issue online but couldn’t find any solution
Proposed fix- Most probably the issue is occurring due to non-existance of libpython-dev. In that case either mention another way of libpython-dev in instructions or better yet, replace the dependency altogether as it seems that it is now outdated.
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-CppBin
C:Dev-Cpplibexecgccmingw323.4.2
See the image below.
Additionally add following text to Tools >> Compiler Options >> Programs before .exe
C:Dev-CppBin
Please let me know if this has been helpful to you or not.
This entry was posted in Computers, Programming, Technical and tagged Dev C++, Dev C++ compile, Dev C++ compile error, Dev C++ compile error windows vista, Dev C++ compile errors vista, Dev C++ compile errors windows vista, dev c++ makefile build error, Dev C++ Makefile.win, Dev C++ Makefile.win [Build Error] [main.o] Error 1, Dev-C++ [Build Error] Error 1 vista, Dev-C++ [Build Error] Error 1 windows vista, Dev-C++: Error 1, Makefile.win, Makefile.win [Build Error] Error 1, Makefile.win [Build Error] Error 1 vista, Makefile.win [Build Error] Error 1 windows vista, Makefile.win [Build Error] [main.o] Error 1, vista, windows, windows vista, [Build Error] [main.o] Error 1. Bookmark the permalink.
37 Responses to Dev C++ Makefile.win [Build Error] [main.o] Error 1
-
one says:
didn’t work 😦
bye-
Tina Mishra says:
didn’t work. why?
-
-
one says:
I had to add:
c:dev-cppbin
to the .exe files in the programs tab, Vista didn’t do it correctly. now it works fine =D -
Anonymous says:
Yes, it works for me gr8. I have problem with files, but WITH this tutorial its ok
-
Anonymous says:
yes…it solved my problem…
Thnx.. -
Praveen says:
thanks it work mee for 2 times
-
rst says:
it works, thanks
-
THANKS!! says:
it works, thank you!!
-
hasan says:
It works for me. Thanks very much, I was really suffering with this stuff..
-
k says:
It works, thanks so much!
-
roque says:
si funciono te comento que en el make lo coloque tal y como lo dejaste (quitando los espacios 😀 ) pero al final lo cambio y lo dejo así
mingw32-make
problema resuelto gracias
-
nik says:
thanks it really helped
-
Anonymous says:
it works tnx :)))))
-
Enzo Roiz says:
It works ! Thank you 😉
-
h says:
did not work
-
voodoochild says:
worked!! Thanks a lot.
-
Marcinkonys says:
This helped, THANKS!
-
It worked!!!! Many thanks..
-
These steps work great. I think that these steps are best for Windows Vista Users.
-
Curran says:
did not work for me. I’m still getting the same error
-
Nikunj says:
I install dev c++ 4.9.9.2 and write normal program to cout hello world but error come like “no project compile”
-
NN says:
first you have to compile the source file which is the .dev file
-
-
Pingback: Fix Linker Error In Dev C Windows XP, Vista, 7, 8 [Solved]
-
Thallys says:
Thanks’
-
rizwan says:
did not work with windows 8.1
-
Laura says:
It didn’t worked, now I have following problem…:(
Aborted (program collect2)
C:Dev-CppExamplesMakefile.win [Build Error] nmake.exe: *** [main.exe] Error 1 -
AJAY says:
Thanks !!!! It Worked.
-
Lx says:
This helped. Many thanks.
-
C:Dev-CppBin
Aborted (program collect2)
C:UsersDavidDocumentsMakefile.win [Build Error] nmake.exe: *** [minimo.exe] Error 1 -
C:UsersDavidDocumentsMakefile.win [Build Error] nmake.exe: *** [minimo.exe] Error 1
-
khadidja says:
thank you, it’s helpfull, my code works now 🙂
-
swathi says:
Did not work
-
Julian says:
No me resulto 😦 ahora el error es otro:
….Makefile.win [Build Error] nmake.exe: *** [prueba.exe] Error 1
Ahora voy a tratar de solucionar este -
Karina says:
Auxlio por favor, ya quiero llorar, porque no logro complar en dev c++ 4.9.9.2. tena 5.11 pero me marcaba que no estaba una carpeta, luego tuve problemas con la libreria allegro y en fin, regrese a esa version, nstalé allegro pero resulta que no me deja compilar. Ya puse lo que explicaste pero me sigue marcando un errro que dice makefile.wn error 1073741819 y ya no se que mas le hace falta para funcionar, tengo mucha prisa de avanzar y no se que mas hacer. ayudaaaa
-
Karina says:
Encontr{e como resolver lo de makefle.wn, pero ahora me dice que no puede encontrar el archivo allegro.h cuando pongo las cabeceras, pero si est{a el archivo, todo ya lo revis{e muchas vees y nada que logro compilar.
Leave a Reply
|
0 / 0 / 1 Регистрация: 27.12.2010 Сообщений: 40 |
|
|
1 |
|
|
08.04.2012, 23:20. Показов 11671. Ответов 5
Только что поставил qt SDK, при компиляции любого проекта выводит ошибку: 23:14:19: Выполняется сборка проекта untitled3… В чём может быть проблема?
__________________
0 |
|
179 / 127 / 25 Регистрация: 12.01.2012 Сообщений: 623 |
|
|
09.04.2012, 00:48 |
2 |
|
Не знаю, никогда с таким не сталкивался. Может стоить попробовать установить cygwin? Там есть портированная с линукса утилита make. В крайнем случае можно ещё попытаться установить Borland C++ Compiler, там тоже есть свой make.exe, но сам по себе компилятор устаревший..
0 |
|
0 / 0 / 1 Регистрация: 27.12.2010 Сообщений: 40 |
|
|
09.04.2012, 01:17 [ТС] |
3 |
|
Может ли причиной ошибки служить ОС?
0 |
|
179 / 127 / 25 Регистрация: 12.01.2012 Сообщений: 623 |
|
|
09.04.2012, 02:07 |
4 |
|
Тут по этой ошибке гугл выдаёт сотни результатов и везде свои решения. А на системный диск «C:» пробовал ставить? Может надо прописать путь к папке temp как в этой теме http://www.prog.org.ru/topic_6991_0.html
0 |
|
2 / 2 / 3 Регистрация: 15.10.2015 Сообщений: 19 |
|
|
07.04.2017, 04:33 |
5 |
|
у меня все нормально работало (windows XP) но в один день перестала работать справка, а теперь при сборке говорит что debug/comply.o не найден, даже после смены версии отладчика mingw32-make.exe[1]: *** [debug/comply.o] Error 1 Добавлено через 25 минут
0 |
|
2 / 2 / 3 Регистрация: 15.10.2015 Сообщений: 19 |
|
|
09.04.2017, 16:16 |
6 |
|
у меня кажется Антивирус бесился Кто столкнется с подобной проблемой, необходимо проверить не блокирует ли антивирус что-то важное
0 |












