Thread: Newbie

  1. #1
    Registered User
    Join Date
    Nov 2008
    Posts
    3

    Newbie

    Hey, I'm new to this forum and to programming. I am using Dev C++ 4.9.9.2 on windows vista. I installed MinGW and did all the instructions for for linking the MinGW\bin in the environment variables that the instructions told me to do. I tried the HelloWorld example, and it compiles but doesn't run. On the bottom of Dev-C++, this message is shown.

    [Linker error] undefined reference to `__cpu_features_init'
    ld returned 1 exit status

    I assume there was something I did wrong with setting this up. If someone could help me, I'd appreciate it. Thank you.

  2. #2
    C++ Witch laserlight's Avatar
    Join Date
    Oct 2003
    Location
    Singapore
    Posts
    28,413
    A quick search of the Web for that linker error message shows that it is probably because you installed the Dev-C++ package that comes with MinGW, and installing MinGW separately and then following those instructions caused a conflict.

    As such, you can either undo the "linking the MinGW\bin in the environment variables", or you can simply remove your separate MinGW installation.

    Actually, in view that Dev-C++ development ceased ages ago with quite a few unresolved issues (e.g., indentation settings are messed up by default smart indents do not work correctly), it may be better to use Code::Blocks.
    Quote Originally Posted by Bjarne Stroustrup (2000-10-14)
    I get maybe two dozen requests for help with some sort of programming or design problem every day. Most have more sense than to send me hundreds of lines of code. If they do, I ask them to find the smallest example that exhibits the problem and send me that. Mostly, they then find the error themselves. "Finding the smallest program that demonstrates the error" is a powerful debugging tool.
    Look up a C++ Reference and learn How To Ask Questions The Smart Way

  3. #3
    Registered User
    Join Date
    Apr 2006
    Posts
    137
    i use notepad++, learning how to use make can also help you significantly.
    But if you can't handle it, stick to Code::blocks or DevC++.
    ★ Inferno provides Programming Tutorials in a variety of languages. Join our Programming Forums. ★

  4. #4
    C++まいる!Cをこわせ!
    Join Date
    Oct 2007
    Location
    Inside my computer
    Posts
    24,654
    For programming, it is always better to use an IDE rather than an editor. There is a reason why big companies use IDEs for development.
    Quote Originally Posted by Adak View Post
    io.h certainly IS included in some modern compilers. It is no longer part of the standard for C, but it is nevertheless, included in the very latest Pelles C versions.
    Quote Originally Posted by Salem View Post
    You mean it's included as a crutch to help ancient programmers limp along without them having to relearn too much.

    Outside of your DOS world, your header file is meaningless.

  5. #5
    Hail to the king, baby. Akkernight's Avatar
    Join Date
    Oct 2008
    Location
    Faroe Islands
    Posts
    717
    Never use Dev-C++ :P I get errors from it when I compile, but if I restart it, the errors are gone >.>
    Currently research OpenGL

  6. #6
    Hacker MeTh0Dz's Avatar
    Join Date
    Oct 2008
    Posts
    111
    Quote Originally Posted by Elysia View Post
    For programming, it is always better to use an IDE rather than an editor. There is a reason why big companies use IDEs for development.
    Always better? That's quite a blanket statement.

    OP, look into using SciTE or ViM and then just downloading the gcc suite.

  7. #7
    C++まいる!Cをこわせ!
    Join Date
    Oct 2007
    Location
    Inside my computer
    Posts
    24,654
    Name a good reason why an IDE would not be better than an editor.
    Quote Originally Posted by Adak View Post
    io.h certainly IS included in some modern compilers. It is no longer part of the standard for C, but it is nevertheless, included in the very latest Pelles C versions.
    Quote Originally Posted by Salem View Post
    You mean it's included as a crutch to help ancient programmers limp along without them having to relearn too much.

    Outside of your DOS world, your header file is meaningless.

  8. #8
    Hail to the king, baby. Akkernight's Avatar
    Join Date
    Oct 2008
    Location
    Faroe Islands
    Posts
    717
    Editors are faster :P Notepad++ even comes on the drop down list, when you press Right-Click, but dunno if that's any good reason :P
    Currently research OpenGL

  9. #9
    C++まいる!Cをこわせ!
    Join Date
    Oct 2007
    Location
    Inside my computer
    Posts
    24,654
    And in the end, how much time do you save, by having to do the rest of the things that the IDE does for you, manually?
    Quote Originally Posted by Adak View Post
    io.h certainly IS included in some modern compilers. It is no longer part of the standard for C, but it is nevertheless, included in the very latest Pelles C versions.
    Quote Originally Posted by Salem View Post
    You mean it's included as a crutch to help ancient programmers limp along without them having to relearn too much.

    Outside of your DOS world, your header file is meaningless.

  10. #10
    and the Hat of Guessing tabstop's Avatar
    Join Date
    Nov 2007
    Posts
    14,336
    What does VS do for me as an editor, other than create a Makefile?

  11. #11
    C++まいる!Cをこわせ!
    Join Date
    Oct 2007
    Location
    Inside my computer
    Posts
    24,654
    IntelliSense?
    If you are going to do with some code if you are not going to compile it? And if you are going to compile it, then how do you go about doing that in an editor as opposed to an IDE?
    Quote Originally Posted by Adak View Post
    io.h certainly IS included in some modern compilers. It is no longer part of the standard for C, but it is nevertheless, included in the very latest Pelles C versions.
    Quote Originally Posted by Salem View Post
    You mean it's included as a crutch to help ancient programmers limp along without them having to relearn too much.

    Outside of your DOS world, your header file is meaningless.

  12. #12
    Hail to the king, baby. Akkernight's Avatar
    Join Date
    Oct 2008
    Location
    Faroe Islands
    Posts
    717
    Well, all Microsoft application seem to affect each other, like when IE crashes, Windows crashes, when VS crashes Windows crashes
    Or so it was for me on the old computer, and my moms...
    Currently research OpenGL

  13. #13
    C++まいる!Cをこわせ!
    Join Date
    Oct 2007
    Location
    Inside my computer
    Posts
    24,654
    Perhaps that is because some other components or malware that has installed itself and is causing crashing all over the place. Do not blame the OS - blame your carelessness! 99% of the times, it is your fault as the user (due to installing some bad program, for example), or some other condition and the other 1% is the OS's fault.
    Quote Originally Posted by Adak View Post
    io.h certainly IS included in some modern compilers. It is no longer part of the standard for C, but it is nevertheless, included in the very latest Pelles C versions.
    Quote Originally Posted by Salem View Post
    You mean it's included as a crutch to help ancient programmers limp along without them having to relearn too much.

    Outside of your DOS world, your header file is meaningless.

  14. #14
    and the Hat of Guessing tabstop's Avatar
    Join Date
    Nov 2007
    Posts
    14,336
    Quote Originally Posted by Elysia View Post
    IntelliSense?
    If you are going to do with some code if you are not going to compile it? And if you are going to compile it, then how do you go about doing that in an editor as opposed to an IDE?
    In Vim? :make.
    In emacs? It's C-c, uh, ..., I forgot the key binding but it's one of those mode commands. (Hey I haven't used emacs in years.)
    And both of those support suspending the terminal and typing make yourself if you feel the need. I've not used notepad++, so can't speak to that.

    As to intellisense, both vim and emacs will take you from where you are to where that function is defined (assuming you defined it). Perhaps nothing about library functions, but that's what having a book is for (or man pages).

  15. #15
    Cat without Hat CornedBee's Avatar
    Join Date
    Apr 2003
    Posts
    8,895
    Quote Originally Posted by Elysia View Post
    IntelliSense?
    In my current project at work, it doesn't give me an appropriate suggestion about 95% of the times I'm writing an identifier.

    And if you are going to compile it, then how do you go about doing that in an editor as opposed to an IDE?
    Alt+Tab, Up Arrow, Enter. Takes maybe half a second as opposed to the quarter of a second that hitting F7 takes. Considering that what happens next is compilation, which takes 5 seconds at least, you'll forgive me if I dismiss this difference as irrelevant.
    All the buzzt!
    CornedBee

    "There is not now, nor has there ever been, nor will there ever be, any programming language in which it is the least bit difficult to write bad code."
    - Flon's Law

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. getting to grips with allegro and ms vc++ (newbie)
    By jimjamjahaa in forum C++ Programming
    Replies: 4
    Last Post: 11-18-2005, 07:49 PM
  2. Newbie in problem with looping
    By nrain in forum C Programming
    Replies: 6
    Last Post: 11-05-2005, 12:53 PM
  3. Newbie Programmer
    By Extropian in forum C++ Programming
    Replies: 3
    Last Post: 05-18-2004, 01:17 PM
  4. C++ newbie / linux not so newbie question
    By goldmonkey in forum C++ Programming
    Replies: 7
    Last Post: 12-13-2003, 12:27 PM
  5. Newbie Game Develpoers Unite!
    By Telenosis in forum Game Programming
    Replies: 10
    Last Post: 06-22-2002, 02:02 PM