Solved

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

Posted on 2007-11-21
6
1,702 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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
Three Reasons Why Backup is Strategic

Backup is strategic to your business because your data is strategic to your business. Without backup, your business will fail. This white paper explains why it is vital for you to design and immediately execute a backup strategy to protect 100 percent of your data.

 
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

Microsoft Certification Exam 74-409

Veeam® is happy to provide the Microsoft community with a study guide prepared by MVP and MCT, Orin Thomas. This guide will take you through each of the exam objectives, helping you to prepare for and pass the examination.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Zimbra on Amazon Linux help 7 115
winscp 000webhost.com 6 101
Linux Samba using Kerberos to Auth from Active Directory 9 93
Samba Question 11 108
SSH (Secure Shell) - Tips and Tricks As you all know SSH(Secure Shell) is a network protocol, which we use to access/transfer files securely between two networked devices. SSH was actually designed as a replacement for insecure protocols that sen…
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…
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…
Connecting to an Amazon Linux EC2 Instance from Windows Using PuTTY.

726 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