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
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 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 ?
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.
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,0577 ] [ 16 queries used ] [ Generated: 9.02.23, 07:59 GMT ]
Содержание
- Dev cpp error 1 что это
- Dev cpp error 1 что это
- Share this:
- Like this:
- Related
- 37 Responses to Dev C++ Makefile.win [Build Error] [main.o] Error 1
- Dev-C++ — [Build Error] [main.o] Error 1
- All 45 Replies
Dev cpp error 1 что это
1) На Раздел распространяются все Правила Форума.
2) Перед тем, как создать новый топик, убедитесь, что Вы читали Правила создания тем в Разделе.
3) Вопросы, не связанные с программированием (настройки MS Visual Studio, книги, библиотеки и т.д.),
обсуждаются в разделе C/C++: Прочее
4) Вопросы разработки .NET (Windows Form, C++/CLI и т.п.) приложений на Visual C++/C# обсуждаются в разделе .NET.
5) Нарушение Правил может повлечь наказание со стороны модераторов.
Полезные ссылки:
FAQ Раздела Обновления для FAQ Раздела Поиск по Разделу MSDN Library Online
Dev-C++ Совершенно не хочет компилить никакие проекты.
При попытке откомпилить проект(msdos app) оно грит:
Compiler: Default compiler
Building Makefile: «F:Program FilesDev-CppProjectsDOSMakefile.win»
Executing make.
make.exe -f «F:Program FilesDev-CppProjectsDOSMakefile.win» all
g++.exe -c main.cpp -o main.o -I»F:/Program Files/Dev-Cpp/include/c++» -I»F:/Program Files/Dev-Cpp/include/c++/mingw32″ -I»F:/Program Files/Dev-Cpp/include/c++/backward» -I»F:/Program Files/Dev-Cpp/include»
make.exe: *** [main.o] Error 1
и так всегда
Вроде бы все настроил, все фолдеры указал, а он все равно упирается. Мож где че позабыл?
версия — Dev-C++ 4.9.8.0.
проект создавал через file->new->project->winapp
/* 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);
/* 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);
>
Источник
Dev cpp error 1 что это
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.
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.
Like this:
37 Responses to Dev C++ Makefile.win [Build Error] [main.o] Error 1
didn’t work 😦
bye
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
Yes, it works for me gr8. I have problem with files, but WITH this tutorial its ok
yes…it solved my problem…
Thnx..
thanks it work mee for 2 times
it works, thanks
it works, thank you!!
It works for me. Thanks very much, I was really suffering with this stuff..
It works, thanks so much!
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í
problema resuelto gracias
thanks it really helped
It works ! Thank you 😉
worked!! Thanks a lot.
This helped, THANKS!
It worked. Many thanks..
These steps work great. I think that these steps are best for Windows Vista Users.
did not work for me. I’m still getting the same error
I install dev c++ 4.9.9.2 and write normal program to cout hello world but error come like “no project compile”
first you have to compile the source file which is the .dev file
did not work with windows 8.1
It didn’t worked, now I have following problem…:(
Aborted (program collect2)
C:Dev-CppExamplesMakefile.win [Build Error] nmake.exe: *** [main.exe] Error 1
Thanks . It Worked.
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
thank you, it’s helpfull, my code works now 🙂
Источник
Dev-C++ — [Build Error] [main.o] Error 1
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.
and this is my compile log
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 ?
- 21 Contributors 45 Replies 21K Views 8 Years Discussion Span Latest Post 8 Years Ago Latest Post by muhammad raees
What is the code in main.cpp, and where is main.cpp located?
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.
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 …
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 …
./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.
might be a dumb question — but did you check your computer to see if those -I
paths actually exist?
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;
Yes I have checked all of the paths and they all exist. this even happens when I compile a project from scratch..ie.
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.
I dont have a clue what any of that is for, could you explain it? thanks.
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.)
>>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)
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?
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.)
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.
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.
this is probably not relivent to this thread — but here is what I found in MSDN for environment variables
• The maximum individual environment variable size is 8192bytes.
• The maximum total environment variable size for all variables, which includes variable
names and the equal sign, is 65,536KB.
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.
That didnt work, but I dont think I did it correctly. how would i add that to path ?
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.
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 ?
What is the code in main.cpp, and where is main.cpp located?
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.
Have you tried compiling using the command-line?
yes I have tried that, it doesnt work.
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»?
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.
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.
As you can see this contains only the source file, and still produces the same error.
So is your main.cpp file in the same directoty as the .dev file and the make file?
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..)
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.
I think I’ve exhausted my attempts. I don’t understand what the issue is.
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..
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.
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)
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.
and this is my compile log
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 ?
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.
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.
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.
We’re a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.
Reach out to all the awesome people in our software development community by starting your own topic. We equally welcome both specific questions as well as open-ended discussions.
Источник
- Forum
- General C++ Programming
- [Build Error] [main.o] Error 1 (makefil
[Build Error] [main.o] Error 1 (makefile error)
I am using: Dev-C++ 4.9.9.2 on Win 7.
So I am working on this project. And whenever I come to compile it, I get a make file error. Its weird cuz all the other projects compiles correctly. And even when I come to copy some new short code replacing the original one, it compiles perfectly, which is making me more sure that there is some mistake in the code itself. First of all, here is the make file:
|
|
The compile log:
|
|
The project files:
http://pastebin.com/5BWq8iEJ (main.cpp file)
http://pastebin.com/p3ZjdS8A (Object.h file)
What am I doing wrong this time ?_? ???
Thanks for your time and dedication! (and sorry for the page stretch)
Last edited on
I don’t know SDL so I cannot you help deeply, but perhaps I found some little syntax error on compiling main.o
first of all: careful to spaces…. between «-I» options (example between 1st and 2nd one) there are 2 o more spaces….. remember that every option must be separated by one single space only
Second: (again, spaces…) when you use FLAGS (like CXXINCS) remember that first option must immediately follows the = so don’t write a space from = and first -I option (becouse, after sostitution, there will be more spaces in command line)
so try to replace your CXXINCS with this one
|
|
As you can note I removed also the space after «C:/SDL-1.2.15/include» becouse the final string must end WITHOUT spaces.
Another good practice, for a «flag» macro, is to don’t make spaces also from macro and = (in that case it is better to write CXXINCS= instead of CXXINCS =)… unlike the other spaces, this is NOT an error, only a suggested practice (becouse in this way you would probably not forget to don’t use spaces between = and first param)
Moreover…. Dev-C++ is deprecated and abandone…. mainly your version that still use gcc 3.x while now it is suggested to use gcc 4.x (better if 4.6 or 4.8)
Hope this hint can be helpful
Last edited on
Actually, that makefile was not written by me; it was generated by Dev-C++ it self. So I tried replacing that line with what you gave, and now, I am receiving this error:
C:Usersuser01DesktopA-StudiosC++SDLA-EngineMakefile.win [Build Error] No rule to make target `A-Engine.exe', needed by `all'. Stop.
Thanks for trying to help =D.
So any other guesses?
P.S: I don’t really know anything about makefiles scripting, so I would appreciate if anyone would direct me to a good tutorial/guide on how to use them.
make.exe: *** [main.o] Error 1
¿is that all?
I’ve got
In file included from main.cpp:7:0: Object.h: In member function ‘void spritegrid::ini(std::string, int, int, int, int, std::string)’: Object.h:75:74: error: cast from ‘const char*’ to ‘int’ loses precision [-fpermissive] Object.h:76:75: error: cast from ‘const char*’ to ‘int’ loses precision [-fpermissive] Object.h:77:75: error: cast from ‘const char*’ to ‘int’ loses precision [-fpermissive] make: *** [main.o] Error 1
Referring to
|
|
¿what are you trying to do there?
PS: http://www.gnu.org/software/make/manual/make.html
:facepalm: I was trying to convert a extract 3 RGB values from «0xFFFFFF» color format to use as a color key. That was back in the days were I thought I can convert a string to an int by simply using (int).. The color key is basically extracted from a txt file, and that’s why I dealt with it as a string. Can you please replace the 3 lines with the following and compiling again?
|
|
And thanks for the tut!!
Btw, what IDE are you using???
Thanks in advance!!
Last edited on
Last edited on
Linux as an ide.. Interesting XD!
And, I checked that guide on header files, and I added that #indef statement thingy. But that doesn’t seem to be the issue for me (is it?). I will try to build it using another IDE this time then I will report back. Thanks.
I never used VIM.
I tried but I find it confusing… I am not able to remember all key combinations
I’m used to use a graphical text editor for sourcecode (Under linux I usually use KWrite and under win I use Crimson Editor)… It is more intuitive than using VIM…. even if VIM has the great advantage it doesn’t require X to be runned…
However… I don’t use any more IDEs from years (except Qt Designer for designing Qt widgets… but it is not properly an IDE)… I think that using gcc/g++ from command line is better…. even if a bit harder…. but you have full control of what you are doing…
@CPlahPlahLearner: changing those lines it does compile
However I’ve got stack overflow because `LOADED’ is too big (~18MB)
Also, I didn’t just point to the #ifdef #endif
You’ve got to put the necessary includes in your header, remove using
directive, and avoid function definitions
Whaaat?? 18mb?? This can’t be! Basically all what I am loading is 2 small sprite grids with ~70 Kbs altogether. Maybe I am just loading them more than once resulting in that …
So, I tried Orwel’s Dev-C++ 5.4.2 and it compiled. However, when I come to run the exe, nothing opens. Tried using debugging mode, and some very weird stuff happened.
1-I placed breakpoints all over the 2 files (the main and the header file), but the debugger would ignore everything, and jumps into this line:
http://i33.servimg.com/u/f33/16/27/78/35/screen12.png
2-I clicked on «next line», and the debugger moved normally to the next line:
http://i33.servimg.com/u/f33/16/27/78/35/screen13.png
3-I clicked on «next line» once more expecting that the debugger would enter the main function, but then:
http://i33.servimg.com/u/f33/16/27/78/35/screen15.png
It jumped to the closing bracket of the function «breakpoints invalid»…
4-Tried clicking «next line» 3 more times, and I received a «segmentation fault»:
http://i33.servimg.com/u/f33/16/27/78/35/screen16.png
5-Clicking on ok with «show CPU window» checked:
http://i33.servimg.com/u/f33/16/27/78/35/screen17.png
:
Thanks ne555, I appreciate your time and dedication =)
Last edited on
Yep, that was what were happening over here.
My guess is that you blow the stack space
Try
|
|
object 36KB LOAD 18MB |
18MB is a little much for the stack, use the heap instead
By instance,
|
|
The rest of the code is the same
Vectors … Interesting!! I must have a look at its documentation, then I will be using them instead of arrays and for all. And nice technique you’ve used there to find how much memory each is using!! Once again, THANKS!!
Deemed solved~
Topic archived. No new replies allowed.
-
Summary
-
Files
-
Reviews
-
Support
-
Wiki
-
Mailing Lists
-
Code
-
Tickets ▾
- Feature Requests
- Bugs
- Patches
-
News
-
Discussion
Menu
▾
▴
[Build Error] [main.o] Error 1
Created:
2006-05-20
Updated:
2012-09-26
-
Hi,
I am getting the above error when I try to compile any windows projects.
Even projects that used to compile dont compile any more.
I am getting the same error on 4.9.9.0 and 4.9.9.2
Any ideas on how to solve this? I tried reinstalling the program several times and still no dice.
-
-
Well, I guess you did not read the thread in this forum titled
«Please Read Before Posting a Question»
in particular, the section on the «Basic 3» — telling us an error message in isolation really gives us very little to go on. Please post you Basic 3.
You also mention both 4.9.9.0 and 4.9.9.2. In going between releases, did you do a clean uninstall — the directions for which are also in the «Please Read» thread?
Wayne
-
Compiler: Default compiler
Building Makefile: «D:ProgrammingCppDevMakefile.win»
Executing make…
make.exe -f «D:ProgrammingCppDevMakefile.win» all
g++.exe -c main.cpp -o main.o -I»D:/Programming/Cpp/Dev-Cpp/lib/gcc/mingw32/3.4.2/include» -I»D:/Programming/Cpp/Dev-Cpp/include/c++/3.4.2/backward» -I»D:/Programming/Cpp/Dev-Cpp/include/c++/3.4.2/mingw32″ -I»D:/Programming/Cpp/Dev-Cpp/include/c++/3.4.2″ -I»D:/Programming/Cpp/Dev-Cpp/include»g++.exe: main.cpp: No such file or directory
g++.exe: no input filesmake.exe: *** [main.o] Error 1
Execution terminated
thats the compile log.
as for the program:
include <iostream>
using namespace std;
int main (int argc, char *argv[])
{
cout << «Hello World!» << endl;
cout << «Press ENTER to continue…» << endl;
cin.get();
return 0;
}I think its something to do with the make file generation?
-
Well, you overrode where Dev installs itself. General hint. Don’t do that unless you are VERY sure its OK.
You also did not answer my question about how you moved between versions.
My advice is this.
Do a clean uninstall, using the directions in the thread «Please Read Before Posting a Question» as a starting point. Take your time, and fully delete all traces of Dev. This may take a little more time, as you probably have installed Dev in more than one directory.
Note the STRONG request in the directions to keep good notes and report exactly what you do — reporting back that «I followed the directions to the letter and …» or the like is not appreciated.
Re-download 4.9.9.2, and install it in the default directory.
You should be OK, but if you are still having issues, report exactly what you did in your clean uninstall-reinstall — step by step — and post your Basic 3.
Wayne
-
Hmm,
I did a clean uninstallation, basically running the uninstall.exe from the install directory. Then I deleted all the config files unde AppData/Dev-cpp, then I deleted the install folder itself, then I ran RegCleaner to clean out the reg of any entries that may have been there.
Redownloaded the 4992 setup and installed.
Still the same error.
The thing is that I’ve been using Dev-CPP for years on this install directory format and it’s been working fine so far.
-
Another thing: Dev-CPP seems to compile fine if I don’t use a project (and hence a make file). Could it be something to do with the generation of a make file?
-
It has to do with how make is invoked. Usually, it is getting into path confusion.
You did not mention doing a search to insure that all traces of Dev were removed from your hard drive. Did you? I am not worried about the Registry so much, Dev really doesn’t do anything big there. I am more worried about files space. Remember to configure Dev to search through hidden folders.
This can be especially important when you have had multiple installs. That is why I told the story of someone finding that there were vestiges of Dev hiding in c:program from a previous installation attempted in c:program files. You really have to do some hunting to make sure you nuke everything.
Wayne
-
Theres only 1 place that I installed Dev-CPP to, and thats the d:programmingcpp folder, and I’ve nuked everything there already. Unless dev-cpp creates files some place else other than those locations. I’ve also run a Disk Cleanup and deleted temporary files from the common locations, but doesnt fix the problem.
-
Although I’m 100% sure that there are no other installations, I did a hunt all the same, and it came up with ZIP. The only installation is in that current location.
Basically, there are no other vestiages.
-
How did you configure windows search?
Wayne
-
Look,
I’m a careful user of the computer, and not a noob either. If I’m sure that I didn’t install something to a location, then it didnt happen, unless the Dev-CPP installer is pre-configured to install by itself at midnight.
I manually hunted through the Program Files directory, and cleaned out all the temporary file lcoations.
-
I have helped a ton of people through issues such as this. However, if you do not want to do what I ask, then I can not help you.
Wayne
-
google: how to ask smart questions and comply with requests posted by people who are actually trying to help you.
-
I’ve done exactly as you asked so far…
-
«I’ve done exactly as you asked so far…»
Right. So how did you configure your windows search?
Wayne
-
From 4 posts up:
I manually hunted through the Program Files directory, and cleaned out all the temporary file lcoations.
Like I said though, I know that there aren’t any installations to any other locations other than d:programmingcpp.
-
«I manually hunted through the Program Files directory»
I’ll make this even clearer.
Do a windows search on your entire hard drive — make sure that you configure the search to look in hidden folders. (That is not the default configuration for search) Look for anything devcpp related.
Delete it
Wayne
-
Done.
And btw, nothing came up.
-
This will sound like an echo:
How did you configure your search?
Wayne
-
Exactly as you told me to.
-
Telling me that tells me nothing.
Wayne
-
Then you’re saying that your post before this told me nothing.
Quote From 2 posts before:
Do a windows search on your entire hard drive — make sure that you configure the search to look in hidden folders. (That is not the default configuration for search) Look for anything devcpp related.
End Quote
Done that. Search returned nothing (because i didn’t install Dev-CPP to any other locations).
Do you have any suggestions other than looking for non-existant other install locations?
-
I asked you (on several occasions) how you configured your search. Telling me that you did what I told you to do tells me nothing.
When debugging remotely it is vital that you tell people exactly what you did.
Wayne
-
Hi,
I’ve got the very same problem.
I’ve attempted to compile some C code and all I get is: [Build Error] [main.o] Error 1
This happen indipendently from the code I try to compile; I’ve also tried con the code listed above by another user, getting the very same results.
By the way I’m compiling from a fresh install (no previous installation pf Dev-C++ on my PC).
Could someone help ?
Log in to post a comment.
15.02.08 — 15:20
Поставили Dev-C++ 4.9.9.2 в компьютерном классе, на всех машинах заработал нормально. Потом на одной машине переустановили Windows и все программы, поставили Dev-C++ и при компиляции совершенно пустого проекта консольного приложения выдается ошибка — C:Documents and SettingsUserМои документыMakefile.win [Build Error] [main.o] Error 1
В логах такой текст:
Compiler: Default compiler
Building Makefile: «C:Documents and SettingsUserМои документыMakefile.win»
Executing make…
make.exe -f «C:Documents and SettingsUserМои документыMakefile.win» all
g++.exe -c main.cpp -o main.o -I»lib/gcc/mingw32/3.4.2/include» -I»include/c++/3.4.2/backward» -I»include/c++/3.4.2/mingw32″ -I»include/c++/3.4.2″ -I»include»
«0» -Ґ пў«пҐвбп ў-гвॗҐ© Ё«Ё ў-Ґи-Ґ©
Є®¬ -¤®©, ЁбЇ®«-塞®© Їа®Ја ¬¬®© Ё«Ё Ї ЄҐв-л¬ д ©«®¬.
make.exe: *** [main.o] Error 1
Execution terminated
Подскажите что сделать чтобы оно заработало. Инсталяция нормальная, на другой машине точно так же ставлю, все работает.
1 — 15.02.08 — 15:27
Помоему дело в русских именах.
2 — 15.02.08 — 15:27
(0) только не говори что ты — преподаватель Dev-C++
3 — 15.02.08 — 15:28
*неуверенно таг* вирусЫ?!
4 — 15.02.08 — 15:29
Всмысле когда русские буквы в названии файла попадаются.
5 — 15.02.08 — 15:29
(1) да украинские нужно
6 — 15.02.08 — 15:30
(5) зря смеешься. Я как то все глаза сломал об простой код. Оказалось дело в русских буквах. Не украинские нуно, а английские.
7 — 15.02.08 — 15:31
(6) да ладно, а Хде ж именно
8 — 15.02.08 — 15:32
«0» -Ґ пў«пҐвбп ў-гвॗҐ© Ё«Ё ў-Ґи-Ґ©
Є®¬ -¤®©, ЁбЇ®«-塞®© Їа®Ја ¬¬®© Ё«Ё Ї ЄҐв-л¬ д ©«®¬.
Перевожу:
» «0» Не является внутренней или внешней
командой, исполняемой программой или п кетным файлом «
9 — 15.02.08 — 15:33
(7) У меня. Если в пути файла попадаются русские буквы, компилятор отказывается работать.
10 — 15.02.08 — 15:33
(8) наконец-то)))
11 — 15.02.08 — 15:35
всего лишь в dos кодировку перевести нужно
12 — 15.02.08 — 15:43
(8) спасибо, я уже тоже перевела
дело не в русских буквах, я ставила С в разные каталоги, на разные диски, без русских букв, результат тот же. Также С ставила с английским интерфейсом. Точно так же проект я сохраняла в разных местах, и на русские буквы тоже все проверяла, это не оно.
13 — 15.02.08 — 15:49
да, еще wxDev-C++ ставила тоже, результат тот же.
14 — 15.02.08 — 16:12
окружения проверь.
15 — 15.02.08 — 16:23
(14) а где в XP они задаются?
16 — 15.02.08 — 16:32
17 — 15.02.08 — 16:36
Если изучаестся только язык Си — lcc. Работает и на не очень мощных машинах.
Visual c++ требует Win XP SP 2.
Dev-C++ рекомедую сейчас же бросать. Сэкономите кучу времени и нервов.
Тем более образование. lcc разрабатывался универом специально для образовательных целей.
18 — 15.02.08 — 16:37
(16)
Возможно, проще. Только нужно чтобы они тоже заработали.
Перавя ссылка, я так понимаю, бесплатный вариант вижуал студио, а что такое второе?
19 — 15.02.08 — 16:41
20 — 15.02.08 — 16:42
(18) — у Вас какой язык изучается? Только Си? Тогда качайте lcc в (19).
21 — 15.02.08 — 16:42
мда..
Ситуация такая: у нас стоит лицензионный Вижуал студио, я должна работать в нем. Но дело в том, что в моем случае предмет преподается экономистам, я не хочу их грузить такой средой. Кроме того, дать его им поставить домой я не имею права, а в классе из-за вирусов машины выходят быстрее чем их успевают восстанавливать. Я нашла выход — Dev-C++, или более новый вариант wxDev-C++, программа легкая, нетребовательная, устанавливается даже под правами пользователя, только наш системный администратор умудрился и его свалить
22 — 15.02.08 — 16:43
не совсем с
им лектор дает cout, cin мож еще чего из ++, я не помню
23 — 15.02.08 — 16:45
lcc — разрабатываемый уже больше 10 лет немецким университетом легковесный компилятор языка Си + среда. Специально для образовательных целей.
Бесплатен.
24 — 15.02.08 — 16:48
(21) — ээ… какой Visual Studio?
Если 2005, то качайте и ставьте Visual C++ 2005 Express. Там среда неперегруженная и проще, чем в Professional. В Basic и С# аналогично.
25 — 15.02.08 — 16:50
спасибо
ща попробую обе
26 — 15.02.08 — 16:50
но нужно чтобы они заработали тоже….
27 — 15.02.08 — 16:52
28 — 15.02.08 — 16:53
Visual Studio там кажется 2003, а как этот Express уживется с уже установленной версией? А то: «Перед началом установки обязательно удалите прежние версии Visual Studio 2005. Перед установкой окончательных версий Visual Studio 2005, в том числе и из серии Express Editions, необходимо удалить все бета-версии этих продуктов, а также бета-версию .NET Framework 2.0.»
29 — 15.02.08 — 16:55
(28) — Full и Express должны уживаться вместе.
30 — 15.02.08 — 17:02
Поставила на закачку оба, попробую.
Лучше было бы, конечно, dev поднять, тем более что первое занятие в нем я уже провела, все работало.
31 — 15.02.08 — 17:10
(27) — казалось бы, причем здесь Линукс
32 — 15.02.08 — 17:52
Если студию, так уж 2008. Гораздо шустрее.
На DevCpp точно забить, посмотрите на размер экзешника простейшей проги.
33 — 15.02.08 — 17:56
если пошла такая пьянка, то лучше ставить codeblocks:
http://www.codeblocks.org/downloads.shtml
Скачиваете основной инсталл, потом накатываете последний найт-билд отсюда:
http://forums.codeblocks.org/index.php/board,20.0.html
34 — 15.02.08 — 21:10
(0) Пробелы в пути — запрещено.
35 — 15.02.08 — 23:13
(33)
хороший вариант
спасибо
36 — 20.02.08 — 18:28
Итак, продолжение….
Снова прошу помощи, может все таки кто-то чем-то поможет.
Dev-C++ не работает по вышеуказанной причине, wxDev-C++ по той же.
Остановились на Codeblocks. Он даже работает Но когда запускается на выполнение откомпилированный проект консольного предложения, первая строка вышедшая на печать такая:
«»0» Не является внутренней или внешней
командой, исполняемой программой или пакетным файлом»
Дальше все работает.
Torquader
37 — 20.02.08 — 18:50
Если он не может выполнить команду, то есть говорит, что что-то не является командой или исполняемым файлом, то может быть две причины:
1) Где-то в пути закрался пробел или какой-то другой непонятный символ, который прерывает интерпретацию пути, и система пытается запускать то, чего нет.
2) Где-то в путях (переменная PATH) или в реестре осталось старое положение исполняемого файла (или наоборот записалось новое). То есть не находится запускаемый файл (в данном случае g++.exe или какая-то его библиотека).