Results 1 to 9 of 9

Thread: [RESOLVED] [Need immediate help] How to start work with?

  1. #1

    Thread Starter
    PowerPoster eranga262154's Avatar
    Join Date
    Jun 2006
    Posts
    2,201

    Resolved [RESOLVED] [Need immediate help] How to start work with?

    I used MS Visual Studio .Net 2003. I want to know how to start work on C++ source file. I'm confusing with that how to select the project type. I want to test the following simple code.

    Code:
    #include <iostream>
    using namespace std;
    
    int main ()
    {
      cout << "Hello World!";
      return 0;
    }
    “victory breeds hatred, the defeated live in pain; happily the peaceful live giving up victory and defeat” - Gautama Buddha

  2. #2
    G&G Moderator chemicalNova's Avatar
    Join Date
    Jun 2002
    Location
    Victoria, Australia
    Posts
    4,246

    Re: [Need immediate help] How to start work with?

    You want to use the basic Console Application template. It'll create a project for you with one source file called main.cpp. Put your code in there.

    chem

    Visual Studio 6, Visual Studio.NET 2005, MASM

  3. #3

    Thread Starter
    PowerPoster eranga262154's Avatar
    Join Date
    Jun 2006
    Posts
    2,201

    Re: [Need immediate help] How to start work with?

    Ok, here what I have done is.

    Click File -> New -> Project

    From there choose, Win32 Project. After creating the project with a given name,

    Click File -> Add New Item and there select C++ file. Put the above code on that file, save it and run. But get the following message.
    Attached Images Attached Images  
    “victory breeds hatred, the defeated live in pain; happily the peaceful live giving up victory and defeat” - Gautama Buddha

  4. #4
    G&G Moderator chemicalNova's Avatar
    Join Date
    Jun 2002
    Location
    Victoria, Australia
    Posts
    4,246

    Re: [Need immediate help] How to start work with?

    Strange.. have you checked if the file is actually there? What is VS trying to do.. execute it before its even compiled? What are the folder permissions set to on your machine?

    Try rebuilding it, and setting it was a release build. Then, try running the executable from Windows, instead of from the IDE.

    chem

    Visual Studio 6, Visual Studio.NET 2005, MASM

  5. #5

    Thread Starter
    PowerPoster eranga262154's Avatar
    Join Date
    Jun 2006
    Posts
    2,201

    Re: [Need immediate help] How to start work with?

    I check there, and the file is missing.

    I used Microsoft Visual Studio .Net 2003.
    “victory breeds hatred, the defeated live in pain; happily the peaceful live giving up victory and defeat” - Gautama Buddha

  6. #6
    G&G Moderator chemicalNova's Avatar
    Join Date
    Jun 2002
    Location
    Victoria, Australia
    Posts
    4,246

    Re: [Need immediate help] How to start work with?

    If the file is missing, then try a complete rebuild (Build >> Rebuild All). Then see if the file is where its supposed to be (it will be in the Release folder).

    chem

    Visual Studio 6, Visual Studio.NET 2005, MASM

  7. #7

    Thread Starter
    PowerPoster eranga262154's Avatar
    Join Date
    Jun 2006
    Posts
    2,201

    Re: [Need immediate help] How to start work with?

    I tried it, but failed.
    “victory breeds hatred, the defeated live in pain; happily the peaceful live giving up victory and defeat” - Gautama Buddha

  8. #8
    G&G Moderator chemicalNova's Avatar
    Join Date
    Jun 2002
    Location
    Victoria, Australia
    Posts
    4,246

    Re: [Need immediate help] How to start work with?

    Are you sure your code is compiling? There will be no executable there if it doesn't compile properly.

    If thats not the problem.. then, upgrade to Visual Studio 2005.

    chem

    Visual Studio 6, Visual Studio.NET 2005, MASM

  9. #9

    Thread Starter
    PowerPoster eranga262154's Avatar
    Join Date
    Jun 2006
    Posts
    2,201

    Re: [Need immediate help] How to start work with?

    Oops, I found the error. It's a big mistake. I have created a Win32 Project rather than Win32 Console Application.

    Anyway thanks for all your comments. Now I'm cool.
    “victory breeds hatred, the defeated live in pain; happily the peaceful live giving up victory and defeat” - Gautama Buddha

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width