Solved

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

Posted on 2007-11-21
6
1,689 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
ID: 20332245
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
ID: 20333093
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
ID: 20333323
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
Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

 
LVL 34

Expert Comment

by:Duncan Roe
ID: 20336201
.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
ID: 20349675
Ah, wasn't aware that I needed to use ./configure.  That did the trick.

Thanks.
0
 
LVL 3

Author Closing Comment

by:keihatsu
ID: 31410502
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

Efficient way to get backups off site to Azure

This user guide provides instructions on how to deploy and configure both a StoneFly Scale Out NAS Enterprise Cloud Drive virtual machine and Veeam Cloud Connect in the Microsoft Azure Cloud.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

If you use Debian 6 Squeeze and you are tired of looking at the childish graphical GDM login screen that is used by default, here's an easy way to change it. If you've already tried to change it you've probably discovered that none of the old met…
1. Introduction As many people are interested in Linux but not as many are interested or knowledgeable (enough) to install Linux on their system, here is a safe way to try out Linux on your existing (Windows) system. The idea is that you insta…
Learn how to get help with Linux/Unix bash shell commands. Use help to read help documents for built in bash shell commands.: Use man to interface with the online reference manuals for shell commands.: Use man to search man pages for unknown command…
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.

810 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