Solved

Help! Easy Question About Compiling....

Posted on 2000-03-11
16
193 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
How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

 

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

What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

Join & Write a Comment

C++ Properties One feature missing from standard C++ that you will find in many other Object Oriented Programming languages is something called a Property (http://www.experts-exchange.com/Programming/Languages/CPP/A_3912-Object-Properties-in-C.ht…
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 viewer will learn how to use the return statement in functions in C++. The video will also teach the user how to pass data to a function and have the function return data back for further processing.
The viewer will learn additional member functions of the vector class. Specifically, the capacity and swap member functions will be introduced.

707 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

15 Experts available now in Live!

Get 1:1 Help Now