?
Solved

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

Posted on 2007-11-21
6
Medium Priority
?
1,712 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 1600 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 400 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
Why Off-Site Backups Are The Only Way To Go

You are probably backing up your data—but how and where? Ransomware is on the rise and there are variants that specifically target backups. Read on to discover why off-site is the way to go.

 
LVL 35

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

Why Off-Site Backups Are The Only Way To Go

You are probably backing up your data—but how and where? Ransomware is on the rise and there are variants that specifically target backups. Read on to discover why off-site is the way to go.

Question has a verified solution.

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

Setting up Secure Ubuntu server on VMware 1.      Insert the Ubuntu Server distribution CD or attach the ISO of the CD which is in the “Datastore”. Note that it is important to install the x64 edition on servers, not the X86 editions. 2.      Power on th…
In my business, I use the LTS (Long Term Support) versions of Linux. My workstations do real work, and so I rarely have the patience to deal with silly problems caused by an upgraded kernel that had experimental software on it to begin with from a r…
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…
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.
Suggested Courses
Course of the Month11 days, 16 hours left to enroll

752 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