We're a community of 1077K IT Pros here for help, advice, solutions, professional growth and fun. Join us!
1,076,163 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Start New Discussion Reply to this Discussion

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...

C:\Dev-Cpp\Current_Project\Makefile.win [Build Error]  [main.o] Error 1

and this is my compile log

Compiler: Default compiler
Building Makefile: "C:\Dev-Cpp\Current_Project\Makefile.win"
Executing  make...
make.exe -f "C:\Dev-Cpp\Current_Project\Makefile.win" all
g++.exe -D__DEBUG__ -c main.cpp -o main.o -I"C:/Dev-Cpp/lib/gcc/mingw32/3.4.2/include"  -I"C:/Dev-Cpp/include/c++/3.4.2/backward"  -I"C:/Dev-Cpp/include/c++/3.4.2/mingw32"  -I"C:/Dev-Cpp/include/c++/3.4.2"  -I"C:/Dev-Cpp/include"    -pg -g3

The system cannot find the path specified.

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

Execution terminated

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
44
Replies
6 Years
Discussion Span
1 Year Ago
Last Updated
54
Views
bops
Posting Whiz in Training
273 posts since Aug 2005
Reputation Points: 24
Solved Threads: 14
Skill Endorsements: 0

might be a dumb question -- but did you check your computer to see if those -I<path> paths actually exist?

Ancient Dragon
Achieved Level 70
Team Colleague
32,128 posts since Aug 2005
Reputation Points: 5,836
Solved Threads: 2,575
Skill Endorsements: 69

Is C:\Dev-Cpp\bin in your path?

C:\Test\GnuC>path
PATH=C:\WINNT\system32;C:\WINNT;C:\WINNT\System32\Wbem;C;\icc\bin;C:\Dev-Cpp\bin;C:\BC5\BIN;C:\watcom\BINNT;C:\watcom\BINW;c:\Perl\bin;C:\Program Files\ActiveState Komodo 3.1\;C:\Program Files\Common Files\GTK\2.0\bin;C:\Program Files\Common Files\Autodesk Shared\;C:\Program Files\Autodesk\DWG TrueView\;..\tool;C:\Program Files\doxygen\bin;C:\Program Files\Subversion\bin;C:\Program Files\Microsoft Visual Studio\Common\Tools\WinNT;C:\Program Files\Microsoft Visual Studio\Common\MSDev98\Bin;C:\Program Files\Microsoft Visual Studio\Common\Tools;C:\Program Files\Microsoft Visual Studio\VC98\bin;C:\Program Files\Microsoft Visual Studio\Common\IDE\IDE98;C:\Program Files\vslick\win;C:\NECTOOLS\BIN;..\tool;C:\COSMIC\EVAL08;c:\nectools32\bin;

Dave Sinkula
long time no c
Team Colleague
5,058 posts since Apr 2004
Reputation Points: 2,780
Solved Threads: 314
Skill Endorsements: 38

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-Cpp\New_Project\Makefile.win [Build Error]  [main.o] Error 1 

Compiler: Default compiler
Building Makefile: "C:\Dev-Cpp\New_Project\Makefile.win"
Executing  make...
make.exe -f "C:\Dev-Cpp\New_Project\Makefile.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-Cpp\bin 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:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem
C:\>

I dont have a clue what any of that is for, could you explain it? thanks.

bops
Posting Whiz in Training
273 posts since Aug 2005
Reputation Points: 24
Solved Threads: 14
Skill Endorsements: 0

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.)

Dave Sinkula
long time no c
Team Colleague
5,058 posts since Apr 2004
Reputation Points: 2,780
Solved Threads: 314
Skill Endorsements: 38

>>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)

Ancient Dragon
Achieved Level 70
Team Colleague
32,128 posts since Aug 2005
Reputation Points: 5,836
Solved Threads: 2,575
Skill Endorsements: 69

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-Cpp\bin\ directory...do you have any suggestions on what i should do?

bops
Posting Whiz in Training
273 posts since Aug 2005
Reputation Points: 24
Solved Threads: 14
Skill Endorsements: 0

Add c:\Dev-Cpp\bin\ 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.)

Dave Sinkula
long time no c
Team Colleague
5,058 posts since Apr 2004
Reputation Points: 2,780
Solved Threads: 314
Skill Endorsements: 38

Add c:\Dev-Cpp\bin\ 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.

Ancient Dragon
Achieved Level 70
Team Colleague
32,128 posts since Aug 2005
Reputation Points: 5,836
Solved Threads: 2,575
Skill Endorsements: 69

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.

dwks
Posting Whiz in Training
269 posts since Nov 2005
Reputation Points: 185
Solved Threads: 28
Skill Endorsements: 0

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.

http://www.microsoft.com/resources/documentation/windows/xp/all/proddocs/en-us/ntcmds_shelloverview.mspx

Ancient Dragon
Achieved Level 70
Team Colleague
32,128 posts since Aug 2005
Reputation Points: 5,836
Solved Threads: 2,575
Skill Endorsements: 69

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
Posting Whiz in Training
273 posts since Aug 2005
Reputation Points: 24
Solved Threads: 14
Skill Endorsements: 0

That didnt work, but I dont think I did it correctly...how would i add that to path ?

bops
Posting Whiz in Training
273 posts since Aug 2005
Reputation Points: 24
Solved Threads: 14
Skill Endorsements: 0

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-cpp\bin as being part of the path.

Dave Sinkula
long time no c
Team Colleague
5,058 posts since Apr 2004
Reputation Points: 2,780
Solved Threads: 314
Skill Endorsements: 38

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-Cpp\bin; to path but the error is still the same...any mroe suggestions ?

bops
Posting Whiz in Training
273 posts since Aug 2005
Reputation Points: 24
Solved Threads: 14
Skill Endorsements: 0

What is the code in main.cpp, and where is main.cpp located?

Dave Sinkula
long time no c
Team Colleague
5,058 posts since Apr 2004
Reputation Points: 2,780
Solved Threads: 314
Skill Endorsements: 38

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-Cpp\New_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;
}
bops
Posting Whiz in Training
273 posts since Aug 2005
Reputation Points: 24
Solved Threads: 14
Skill Endorsements: 0

Have you tried compiling using the command-line?

Ooble
Light Poster
44 posts since Oct 2005
Reputation Points: 12
Solved Threads: 6
Skill Endorsements: 0

yes I have tried that, it doesnt work.

bops
Posting Whiz in Training
273 posts since Aug 2005
Reputation Points: 24
Solved Threads: 14
Skill Endorsements: 0

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-Cpp\New_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\"?

Dave Sinkula
long time no c
Team Colleague
5,058 posts since Apr 2004
Reputation Points: 2,780
Solved Threads: 314
Skill Endorsements: 38

This article has been dead for over three months: Start a new discussion instead

Post: Markdown Syntax: Formatting Help
 
You
 
© 2013 DaniWeb® LLC
Page rendered in 0.1373 seconds using 2.84MB