Dev.c++ blooshed help

This is a discussion on Dev.c++ blooshed help within the C++ Programming forums, part of the General Programming Boards category; (still need help and please note i get this error for whenever i try and compile and run any program ...

  1. #1
    Registered User
    Join Date
    Aug 2007
    Posts
    13

    Question Dev.c++ blooshed help

    (still need help and please note i get this error for whenever i try and compile and run any program no matter how simple or advanced)
    I downloaded bloodshed dev.c++ program for c++
    its the program that we are using in school for the class

    I type in the program perfectly no problems or whatever but i get an error when i try and compile it it says

    [Linker error] undefined reference to `__cpu_features_init'
    ld returned 1 exit status
    (note this is the file) C:\Dev-Cpp\My Projects\Makefile.win
    (this is the error message) [Build Error] [Project1.exe] Error 1

    here is what im trying to compile and run its pretty simple and ive tried even simpler ones the

    cout << "Hello World"<<;
    one also but i get the same error
    Code:
    #include <iostream>
    
    using namespace std;
    
    int main()
    {     
          int num1,num2;
          float average;
          
          cout << "Hello World!"<< endl;
          cout << "Press Enter to continue..." << endl;
          cin.get();
          
          cout << "Enter an integer betweeen 1 and 10"<<endl;
          cin >> num1;
          cin.get();
          cout << "Enter an integer between 11 and 20";
          cin >> num2;
          cin.get();
          average=(num1+num2)/2;
          cout << "Average=" << average << endl;
          cin.get();
    
          return 0;
    }
    im running on a gateway media center so im thinking that maybe im missinig some program?? but i have no idea

    if anybody is using this program or have used it and have any ideas please help
    please be specific in details im just a beginner to c++
    Last edited by Makachu; 08-23-2007 at 06:19 PM. Reason: becouse

  2. #2
    Registered User Finchie_88's Avatar
    Join Date
    Aug 2004
    Posts
    154
    I think that the problem maybe that you need to include cstdlib when you compile, but I'm not 100% on that.

  3. #3
    Registered User
    Join Date
    Aug 2007
    Posts
    13
    umm im just starting c++ coud you be a little or a lot more specific

  4. #4
    Registered User Finchie_88's Avatar
    Join Date
    Aug 2004
    Posts
    154
    you need to include the cstdlib in the project, so at the top of the code (just under the previous include), put:
    Code:
    #include <cstdlib>
    I think that should solve the problem.

  5. #5
    Registered User
    Join Date
    Aug 2007
    Posts
    13
    hm nope i ran this program on the school computers just fine no idea why this wouldnt work

  6. #6
    Registered User
    Join Date
    Jan 2005
    Posts
    7,317
    The code is fine, <cstdlib> isn't needed for anything in there.

    Something seems wrong with the way Dev-C++ or your project is setup. Did you find any extra information when you searched for that error message?

  7. #7
    Registered User
    Join Date
    Apr 2007
    Posts
    102
    Linker errors on something that simple usually means it wasn't installed correctly(The filed your including can't be found, or the files for Dev can't be found). I recommend uninstalling, and re-installing it carefully. Also one thing you might want to try is in Dev, you don't really need a project, for something that small it's kind of useless. I also suggest trying to get rid of the project, and just use one source code cpp page. I'm thinking that you might have clicked "A simple windows application" for your layout, or something of that sort, so just try it with just source code.
    My Favorite Programming Line:
    Code:
    #define true ((rand() % 2) ? true : false)

  8. #8
    and the hat of wrongness Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    32,540
    Can you do a "Rebuild All", then paste everything which appears in the "Compile log".
    Then we can see the actual commands which lead up to the failed linking.
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.
    I support http://www.ukip.org/ as the first necessary step to a free Europe.

  9. #9
    Registered User
    Join Date
    Aug 2007
    Posts
    13
    I got it fixed guys. For anybody that has this problem i had to uninstall the program.
    then manually remove all of the left over files on my computer.
    i had installed it once before but uninstalled it becouse it was the wrong version
    and if the old left over files interact iwth the new dev.c++ files they get all messed up.

  10. #10
    Its hard... But im here swgh's Avatar
    Join Date
    Apr 2005
    Location
    England
    Posts
    1,475
    On a side note try to get out of the habbit of using
    Code:
    using namespace std;
    Either prefix the name space objects with std:: like this:
    Code:
    std::cout << "Hello World\n";
    Or you can declare all namespace objects before you use them under their header file like this:

    Code:
    #include <iostream>
    
    using std::cout;
    using std::cin;
    Just a small tip thats all
    I'm just trying to be a better person - My Name Is Earl

Popular pages Recent additions subscribe to a feed

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21