Thread: Help working this compiler...

  1. #1
    Registered User
    Join Date
    Jan 2004
    Posts
    11

    Help working this compiler...

    I'm a college computer engineer. I've taken 4 or 5 programming courses, 3 of them were for C++.

    Normally, we always used Visual C++ 6 except in some instances we used some kind of unix compiler (./a.out to compile..).

    Someone recently purchased Visual C++ .NET for me... so i installed the sucker and gave it a go. I was overwhelmed. There's alot of *stuff* in this.

    Do I even need this thing? I figure it's better to use the "newer" program rather than the old one.

    I can't even compile a simple cout<<"Hello World!"; program!! I can't find COMPILE, or BUILD, or RUN. How do i run a program?!?!

    I know it might be stupid... but i'm really not used to this thing.

    Maybe if someone can help me figure out how to compile a simple program... i can move forward.

    And if you can explain to me the big differences between 6 and .NET... and maybe even recommend some other compilers i'd be happy to listen.

    Thanks.

  2. #2
    Registered User
    Join Date
    Sep 2003
    Posts
    135
    Have you checked the documentation that comes with it?

  3. #3
    Registered User
    Join Date
    Mar 2003
    Posts
    134
    when u start .net, click on file then new project. Then select c++ project, and create an empty project. In the source file folder right click add new item and add a c++ file. from there you can go about writing and compiling programs like you did in 6.0

  4. #4
    Cat without Hat CornedBee's Avatar
    Join Date
    Apr 2003
    Posts
    8,895
    Visual Studio.Net 2002 comes with the then newest standard library version (unlike 6, which still used the one from 4). Features include full container compliance of std::string, among other things.
    Little differences in the compiler, so you could have obtained the library separatly (or STLport instead).
    IntelliSense works better.

    Visual Studio.Net 2003 comes with a revised and great compiler, coming closely to full standards compliance.

    So, 2003 is definitly worth it, 2002 less so.

    But I don't understand your problems. Compile/build is in the build menu, and if I recall correctly, it was there in 6 too. Run is in the debug menu, again I think it's the same place. The shortcut keys have changed, but you can set them to 6-compatiblity somewhere in the options.
    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

  5. #5
    Registered User
    Join Date
    Jan 2004
    Posts
    11

    here it is

    Ok... I made a new blank project, made a new CPP file in the source folder. I'm not sure whether i was supposed to use win32 project or win32 console project. Normally in school... we run things in the "command' window... so should i always use win32 console project? I simple want to write a "hello" program... =)

    -------------------------
    #include<iostream.h>

    int main()
    (open brace)
    cout << "Hello";

    return 0;
    (close brace)
    ----------------------------

    why doesn't this work?? It always worked before. I read sotmhing about the iostream.h being changed... is there any way i can still use the old one for simplicity's sake?

    And to use the new one... what differences do i need to remember?

  6. #6
    Registered User Dante Shamest's Avatar
    Join Date
    Apr 2003
    Posts
    970
    I read sotmhing about the iostream.h being changed... is there any way i can still use the old one for simplicity's sake?
    Don't use the old one. Use <iostream>.

  7. #7
    Registered User jlou's Avatar
    Join Date
    Jul 2003
    Posts
    1,090

    Re: here it is

    The code tags that the little popup referred to that caused you to put (open brace) and (close brace) work like this:

    [code]
    #include <iostream>

    int main()
    {
    std::cout << "Hello World!" << std::endl;
    }
    [/code]

    Which causes the code to look like this:
    Code:
    #include <iostream>
    
    int main()
    {
        std::cout << "Hello World!" << std::endl;
    }
    Now use the empty Win32 console application and put in that code. Check the FAQ here to see answers to question like how to use code tags, the difference between iostream.h and iostream, and why the console disappears. For simplicity's sake (in the short run) put "using namespace std;" on its own line under the #include <iostream> and you don't have to add the "std::" everywhere.

  8. #8
    Registered User
    Join Date
    Jan 2004
    Posts
    11
    thanks jlou... that did it... no errors.

    can someone explain what namespace std; does though? can i put other things in front of cout and endl other than "std"? and does namespace only pertain to iostream?

    i also still can't find run =) I can BUILD the project... and it builds successfully... but where is the command to run the program so i can see the output?

  9. #9
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    39,659
    > but where is the command to run the program so i can see the output?
    Press F5
    Or look across the menu bar for "debug"
    There are lots of other things you can do, like set breakpoints, step the code one line at a time, examine variables - all to help you figure out when it doesn't work properly
    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.

  10. #10
    Registered User
    Join Date
    Jan 2004
    Posts
    11
    ahh, thank you.

  11. #11
    Registered User
    Join Date
    Sep 2003
    Posts
    135
    Originally posted by skim
    i also still can't find run =) I can BUILD the project... and it builds successfully... but where is the command to run the program so i can see the output?
    You need to learn to read the documentation that comes with your compiler instead of waiting three and a half hours for an answer on a forum. Learning to read the help files will answer not just this simple question, but many other simple questions that you'll have. If you don't start to do this for yourself you're going to find the learning process unnecessarily long and difficult.

  12. #12
    Cat without Hat CornedBee's Avatar
    Join Date
    Apr 2003
    Posts
    8,895
    Strg+F5 doesn't put the IDE in debug mode and the program starts faster.
    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. Problem building Quake source
    By Silvercord in forum Game Programming
    Replies: 16
    Last Post: 07-11-2010, 09:13 AM
  2. gcc compiler not working in windows vista
    By taurus in forum C Programming
    Replies: 1
    Last Post: 03-05-2009, 01:11 AM
  3. free 64-bit C++ compiler on Windows
    By cyberfish in forum C++ Programming
    Replies: 20
    Last Post: 11-04-2008, 12:14 AM
  4. Compiler Design... Anyone That Can Help!
    By ComputerNerd888 in forum C++ Programming
    Replies: 3
    Last Post: 09-27-2003, 09:48 AM
  5. Compiler not working...
    By Geo-Fry in forum C++ Programming
    Replies: 1
    Last Post: 02-21-2003, 10:58 PM