Hello,

I edited a source code I found on a net and now it compiles well. I get a linker error.

1>Linking...
1>MSVCRT.lib(crtexe.obj) : error LNK2001: unresolved external symbol _main
1>C:\Users\jan\Documents\Visual Studio 2005\Projects\YAST server console\Release\YAST server console.exe : fatal error LNK1120: 1 unresolved externals
1>Build log was saved at "file://c:\Users\jan\Documents\Visual Studio 2005\Projects\YAST server console\YAST server console\Release\BuildLog.htm"
1>YAST server console - 2 error(s), 0 warning(s)
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========

I have included:

#include <stdlib.h>
#include <windows.h>
#include <winsock.h>  
#include <stdio.h>
#include <commctrl.h>
#include <Winuser.h>
#include <iostream>
#include <time.h>
#include <mmsystem.h>

and this is in my liker options:

ws2_32.lib wsock32.lib winmm.lib

What else do I have to add to linker options?

Recommended Answers

All 2 Replies

The error indicates the program does not have a main() function -- maybe you did not create the correct type of project, such as you created a console project when you should have created a windows project.

hmm...you are right...

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.