Menu

[Build error] [Hello.o] Error 1..How compile?

2005-03-31
2012-09-26
  • Nobody/Anonymous

    Makefile.win....[Build error] [Hello.o] Error 1...

    Hi,

    I just try to compile a very simple "Hello" program...and I always got this "error 1"...

    If you konw the solution...or the meaning of errors numbers (what's "error 1"?)

    I have Windows 2000, and DEV-CPP 4.9.9.2...

    Thanks...and best,
    Toni

     
    • Wayne Keen

      Wayne Keen - 2005-03-31

      Toni,

      There is an FAQ thread in this forum. The first section of it is about the "Basic 3" pieces of information that we need to start to solve your problem. Please take a moment to check it out. (There is a lot of other neat stuff there too)

      Wayne

       
    • Nobody/Anonymous

      Hi Wayne !

      I have just read the FAQs about "A simple Hello World Program"...

      I was rather interested by the FAQ about "Build error 1", so it's the same error I get when I try to compile :

      [Build error] [hello2.o] Error 1

      In my case, the "3 pieces" are :

      1) DEV-CPP 4.9.9.2 and Windows 2000 Professionnel (in french)

      2) The third Hello example's source I try to compile (into a Win32 "Console"'s Project ) is :

      include <iostream>

      include <stdlib.h> //only needed if you are using Dev 4 family

      using namespace std; //where the names are - like cout!

      int main(void)
      {
      cout << "This is what that putz Wayne said to do!\n";
      system("pause"); //keep the window open if running from Dev
      return 0;
      }

      3) The compile log of the "Makefile.win" :

      Project: atest2

      Makefile created by Dev-C++ 4.9.9.2

      CPP = g++.exe
      CC = gcc.exe
      WINDRES = windres.exe
      RES =
      OBJ = hello2.o $(RES)
      LINKOBJ = hello2.o $(RES)
      LIBS = -L"D:/Programmes/Dev-Cpp/lib" -L"D:/Programmes/Dev-Cpp/lib"
      INCS = -I"D:/Programmes/Dev-Cpp/include" -I"D:/Programmes/Dev-Cpp/include"
      CXXINCS = -I"D:/Programmes/Dev-Cpp/lib/gcc/mingw32/3.4.2/include" -I"D:/Programmes/Dev-Cpp/include/c++/3.4.2/backward" -I"D:/Programmes/Dev-Cpp/include/c++/3.4.2/mingw32" -I"D:/Programmes/Dev-Cpp/include/c++/3.4.2" -I"D:/Programmes/Dev-Cpp/include" -I"D:/Programmes/Dev-Cpp/include"
      BIN = atest2.exe
      CXXFLAGS = $(CXXINCS)
      CFLAGS = $(INCS)
      RM = rm -f

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

      all: all-before atest2.exe all-after

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

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

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

      It seems to me that the problem could be, maybe, a compatibility problem between Windows 2000 and DEV-CPP 4.9.9.2... But I'm not sure at all !!!

      I ask myself if it will be better to unistall this version of dev-ccp...and install an older one...

      Anyway, have a nice day and best regards !
      Toni

       
    • Anonymous

      Anonymous - 2005-04-01

      >3) The compile log of the "Makefile.win" :

      You have misunderstood - that is the content of makefile.win. What you need to post is the text from the Compile Log tab at the bottom of the Dev-C++ window. It is best to post this after doing Execute->Rebuild All to ensure we get all the relevant information.

      Error 1 BTW just means that make has terminated with an error, the actual error message appears in the compile log prior to this message.

      Clifford

       
    • Nobody/Anonymous

      Hi Clifford,

      Thanks for your answer...So, I looked to the "real log file"...and now my "3 pieces" are :

      1) DEV-CPP 4.9.9.2 and Windows 2000 Professionnel (in french)

      2) The source

      include <cstdlib>

      include <iostream>

      using namespace std;

      int main(int argc, char *argv[])
      {
      system("PAUSE");
      return EXIT_SUCCESS;
      }

      3) The log file :
      Compilateur: Default compiler
      Building Makefile: "D:\Programmes\Dev-Cpp\Verificator\Makefile.win"
      Excution de make clean
      rm -f main.o Console4.exe

      g++.exe -c main.cpp -o main.o -I"D:/Programmes/Dev-Cpp/lib/gcc/mingw32/3.4.2/include" -I"D:/Programmes/Dev-Cpp/include/c++/3.4.2/backward" -I"D:/Programmes/Dev-Cpp/include/c++/3.4.2/mingw32" -I"D:/Programmes/Dev-Cpp/include/c++/3.4.2" -I"D:/Programmes/Dev-Cpp/include" -I"D:/Programmes/Dev-Cpp/lib"

      g++.exe main.o -o "Console4.exe" -L"D:/Programmes/Dev-Cpp/lib"

      ld: crt2.o: No such file: No such file or directory

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

      Excution termine

      5) What I tried to do...
      When I looked to this log at first time, the error was cannot find : "cc1plus"...
      So I have added a path for this program into the compilator's options...
      And now the next error is : cannot find "crt2.o"...I have tried to solve it adding a path too...but it doensn't work...("uh !"...)...

      Thanks for your help and best regards !
      Toni

       
    • Wayne Keen

      Wayne Keen - 2005-04-03

      What is the names of the directory that you installed Dev into?

      Did you have a previous installation of Dev? If so, how did you arrive at 4.9.9.2?

      Is there a reason you chose to override Dev's default directory?

      Wayne

       
    • Nobody/Anonymous

      It was once illegal to have '+'-chars in filenames. The situation could be like spaces.

       
    • Nobody/Anonymous

      Well...thanks to Wayne and Clifford for your information...So, this time, I have tried to unistall and re-install at root of my disk (the time before the Path was

      longer...)...

      But there was still a mistake around the file "crt2.o"...

      So, have unistalled the "dev-cpp 4992"...and installed the "dev-cpp 401"...

      When I compiled the "Hello" program...there was also a mistake around the file "crt2.o" !

      It seems the solution is to copy "crt2.o" from the directory it is...and to paste it to the "[disk letter : C, etc]:\Dev-C++\Bin"

      I say "it seems" because I have just tested very simple programs as : a "Hello", a simple "Console" program, and so on...and they run...

      To be noticed, with the "dev-cpp 401", there a mistake into the "Hello" example source :

      include <iosteam.h>

      instead of

      include <iostream.h>

      I hope when I'will try to make my first "bigger and stronger" program's in C++, my installation will still work okay...and when I will install

      C++ executable programs on other computers, it will work too !...

      Thanks (a lot !) for your help and best !

      Toni

       
    • Anonymous

      Anonymous - 2005-04-04

      I would not recomment going backward.

      The crt2.o file should be in the c:\Dev-Cpp\lib\ directory. And the linker option -L"C:/Dev-Cpp/lib" should appear at the link stage. This is set in Tools->Compiler options->Directories->Libraries.

      You should continue to post new compile logs when you have performed changes, that way we can check that everything is in order.

      The same problem was referred to here: http://sourceforge.net/forum/forum.php?thread_id=1211745&forum_id=48211, but the thread ends without the OP reproting success.

      Clifford

       

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.