473,385 Members | 1,355 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

How do I run an entire program with the source code ?

Hunderpanzer
I'm trying to learn a little by looking at source codes from free downloaded programs.

There's a bunch of .cpp files and .h files, but I'm not sure of how to compile all the files into one .exe so I can see the actual program.

Sorry for the newb questions
Jul 23 '07 #1
4 1441
JosAH
11,448 Expert 8TB
I'm trying to learn a little by looking at source codes from free downloaded programs.

There's a bunch of .cpp files and .h files, but I'm not sure of how to compile all the files into one .exe so I can see the actual program.

Sorry for the newb questions
A simple approach is this:

1) download the .cpp and .h files.
2) compile (but don't link) all the .cpp files
4) link everthing together.

Of course you can structure this a bit more, i.e.2) stick all the .o files (or .obj
files if you're being torured by microsoft) in a library (.a or .lib files)

kind regards,

Jos
Jul 23 '07 #2
A simple approach is this:

1) download the .cpp and .h files.
2) compile (but don't link) all the .cpp files
4) link everthing together.

Of course you can structure this a bit more, i.e.2) stick all the .o files (or .obj
files if you're being torured by microsoft) in a library (.a or .lib files)

kind regards,

Jos

I'm sorry I'm still a bit confused... I'm used to only compiling my own source files that is only one file. How would I compile all the .cpp files ? I'm not even sure of what linking is .

When I try compiling one, there's always something undefined (which i'm sure is defined in some other file).
Jul 23 '07 #3
weaknessforcats
9,208 Expert Mod 8TB
I'm sorry I'm still a bit confused... I'm used to only compiling my own source files that is only one file. How would I compile all the .cpp files ? I'm not even sure of what linking is .
Your comment indicates that you do not understand the build procedure for C/C++. Rather than explain it here, you would be better learning this from a book or maybe an onoine tutorial.

This is explained in the "C++ Primer Plus" 5th Ed. by Stephen Prata beginning on page 393.
Jul 23 '07 #4
Your comment indicates that you do not understand the build procedure for C/C++. Rather than explain it here, you would be better learning this from a book or maybe an onoine tutorial.

This is explained in the "C++ Primer Plus" 5th Ed. by Stephen Prata beginning on page 393.

The book I have doesn't explain it too well... I'll look online for some tutorials.

Thanks
Jul 23 '07 #5

Sign in to post your reply or Sign up for a free account.

Similar topics

9
by: TCMA | last post by:
I am looking for some tools to help me understand source code of a program written in C++ by someone else. Are there any non-commercial, open source C or C++ tools to reverse engineer C or C++...
11
by: christopher diggins | last post by:
I am wondering if any can point me to any open-source library with program objects for C++ like there is in Java? I would like to be able to write things like MyProgram1 >> MyProgram2 >>...
7
by: Prashanth Badabagni | last post by:
Hi , I'm Prashanth Badabagni .. I have and idea how a program prints it's own source code .. void main() { FILE *P; char *file,c; strcpy(file,__FILE__); p=fopen(file,"r");
1
by: Dean Bortell | last post by:
I have a program that encrypts a datetime objects "to long datetime string" string to and encrypted sequence. The problem is this: if I use the following source code it works (key is declared...
3
by: Son KwonNam | last post by:
Hello, When there a two forms like the follosings, <form name="source"> <input name="a..." value=".." ..> <input name="a..." value=".." ..> <input name="a..." value=".." ..> <input...
5
by: snramkumar | last post by:
How to create an executable version of the entire Web site without any source code. Best Regards, S.N.Ramkumar.
62
by: Ajinkya | last post by:
As "spawnl" executes an exe through C code., similarly how can we compile a C program through another C program (on Windows platform) ?
1
Curtis Rutland
by: Curtis Rutland | last post by:
How To Use A Database In Your Program Part II This article is intended to extend Frinny’s excellent article: How to Use a Database in Your Program. Frinny’s article defines the basic concepts...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.