Sam LaManna
Sam LaManna

Reputation: 425

What type of Visual Studio c++ project should i select for making basic unix apps

Im in a computer science 1 class and we are programing using C++. In class we use emacs on unix servers. We can also use visual studio if we want. If its going to be graded in emacs and run there by the professor what type of project should i pick in Visual studio for the best results.

every time i try to compile the code i get these errors

Warning 1   warning C4627: '#include <iostream>': skipped when looking for precompiled header use   c:\Users\Sam\documents\visual studio 2010\Projects\Test 3\Test 3\Test 3.cpp 3   1   Test 3
Error   2   error C1010: unexpected end of file while looking for precompiled header. Did you forget to add '#include "StdAfx.h"' to your source?   c:\Users\Sam\documents\visual studio 2010\Projects\Test 3\Test 3\Test 3.cpp 16  1   Test 3

here is the code:

// Samuel LaManna

#include <iostream>

using namespace std;

int main()
{
    cout<<endl;
    cout<<endl;
    cout<<"Hello World!";
    cout<<endl;
    cout<<endl;
    return 0:
}

Upvotes: 1

Views: 1912

Answers (5)

Timmah
Timmah

Reputation: 15

the simple fact that the $600 commercial product doesn't include "Linux C++ makefile project" in the "new project" menu should be reason enough not to use it. Consumers don't want to pay for products that can do less.

Upvotes: -3

Daniel Pereira
Daniel Pereira

Reputation: 1785

I strongly suggest you just use emacs and unix. Ubuntu Linux is free, emacs is free, and g++ is free (c++ compiler). It's best to always use the same platform your professors are using. If you have to use Visual Studio for some reason, you can do a console application project, but you are going to have all kinds of trouble doing it that way. Just use emacs/unix.

Upvotes: 2

wilhelmtell
wilhelmtell

Reputation: 58685

Select an empty project, or a console project. Make sure you're not using any Windows API.

Upvotes: 3

Ernest Friedman-Hill
Ernest Friedman-Hill

Reputation: 81704

A "Windows Console Project". And go in the project preferences and turn off "Use Precompiled Headers."

Upvotes: 2

Fox32
Fox32

Reputation: 13560

Add your include #include <iostream> after the #include "stdafx.h" line. If you don't have this line add it as first line or disable the precompiled headers.

To disable precompiled headers:

Go to properties on your project, then C/C++, Precompiled Header and then Precompiled Headers - Don't use precompiled headers.

Upvotes: 1

Related Questions