Solved

Help! Easy Question About Compiling....

Posted on 2000-03-11
16
224 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

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
 

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

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

When writing generic code, using template meta-programming techniques, it is sometimes useful to know if a type is convertible to another type. A good example of when this might be is if you are writing diagnostic instrumentation for code to generat…
This article shows you how to optimize memory allocations in C++ using placement new. Applicable especially to usecases dealing with creation of large number of objects. A brief on problem: Lets take example problem for simplicity: - I have a G…
The viewer will learn how to user default arguments when defining functions. This method of defining functions will be contrasted with the non-default-argument of defining functions.
The viewer will be introduced to the technique of using vectors in C++. The video will cover how to define a vector, store values in the vector and retrieve data from the values stored in the vector.

749 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