Help! Easy Question About Compiling....

I'm new to VC++ 6.0 and I am creating a Control Panel Applet using VC++ 6.0 and Visual Basic 6.0. But, when I try and build the project in VC++ it gives me this error in the debug window:

Compiling...
cplmain.c
Linking...
LIBCD.lib(crt0.obj) : error LNK2001: unresolved external symbol _main
Debug/cplmain.exe : fatal error LNK1120: 1 unresolved externals
Error executing link.exe.

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


Any ideas? I really need this quick and I haven't been able to fin the answer any where else.  Thanks in advance!
swhitlowAsked:
Who is Participating?

[Webinar] Streamline your web hosting managementRegister Today

x
 
nietodConnect With a Mentor Commented:
swhitlow, VC things you are trying to compile a win32 console program, which must have a main() function as an entry point.  

You need to compiler a DLL program.  You may be able to fix this by going to the linker options in the project settings and adding the "/DLL" option.

If that doesn't work, you can just recreate the project as a DLL project.   Delete all the project files.  (.dsp and .dsw) but leave the source code files.  Then create a new project and be sure the select the win32 DLL option for the prioject type.  Then add the source code files to the project using the "Project" menu "Add to Project" item "Files" item.
0
 
WynCommented:
Shut down the linking with MFC option in the project setting.
0
 
WynCommented:
Btw:It seems you choose a .exe project.But for control panel,you'd choose a dll project.
0
Never miss a deadline with monday.com

The revolutionary project management tool is here!   Plan visually with a single glance and make sure your projects get done.

 
swhitlowAuthor Commented:
I don't have it linking in with it.
0
 
eugene007Commented:
Please check your header files.

Regards

Eugene
0
 
WynCommented:
If you choose console project but write WinMain or some like that and vice versa,you got this!!
Choose the right project.
0
 
swhitlowAuthor Commented:
This might help solve this problem, this was a VC++ 5.0 project that I brought into VC++ 6.0. I don't know if that would make a difference or not. Is there anyone I could sent this project to so you could take a look at it?  Thanks!
0
 
WynCommented:
You can mail to yinansuibi@163.net
0
 
WynCommented:
Btw:I dont think that's your problem
Again,a contrl panel should be .dll.Why yours is .exe?
0
 
swhitlowAuthor Commented:
mine is not an .exe, it's a .dll. Actually, it will be a .cpl file when it's done but it's simply a dll file.
0
 
WynCommented:
That's what I have mentioned.
How this comes?
Debug/cplmain.exe

You'd change the project.
0
 
YuraPhinkCommented:
This Linker Error says that you did not defined the main function!
0
 
WynCommented:
->This Linker Error says that you did not defined the main function!
=================
As I have mentioned more than 3 times,please check the correct project(dll).

Regards
W.Yinan
0
 
swhitlowAuthor Commented:
Thanks very much to everyone that responded. I noticed after I resolved the error that some other people had the same solution as nietod, but, no one explained it in such an easy to understand way as he did.  Thanks!
0
 
WynCommented:
Hmm , maybe I'm too lazy:(
0
 
nietodCommented:
Sometimes it helps to come to a question late and see what was NOT said--not that I expected to get the points on this one.
0
All Courses

From novice to tech pro — start learning today.