error trying to compile a c++ source file


 
Thread Tools Search this Thread
Top Forums Programming error trying to compile a c++ source file
# 1  
Old 03-05-2002
error trying to compile a c++ source file

i tried to compile a c++ file using the g++ command:

g++ <filename>.cpp -out <output_file>

and i received the following error message:

ld.so.1: gcc: fatal: relocation error: file gcc: symbol bindtextdomain: referenced symbol not found
Killed

is it that i am using incorrectly the command?
# 2  
Old 03-05-2002
What kind of system is this?
I have two comments: You need a space between -o and the binay file, like this: -o ut
The file will then be called ut.
Also, cpp is an unusual extension, most often c++ program either have .c++ or .C as extension, whereas C files have .c.

Try to create the file tst.C:
#include <iostream.h>
main
{
cout << "Hello\n";
}

Then compile:

$ g++ tst.C -o tst

Then run
$ ./tst

If there is still no go, you may have a non-standard system.

BTW: CPP is the C PreProcessor, shows you the code after macro expansions,etc.

Atle
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Programming

Create a C source and compile inside Python 1.4.0 to 3.7.0 in Python for ALL? platforms...

Hi all... As you know I like making code backwards compatible for as many platforms as possible. This Python script was in fact dedicated for the AMIGA A1200 using Pythons 1.4.0, 1.5.2, 1.6.0, 2.0.1, and 2.4.6 as that is all we have for varying levels of upgrades from a HDD and 4MB FastRam... (1 Reply)
Discussion started by: wisecracker
1 Replies

2. UNIX for Dummies Questions & Answers

NDM: Source file open failed. Error= 2

Hi, I have try to ndm to one server to another server. but i am getting this error. what is this error? are files not in source folder? Source file open failed. Error= 2 Regards, Balamurgan (1 Reply)
Discussion started by: krbala1985
1 Replies

3. Programming

Compile and debug Vim source code

Hi, I want to debug Vim source code with GDB but I can't get it. It seems to run without debugger. Here is my try. I have supressed output of most commands. Tell me if you need them. $ uname -mor 2.6.37-ARCH i686 GNU/Linux $ mkdir ~/birei && cd ~/birei $ wget... (2 Replies)
Discussion started by: birei
2 Replies

4. AIX

How to compile a package in AIX when we download its source?

How to compile a package surce in AIX when we download its source? (2 Replies)
Discussion started by: johnveslin
2 Replies

5. Shell Programming and Scripting

source a property file in script give error

I have sourced a property file in my script like this to load some variables in the script Then i am able to echo all the property file values inside script but the script is not able to recognize other unix commands #!/bin/bash . build.properties mkdir build i am getting error ... (3 Replies)
Discussion started by: codeman007
3 Replies

6. Solaris

Error when compile source code

Hello,I'm trying to compile source code for Nmap. My $PATH /usr/sbin:/usr/bin:/usr/openwin/bin:/usr/ucb:/usr/local/bin:/usr/css/bin I type ./configure and all goes great.When I type ./make or ./make it says make not found.Why?I need a correct path for make?Thanks in advance. (2 Replies)
Discussion started by: bgf0
2 Replies

7. UNIX and Linux Applications

How to compile from source code?

Hi all, I downloaded the source code for a pkg. But i dont know how to build from it? I have no prior experience in building from source,so could you pls help me? I tried ./configure(after entering into the dir containing the src codes) but it generated some errors!!!!! Some files... (1 Reply)
Discussion started by: wrapster
1 Replies

8. SuSE

How do I compile source undfer Suse Linux?

I've been usuing Suse 9.1 & 10 on 2 different machines for a while and have so far relied on ready compiled versions of programs in RPMs in order to install them. I'm unclear what is envolved in compiling from the source code myself. I did a general google on the topic and found some unclear... (3 Replies)
Discussion started by: Mark Ward
3 Replies

9. AIX

RS/6000 gcc compile large file error

hi, everybody£º i have a question, pls help me¡£ OS : RS/6000 AIX 4.3.3 cPU : Powerpc,POWER3 compiler : gcc 3.2.3 source file £º 8M OS kernel : 32 bit (selecting at installing operating system, the hardware support 64 bit) when i compiling the large source file (8 M), i... (3 Replies)
Discussion started by: q30
3 Replies

10. Programming

compile rpm-4.0 source

Hello Unix experts, I downloaded rpm-4.0 source from ftp.redhat.com and tried to make it. There are something I could not understand. - Makefile.in and Makefile.am instead of Makefile - file INSTALL doesn't show clearly the steps of compiling What are these 2 files, Makefile.in and... (2 Replies)
Discussion started by: eddie
2 Replies
Login or Register to Ask a Question