Sign in to follow this  

problem compiling

This topic is 3668 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

ok, i'm a newbie programmer and am learning on my own from online tutorials and books. i had been doing simple programs using Visual C++, but then i stopped because of personal issues, but today i started back up. before the programs i wrote seemed to all work fine, but now the compiler gives me an "unresolved external" error. i have this code from a tutorial site:
#include <iostream>

using namespace std;

int main()
{
	cout<<"Hey, you, I'm alive! Oh, and Hello World!\n";
	cin.get();
}

on the site it says this program works, but for some reason it, like i said, gives me the unresolved external error. if someone has any info for me, plz let me know what's wrong. also, if u think it may have something to do with not having a return value set up, i tried using 'return 0;' and got the same result, except without the return value warning. thanks ahead for the help

Share this post


Link to post
Share on other sites
ok, when i run the compile, it says this pasted below:


--------------------Configuration: app - Win32 Debug--------------------
Compiling...
app.cpp
Linking...
LIBCD.lib(wincrt0.obj) : error LNK2001: unresolved external symbol _WinMain@16
Debug/app.exe : fatal error LNK1120: 1 unresolved externals
Error executing link.exe.

app.exe - 2 error(s), 0 warning(s)



i have no idea what it means either, i've never seen it before, and i've even tried running simple calculator programs i know should work and they still don't

Share this post


Link to post
Share on other sites
That error means that when you created your project you created a windows application rather than a console application. Go to your linker settings and change the subsystem from windows to console. Depending on your version of MSVC it may be under Linker/System/SubSystem.

Share this post


Link to post
Share on other sites

This topic is 3668 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this