Solved

Help! Easy Question About Compiling....

Posted on 2000-03-11
16
201 Views
Last Modified: 2012-05-04
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!
0
Comment
Question by:swhitlow
  • 8
  • 4
  • 2
  • +2
16 Comments
 
LVL 5

Expert Comment

by:Wyn
ID: 2608877
Shut down the linking with MFC option in the project setting.
0
 
LVL 5

Expert Comment

by:Wyn
ID: 2608904
Btw:It seems you choose a .exe project.But for control panel,you'd choose a dll project.
0
 

Author Comment

by:swhitlow
ID: 2608905
I don't have it linking in with it.
0
 

Expert Comment

by:eugene007
ID: 2608915
Please check your header files.

Regards

Eugene
0
 
LVL 5

Expert Comment

by:Wyn
ID: 2608924
If you choose console project but write WinMain or some like that and vice versa,you got this!!
Choose the right project.
0
 

Author Comment

by:swhitlow
ID: 2608965
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
 
LVL 5

Expert Comment

by:Wyn
ID: 2609027
You can mail to yinansuibi@163.net
0
 
LVL 5

Expert Comment

by:Wyn
ID: 2609028
Btw:I dont think that's your problem
Again,a contrl panel should be .dll.Why yours is .exe?
0
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 

Author Comment

by:swhitlow
ID: 2609038
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
 
LVL 5

Expert Comment

by:Wyn
ID: 2609046
That's what I have mentioned.
How this comes?
Debug/cplmain.exe

You'd change the project.
0
 

Expert Comment

by:YuraPhink
ID: 2609158
This Linker Error says that you did not defined the main function!
0
 
LVL 5

Expert Comment

by:Wyn
ID: 2609161
->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
 
LVL 22

Accepted Solution

by:
nietod earned 100 total points
ID: 2609328
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
 

Author Comment

by:swhitlow
ID: 2609635
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
 
LVL 5

Expert Comment

by:Wyn
ID: 2609682
Hmm , maybe I'm too lazy:(
0
 
LVL 22

Expert Comment

by:nietod
ID: 2609707
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

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
TTimer no longer functioning 7 84
Find Visual Studio Tools 2 92
GUI: DIalog Stacking and Popping in MS C++ 4 65
Embarcadero C++ Builder XE10.1 Berlin red arrow Indicator 2 13
Written by John Humphreys C++ Threading and the POSIX Library This article will cover the basic information that you need to know in order to make use of the POSIX threading library available for C and C++ on UNIX and most Linux systems.   [s…
Many modern programming languages support the concept of a property -- a class member that combines characteristics of both a data member and a method.  These are sometimes called "smart fields" because you can add logic that is applied automaticall…
The goal of the video will be to teach the user the concept of local variables and scope. An example of a locally defined variable will be given as well as an explanation of what scope is in C++. The local variable and concept of scope will be relat…
The viewer will be introduced to the member functions push_back and pop_back of the vector class. The video will teach the difference between the two as well as how to use each one along with its functionality.

914 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now