rangers99
asked on
Compiling C source code that includes a main() function using Visual C++
OK I am asking this question because Im thick.
I have a C source code (compress.c file) and a header (*.h) file. The compress.c file has a main() function so its not a Windows application. Its actually a compression algorithm source code. I will probably run it by going to the command line and typing
compress pic.gif
Or something similar. So how do I create the compress.exe using Visual C++? I assume I go to File->New->Project or something like that but I really dont know.
Can someone familiar with the required steps help me out?
I have a C source code (compress.c file) and a header (*.h) file. The compress.c file has a main() function so its not a Windows application. Its actually a compression algorithm source code. I will probably run it by going to the command line and typing
compress pic.gif
Or something similar. So how do I create the compress.exe using Visual C++? I assume I go to File->New->Project or something like that but I really dont know.
Can someone familiar with the required steps help me out?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
thanks mate.
Minimal steps:
open the main file in studio,
press f7 to build. yes, let it do workspace for you.
done. you may want to tweak the options, they default to debug and stuff... (no mfc will also be a default, it detects this in the build and its off if no win stuff is found).
open the main file in studio,
press f7 to build. yes, let it do workspace for you.
done. you may want to tweak the options, they default to debug and stuff... (no mfc will also be a default, it detects this in the build and its off if no win stuff is found).
HUH???
You'd do that on the command line:
cl.exe compress.c -I "<path to your .h-file>"
You'd do that on the command line:
cl.exe compress.c -I "<path to your .h-file>"
File->New->Win32 Console App
and then continue saying finish after giving filename.
Press Alt+F7 select, "no MFC Support"
Compile and Execute normally