views:

1975

answers:

3

Well, I just got the new MSVS 2010 Beta 1, and just like with 2008 express, I just can't figure out how to compile anything, not even a simple hello world program. Anyone have any pointers? I usually just get a blanket fail message. No real information.

Edit: Sorry about that

#include <iostream>
using namespace std;

main()
{
    cout << "hello world";
    return 0;
}

I go to build and I get:

1>------ Build started: Project: forkicks, Configuration: Debug Win32 ------

1>Embedding manifest...

1>.\Debug\forkicks.exe.intermediate.manifest : general error c1010070: Failed to load and parse the manifest. The system cannot find the file specified.

1>Build log was saved at "file://c:\Users\Randy\Documents\Visual Studio 2008\Projects\forkicks\forkicks\Debug\BuildLog.htm"

1>forkicks - 1 error(s), 0 warning(s) ========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========

That is 2008

1>------ Build started: Project: For Kicks, Configuration: Debug Win32 ------
1>Build started 7/22/2009 9:36:39 PM.
1>_PrepareForBuild:
1>  Creating directory "Debug\".
1>  Creating "Debug\lastbuild.timestamp" because "AlwaysCreate" was specified.
1>ClCompile:
1>  main.cpp
1>c:\users\randy\documents\visual studio 10\projects\for kicks\main.cpp(5): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>
1>Build FAILED.
1>
1>Time Elapsed 00:00:01.63
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========

is 2010. I create a win32 project, name it, etc. Right click on source file, add a C++ file with no headers or anything. Just a blank document.

New 2010:

1>------ Build started: Project: hoyeah, Configuration: Debug Win32 ------
1>Build started 7/22/2009 10:03:35 PM.
1>_PrepareForBuild:
1>  Creating directory "Debug\".
1>  Creating "Debug\lastbuild.timestamp" because "AlwaysCreate" was specified.
1>PrepareForBuild:
1>  Creating directory "C:\Users\Randy\Desktop\C++ Programs\hoyeah\Debug\".
1>ClCompile:
1>  test.cpp
1>ManifestResourceCompile:
1>  Microsoft (R) Windows (R) Resource Compiler Version 6.1.7000.0
1>  
1>  Copyright (C) Microsoft Corporation.  All rights reserved.
1>  
1>  
1>MSVCRTD.lib(crtexew.obj) : error LNK2019: unresolved external symbol _WinMain@16 referenced in function ___tmainCRTStartup
1>C:\Users\Randy\Desktop\C++ Programs\hoyeah\Debug\hoyeah.exe : fatal error LNK1120: 1 unresolved externals
1>
1>Build FAILED.
1>
1>Time Elapsed 00:00:01.25
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========

Edit #2. How exactly would I go about changing it to multibyte?

+3  A: 

int main() maybe ?

Try also changing the destination of the project to something simpler and not that long since I believe I also had the same error when the destination was too long.

Also did you choose a console application when creating the project?

If that didn't help, google gave this as possible answers too :

  • "You could try going to your project's Properties > Configuration Properties > Manifest Tool > Input and Output, and set your "Embed Manifest" option to "No"."

  • "I had a similar problem like this a few months ago and I solved it by going to project -> properties -> Configuration Properties -> General -> Character set. Under character set I changed it to Use Multi-Byte Character Set and then my compliment issue went away."

Edit:

In regard to the latest error link here directly from microsoft. I'm afraid that from this point on it's google time as I'm all out of ideas if it doesn't work.

The link says : "As a workaround for Beta1 you can change the entry point to use "wmain" instead of "main" or change the character set of your project to use "Multi-Byte Character Set""

Easiest would be to just change the name of main to wmain then.

Milan
Ok, got it to work as a CLR console application in 2008. But, I can't get it to work on the win32 console application. Tried in main(). Moved the directory to desktop/folder
Lonestar
+5  A: 

That's a well known problem with VS10 Beta. You need to change the default encoding to Multibyte from Unicode to make it work.

Nemanja Trifunovic
Where do I find the setting though?
Lonestar
Project > Properties > Configuration Properties > General > Character Set
Nemanja Trifunovic
+1  A: 

Ok, I got it to compile using a win32 console ap, changing to Multibyte, and using the following code:

    #include <iostream>

using namespace std;

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

Now to try to figure something else out. I'm not used to VS so...

Thanks everyone.

Lonestar
You should mark Nemanja's answer as correct.
changelog