Menu

New to programming and a little lost...

Nub
2007-08-14
2012-09-26
  • Nub

    Nub - 2007-08-14

    I just started out programming some C. I have been using the tutorials on cprogramming.com and everything I created, compiled and ran just fine. Now today I am trying to continue the lessons but can't seem to execute my progs. Even when I re-create the ones I did yesterday.
    I now get an error "gcc: installation problem, cannot exec `ld': No such file or directory" in the compiler and linker output box. Why am I having problems today, when I was doing EXACTLY the same thing yesterday with no problems? I can not seem to find an answer for this in the FAQ or the help file.
    Any help would be greatly appreciated.
    Thanks in advance.

     
    • Nub

      Nub - 2007-08-16

      Thanks for the help Wayne, I really apreciate it. And to the anonymous post on 8/15 at 15:55, thanks as well, for the link. that site looks a little easier to understand. For Robbie56, I see you are/ were having the same problem as I was. I upgraded to version 5 and now have no problems. Thanks again to all the posts here for the help.
      Ryon

       
    • Anonymous

      Anonymous - 2007-08-17

      GCC version 2.95 does not support namespaces does it? It is sooooo old.

      Besides Robbie56, dispite your appology, you really should have started a new thread. Your problem was not the same, you were merely using the same tool-chain. You should have just taken teh advice to upgrade already given and kept quiet (or started a new thread).

      To Ryon, be clear. Dev-C++ is not and compiler. It includes a compiler (if you download the right version), and is an editor (and more besides). It is all you need (although not teh only or necessarily the best option).

      Clifford

       
    • Wayne Keen

      Wayne Keen - 2007-08-14

      Could you please post your "Basic 3" - they are covered in the thread in this forum titled "Please Read Before Posting a Question" - thanks

      Wayne

       
    • Nub

      Nub - 2007-08-14

      Sorry. My basic 3 are...
      1) Version 4, WinXP

      2) / This is what I am trying to work on today /
      #include <stdio.h>

      int main()
      {
      int this_is_a_number;

      printf( "Please enter a number: " );
      scanf( "%d", &this_is_a_number );
      printf( "You entered %d", this_is_a_number );
      getchar();
      }

      3)Compiling files :
      C:\DEV-C_~1\Bin\gcc c:\docume~1\ryon\mydocu~1\progra~1\clesso~1\step1.c -o c:\docume~1\ryon\mydocu~1\progra~1\clesso~1\Step1.exe -s -fexpensive-optimizations -IC:\DEV-C_~1\Include\ -IC:\DEV-C_~1\Include\G__~1 -IC:\DEV-C_~1\Include\ -LC:\DEV-C_~1\Lib\ -BC:\DEV-C_~1\Bin\

       
    • Nub

      Nub - 2007-08-14

      Also, not sure if it matters or not, but I am using gVim as my editor

       
    • Wayne Keen

      Wayne Keen - 2007-08-14

      "but I am using gVim as my editor"

      Then why/how are you using Dev? Are you compiling from the command line?

      Your code is stored in a folder with spaces in its paths, which is a very
      bad idea, in particular with older versions of Dev, like the one you are
      using. (You do know that version 4 is very old and not really supported)

      Wayne

       
      • Wayne Keen

        Wayne Keen - 2007-08-14

        The reason that statement is confusing me is that Dev-C++ is an IDE, a fancy
        editor, that uses MinGW/GCC as its compiler. So there is no reason for you
        to be using something else as an editor.

        If, on the other hand, you just downloaded Dev to get MinGW/GCC, and you
        plan to continue using gvim as your editor, then you are better off downloading
        MinGW with MSYS.

        It is OK to be confused - some of us live our lives in that state, but take
        your time and tell us exactly what you are doing.

        Wayne

         
    • Nub

      Nub - 2007-08-14

      Well, from reading the tutorials that I am using it said I need to get a compiler which I did. I went to http://www.bloodshed.net/devcpp.html and downloaded the most up to date non-beta version I could find. Again, I just went with what the tutorials recommended I use as a beginner. The tuts then recommended an editor program to make it easier than using word pad, so I got gVim.

      As I stated before everything was working just fine yesterday and I have made no changes. To give you an example of what I started with yesterday...

      #include <stdio.h>

      int main()
      {
      printf( "I am alive! Beware.\n" );
      getchar();
      return 0;
      }

      I created the program above in gVim, saved it as a .c file, then compiled it with Dev to create an .exe file. The one I created yesterday still works no problem. But, today if I try to re-create the same exact prog in the same manner and try to compile it I get the error which started this thread.

      Maybe I am over complicating things, but as I stated before I am VERY new to programming, as in I'm pretty much teaching myself. I was just trying to follow the tutorials word for word to acheive the best results.

      As for where I save my sources, should I move my storage folder directly to the Dev folder?

      As for your question about compiling from the command line... I am unsure what that means. I am creating .c files with gVim, then I open Dev and click the open file

       
    • Nub

      Nub - 2007-08-14

      sorry I hit the worng button and didn't finish my post properly.

      As for your question about compiling from the command line... I am unsure what that means. I am creating .c files with gVim, then I open Dev and click the open file, then I click the compile button.

      BTW I just updated to the new version and I no longer get the first error.
      Thanks for the help,
      Ryon

       
    • Nub

      Nub - 2007-08-14

      I guess I mis-understood what the tuts were telling me. The way the guy describes Dev on his tut site I guess I thought Dev was just a compiler and not an editor as well. Thanks for the clarification, I suppose I will leave gVim alone and just use Dev.

      Here is the link to the tut I am using... http://www.cprogramming.com/tutorial/c/lesson1.html

      Sad to say I am still trying to get the hang of everything just on that page alone. Perhaps there is a better tutorial out there you could recommend I use instead... Or, just a better starting point for a flat out beginner like me.
      Thanks,
      Ryon

       
      • Wayne Keen

        Wayne Keen - 2007-08-14

        I would humbly suggest that you should do a clean delete on version 4,
        and update to the latest version of Dev, version 4.9.9.2

        The beta label is misleading - version the 5 series (which also starts
        with 4, just out of general meanness) has been the regular, working release
        of Dev for 5+ years now.

        Wayne

         
        • Wayne Keen

          Wayne Keen - 2007-08-14

          As to where to put your code, I generally have a folder named something like

          c:\mycstuff

          where I keep my source and projects. Keeping things in your Dev directory
          can lead to some issues, as Clifford has reported.

          Wayne

           
    • Nobody/Anonymous

      This is not the best resource but if you are looking for something to just get you going in the right direction then take a look as it may help understand some of the basics but beyond that I would suggest actually buying a good book and move on from there, I am sure there is a plethora of good suggestions in the Please Read Me thread for books to get.

      http://newdata.box.sk/bx/c/

       
    • Nobody/Anonymous

       
    • Nobody/Anonymous

      Hey ya, sry that i post it here, but i didn't want to start a new toppic ...

      Does anyone of you know, why one day i simply compile the same code with no problems, on the other day there is a problem ...
      I'm using 'Dev-C++ Version 4, Mingw compiler 2.95.2-1 MSVCRT' on win XP.
      If i want to compile a simple:
      // -----------

      include <iostream>

      using namespace str;
      int main(void)
      {
      return 0;
      }//main()
      //------------
      The compiler finds 1 error.
      Error message: "namespace 'str' undeclared".
      But when i load the same thing from yesterdays project, it doesn't make the error.
      Does anybody have an idea, why this could be?
      Maybe something wrong with the linker?
      Linker msg:
      "g++:e:\var\inst\devcpp4!usr\myproj2.o: No such file or directory"
      Seems like it doesn't find the file or can't include the <iostream>
      If anobody knows what's wrong, further thanks for help :)
      Robbie56

       
      • Osito

        Osito - 2007-08-15

        Do you actually have a namespace called 'str' defined somewhere? Or did you accidentally change 'std' to 'str' between your successful and unsuccessful compiles.

         
    • Nobody/Anonymous

      OMG :(
      thank you Osito :) wtf, i must have a break, cuz i can't see anymore ...
      Yes, ... how could i write 'str' instead of 'std'? shit son :D
      Thanks again :)

       

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.