473,321 Members | 1,669 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,321 software developers and data experts.

Linker error in Hello World program

bajajv
152 100+
Hi,
I am using Visual Studio 2005. And this basic code is giving the error-
#include <windows.h>

int WINAPI WinMain ( HINSTANCE hInstance,
HINSTANCE hPrevInstance,
PSTR szCmdLine,
int nCmdShow )
{
MessageBox(NULL, TEXT("Hello World"), TEXT("Vipul Bajaj"), 0);
return 0;
}
The error is
MSVCRTD.lib(crtexe.obj) : error LNK2019: unresolved external symbol _main referenced in function ___tmainCRTStartup

Plz help.
Jul 26 '09 #1
2 1740
i'm not sure if this is of any help to you at all, but i just compiled it with MinGW (bloodshed devc++) and it ran fine.

this might be a dumb answer, but maybe its your compiler? thats a pretty simple script to not run. you could also try starting a "new project" or whatever you do in MSVC++. i guess it could be a bad linker.
Jul 26 '09 #2
Banfa
9,065 Expert Mod 8TB
It looks to me like you created a command line project which expects main to exist as is normal for C/C++ programs.
Jul 26 '09 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

4
by: hpy_awad | last post by:
What are the reasons of that message ? linker error fixup overflow at 'seg:xxxx' h,target = 'symbol' in module 'module' I am just compiling a small program under Borland C++ ver 3. #include...
7
by: Nadina | last post by:
Hello, I have been getting the following error: ld: fatal: file my_program: creation interrupted: No space left on devicecollect2: ld returned 1 exit status while I was trying to link...
1
by: Laszlo | last post by:
Hi all, As a novice I installed PostgreSQL 7.2.1 on Win32 and works, Borland C++Builder Enterprise Suite 5.0 (build 12.34) what works too. I decided to combine these two programs and develop a...
1
by: sg10241024 | last post by:
Hello, I'm programming MS Visual Studio. Net 2003 Professional. I'm a beginner and now I have a problem while building my new program. I've got linker error LNK2001: unresolved external symbol...
3
by: Ninan | last post by:
I am using gcc compiler gcc B.o Main.o -lMyLib //A.h class A { public: A(); void abc ();
3
by: Vijay Bajwa | last post by:
I declared a static std::map<string, intin one.cpp at the module level. This is only used inside the file and I did it to avoid global namespace pollution The file one.o goes into the library...
3
by: Stephon Woodland | last post by:
Hello everyone/anyone, I am a stutdent with UoP online. I just learning the IT world and the class I am taking right now is "Programming Concepts" using the C programming language. I have just...
12
by: kath.neumann | last post by:
Hi, I just started to get a grip on C++ and and went through the tutorial. However, not even the standard "hello world" exercise works out :( I do get a linker error " Unresolved external...
1
by: Oltmans | last post by:
Hi all, I've been writing C# code using Visual Studio 2005 for some time now but for the first time I've to write ANSI C code using Visual Studio 2005. I followed this article...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.