Solved

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

Posted on 2007-11-21
6
1,687 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
Complete VMware vSphere® ESX(i) & Hyper-V Backup

Capture your entire system, including the host, with patented disk imaging integrated with VMware VADP / Microsoft VSS and RCT. RTOs is as low as 15 seconds with Acronis Active Restore™. You can enjoy unlimited P2V/V2V migrations from any source (even from a different hypervisor)

 
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

Suggested Solutions

Title # Comments Views Activity
AWS RDS 3 68
nagios alerts 3 33
Why isn't object file created? 6 42
how can I get powershell to show the history of commands used ? 10 45
The purpose of this article is to demonstrate how we can upgrade Python from version 2.7.6 to Python 2.7.10 on the Linux Mint operating system. I am using an Oracle Virtual Box where I have installed Linux Mint operating system version 17.2. Once yo…
Join Greg Farro and Ethan Banks from Packet Pushers (http://packetpushers.net/podcast/podcasts/pq-show-93-smart-network-monitoring-paessler-sponsored/) and Greg Ross from Paessler (https://www.paessler.com/prtg) for a discussion about smart network …
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…
Learn how to navigate the file tree with the shell. Use pwd to print the current working directory: Use ls to list a directory's contents: Use cd to change to a new directory: Use wildcards instead of typing out long directory names: Use ../ to move…

920 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

16 Experts available now in Live!

Get 1:1 Help Now