Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to compile C source codes with MS Visual C++ 2005 Express Edition

Status
Not open for further replies.

qjade

Programmer
Jun 7, 2004
42
0
0
US
Hello friends,
I have been given the source codes to an old/ancient program by the creator. It consist of seven *.c files and two *.h header files. It has been over a decade since I wrote anything in C so please pardon this simple question. I am attempting to compile these files into its orginal executable program but am unsuccessful. The creator has assured me that all codes are included and are correct.
I downloaded both Borland compiler (Freecommandlinetools) as well as MS Visual C++ 2005 Express Edition to try compiling the codes. If anyone has any simple instruction on how to create and compile this project in either of the mentioned compiler I would greatly appreaciate it.
Thank you for reading and hopefully - replying.

 
Go into your project's Properties, then go to: C/C++, Advanced. Change the "Compile As" to "Compile as C code". I think that's all you should need to do.
 
[tt]bcc32 *.c[/tt]
Might do the trick, if it's a simple command line application.

--
 
Thank you for replying gents.

cpjust - Your suggestion seems to be on the right track. Now I am stuck with just one error message instead of 500+. The error is

fatal error C1083: Cannot open include file: 'resource.h': No such file or directory

I have searched my hardrive for "resource.h" and found too many of them. Do you have any idea which one I should be using or does it not matter? The creator did not forward me his resource.h file so my question is do I need his to compile? Is the file program-specific or can I use the generic one in the template MS VC8 directory?

++++++++++++
Salem: What is bcc32*.c? Although this program is quite a complicated one...I am desperate enough to try anything.

Thanks again friends.
 
bcc32 - the name of your compiler (one of them at least). If you've set the paths properly, you should get some useful information when you do say [tt]bcc32 /?[/tt] or [tt]cl /?[/tt] (or perhaps -h, -help).

*.c simply means all C files in the current directory, to save you the trouble of naming them all individually, which you can still do.

--
 
Did you create a Win32 Console App?
Is "resource.h" being #included in one of the 9 files you were given, or did Visual Studio create a file with a default _tmain() function and include it there...?
 
cpjust,
I have tried both method (Windows App and Console App) and both are giving me the same error of not being able to open the resource.h file. "Resource.h" is #included in one of my nine *.c file. The creator did not provide me with a resource.h file nor did I include one in my project prior to compiling. I was assuming that it is utilizing the standard file from the C:\Program Files\Microsoft Platform SDK\Include path, however, none were found there. Can I copy and paste any "resource.h" file from elsewhere in there or will that be a total mistake?
Thanks for replying and the incredible help you are giving me.
 
Try commenting out that #include statement and see if you actually need that file.
 
cpjust,
I have tried to comment out the #include "resource.h" line. That only gave me two new errors
1) error C2065: 'PaexrecsDelimiter' : undeclared identifier
2) error C2065: 'ExportDateReceipt' : undeclared identifier

This made me believe that the resource.h file is program specific and not the generic one. I just want someone that is knowledgable to concur with me the fact that I need this particular file from the creator or if there is a workaround for this dilemma of mine.
 
It seems to me that whoever gave you the code didn't give you all of the files.


--
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top