Solved

Errors building samples in MSVC++5

Posted on 1997-11-26
4
300 Views
Last Modified: 2012-08-13
I'm a beginner and that is why I can't solve this myself, not knowing code well enough to spot the errors.
The errors occur when I try to build certain samples which are included in the MSVC++5 Win32 samples folder.
(I've applied Visual Studio Service Pack-2, didn't help)

The errors allways occur when I try to build the samples/projects with *.c files in them, the samples that have *.cpp files don't cause these errors:
   "error LNK2001: unresolved external symbol"
   "fatal error LNK1120: unresolved externals"

I've done a search in InfoViewer on the error and it said it's probabily due to "external" or "inline" functions, but again I'm just learning and can't (at this point) spot the problem in the source code.
Could someone point out the code I need to adjust to allow these to build properly? or perhaps advise on how to do the build so they will not error.
I've tried building the projects two ways:
1.) simply clicking on the *.c file and answering "yes" to the prompt for a workspace.
2.) creating a project (Win32) and importing the files.
neither method builds the examples.


The examples (all have) the error:

Trying to build the "Wizard" example;
Compiling...
WIZARD.C
Linking...
WIZARD.OBJ : error LNK2001: unresolved external symbol __imp__PropertySheetA@4
LIBCD.lib(crt0.obj) : error LNK2001: unresolved external symbol _main
Debug/WIZARD.exe : fatal error LNK1120: 2 unresolved externals
Error executing link.exe.
WIZARD.exe - 3 error(s), 0 warning(s)

Trying to build the "generic" example;
GENERIC.exe - 5 error(s), 0 warning(s)

Trying to build the "Shell extension" example;
SHELLEXT.exe - 17 error(s), 0 warning(s)

Trying to build the "registry API" example;
MONKEY.exe - 2 error(s), 1 warning(s)

Trying to build the "Shell extension" example;
CDTEST.exe - 10 error(s), 0 warning(s)

Trying to build the "common dialogs" example;
COMDLG32.exe - 2 error(s), 0 warning(s)
0
Comment
Question by:bradster
[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
  • 2
4 Comments
 
LVL 7

Expert Comment

by:galkin
ID: 1174164
Just rename all .c file into .cpp files. This problem is caused by compiler so it creates different obj file for c and cpp.
0
 

Author Comment

by:bradster
ID: 1174165
Renaming *.c to *.cpp is not the solution, it causes even more errors (and still won't build) sorry.  Anyone else?
0
 
LVL 23

Accepted Solution

by:
chensu earned 20 total points
ID: 1174166
Every example you tried has a file named MAKEFILE inside. Choose the menu File/Open Workspace and change the Files of type to All Files (*.*), then open the MAKEFILE. Thus, you can build the examples.
0
 

Author Comment

by:bradster
ID: 1174167
That is the correct answer! good show 'chensu', I opened the file as you said and they built without errors.
The only thing I had to do was rename the 'makefile' because it causes the project to be named 'makefile' so I renamed 'makefile' to "<ProjectName>.mak"' and the samples built with the correct names!!!
Thanks 'chensu', good advise!!!
0

Featured Post

Independent Software Vendors: 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!

Question has a verified solution.

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

Errors will happen. It is a fact of life for the programmer. How and when errors are detected have a great impact on quality and cost of a product. It is better to detect errors at compile time, when possible and practical. Errors that make their wa…
Container Orchestration platforms empower organizations to scale their apps at an exceptional rate. This is the reason numerous innovation-driven companies are moving apps to an appropriated datacenter wide platform that empowers them to scale at a …
The viewer will learn how to pass data into a function in C++. This is one step further in using functions. Instead of only printing text onto the console, the function will be able to perform calculations with argumentents given by the user.
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.

630 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