Solved

Problems compiling .cpp file with makefile on Ubuntu Fiesty Fawn 7.04

Posted on 2007-11-21
6
1,682 Views
Last Modified: 2013-11-15
I'm trying to compile an open source program under Ubuntu Fiesty Fawn 7.04.

The files I have are Makefile and main.cpp.

When I run Make, it seems to run fine.

However, I obviously do not know the correct syntax to compile it from there.  I have tried a number of commands, and none seem to be working.

What command(s) should I be using to compile this?
0
Comment
Question by:keihatsu
6 Comments
 
LVL 13

Expert Comment

by:WizRd-Linux
Comment Utility
gccp main.cpp

To find out if gccp is already avaliable to you, other than the obvious of running it, type "which gccp"

The program gccp can be installed from the package gcc-gnat with "apt-get install gcc-gnat".
0
 
LVL 43

Accepted Solution

by:
ravenpl earned 400 total points
Comment Utility
Have You issued
./configure
first in the open source program first?
IT should show You what You are missing
apt-get install gcc-c++ # may be the first problem.
0
 
LVL 4

Assisted Solution

by:jcoombes
jcoombes earned 100 total points
Comment Utility
The usual sequence of commands for something built using the GNU build system is:

>./configure  
>make
>make install

Depending on your rights, you might need to run the last command as either root, or using sudo like this:

>sudo make install

If the program doesn't use the GNU build system, then there should hopefully be an INSTALL or README document in the source directory that describes how you go about compiling it.

Cheers


JC
0
Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

 
LVL 34

Expert Comment

by:Duncan Roe
Comment Utility
.cpp files are or should be compile-able by the GNU C++ compiler gcc (or g++ which gcc will invoke for you). You should use g++ in the line that actually links the executable - it will use the correct library defaults for c++.
Make sure you have g++ installed.
0
 
LVL 1

Expert Comment

by:ClawfootSupply
Comment Utility
Ah, wasn't aware that I needed to use ./configure.  That did the trick.

Thanks.
0
 
LVL 3

Author Closing Comment

by:keihatsu
Comment Utility
That last comment was from me... apparently one of my coworkers must have used my computer while I was away from it... and left me logged in as them.

I did just miss using ./configure however.  Thanks.
0

Featured Post

Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

Join & Write a Comment

Suggested Solutions

If you have a server on collocation with the super-fast CPU, that doesn't mean that you get it running at full power. Here is a preamble. When doing inventory of Linux servers, that I'm administering, I've found that some of them are running on l…
The purpose of this article is to fix the unknown display problem in Linux Mint operating system. After installing the OS if you see Display monitor is not recognized then we can install "MESA" utilities to fix this problem or we can install additio…
Connecting to an Amazon Linux EC2 Instance from Windows Using PuTTY.
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.

771 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now