FRIHOST FORUMS SEARCH FAQ TOS BLOGS COMPETITIONS
You are invited to Log in or Register a free Frihost Account!


compiling and linking files in VC++





riyadh
i have a program that replaces the standard cout function to print things on the screen. i have made a a header file with function prototypes, a main() program that uses these functions, and a func.cpp program that defines how the the function prototypes in the header files are used. i use the command line interface in VS to compile programs. so how do i go on compiling the main() program wwhilst linking it with the func.cpp so that it can use the functions?
Fire Boar
Well, I'm assuming you've got

Code:
#include "func.h"


In your main c++ file (assuming the header file is called func.h and the file with main in it is main.cpp). Then in the command you're using, you would add func.cpp onto the end.

Not sure what it is on Visual C++, but I'll give you a MinGW example and you can then adapt.

Code:
g++ -o output.exe main.cpp func.cpp


Give it a shot by adapting the above to the Visual Studio syntax.
Related topics
dot files
req: PHP to list files in directory, and link to them
Help: SQL error after uploading new files(thread updated)
The Unofficial Jokes Thread
deleting all the original files
[tutor] How to protect images without htaccess using PHP
.rm files
Is it possible to upload music files to a website?
Hosting, abuse and useless files
Power PC / Intel Mac Users - Code Compiling Required
Site de acompanhantes
Linking to unreleased MP3 files
Linking to MP3's?
Finding full website log files
Reply to topic    Frihost Forum Index -> Scripting -> Others

FRIHOST HOME | FAQ | TOS | ABOUT US | CONTACT US | SITE MAP
© 2005-2011 Frihost, forums powered by phpBB.