Link to home
Start Free TrialLog in
Avatar of bradster
bradster

asked on

Errors building samples in MSVC++5

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)
Avatar of galkin
galkin

Just rename all .c file into .cpp files. This problem is caused by compiler so it creates different obj file for c and cpp.
Avatar of bradster

ASKER

Renaming *.c to *.cpp is not the solution, it causes even more errors (and still won't build) sorry.  Anyone else?
ASKER CERTIFIED SOLUTION
Avatar of chensu
chensu
Flag of Canada image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
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!!!