Let's check your compiler:
Can you compile a hello world program?
Use this example code:
Save the file as hello.cpp
Compile and run with
Do you get any errors on either step?
If no errors, then compiler is okay. g++ and gcc behave differently with source files with a file extension of .c
g++ tries to compile .c files as as C++, not C. C syntax causes errors. Obviously because it is different from C++.
Try this as a compile:
If this works we have to look elsewhere for what is happening. C11 is not normally turned on by default AFAIK. The successful second command turns it on and if it works the problem is likely NOT your compiler.
Last edited by jim mcnamara; 06-30-2019 at 10:03 PM..
These 2 Users Gave Thanks to jim mcnamara For This Post:
i write c++ code it run perfectely with g++ compiler but same code when i compile with
GCC compiler it gives linker error , followed these linker error
/tmp/ccfZtXOQ.o(.text+0x22): In function `main':
conf_system.cpp: undefined reference to `operator new(unsigned int)'... (5 Replies)
Hi,
we are converting from IBM-AIX(xl c/c++ compiler) to Linux(GCC complier).
As a part of this i need to change the CFLAGS.
The xl c/c++ complier CFLAGS is
CFLAGS := $(CDEBUG) $(PROJECT_INCLUDE_DIRS) $(COBJECT_MODE) -qcpluscmt -qmakedep -qcheck=all \
-qalign=bit_packed $(LINT_FLAGS)... (0 Replies)
I am new to comiling c/c++ programs with gcc compilier
unix - AIX version 5.3
gcc compiler version - 4.0.0
My makefile.
# makefile 1.0 08/20/98
#CC = cc
CC = gcc
ESQL = esql
CFLAGS = -Wall
DBSLIB=
DBSLIB=-L${INFORMIXDIR}/lib/esql -L${INFORMIXDIR}/lib `esql -libs`
ALL = hds_near... (9 Replies)
Hi
I have locally compiled and installed gcc-4.1.2 in directory /usr/local/pkg/gcc/4.1.2/bin/gcc
I want to compile beecrypt using this new compiler , So i have done
setenv CC usr/local/pkg/gcc/4.1.2/bin/gcc ( Note this configuration is running properly with older version of... (1 Reply)
where to download gcc compiler for ubuntu?
how to install?
how to build and run "c programs"?
screen shots if possible.....:b::D
tutorials too:cool: (5 Replies)
Hi,
I need to install the GCC compiler on a my Linus machine.
First step is to run the ./configure command and here we need to specify
./configure --target="target machine name (CPU type-Manufacturer-OS)
or other way would be just give the command ./configure and it guesses the target name... (11 Replies)
Hi all
I'm trying to install sudo. When I first ran the sudo configure script it errored saying that I didn't have a C compiler. I have since installed the GCC 3.4.6 package for sol8 from sun freeware.
Doing that resolved the no C complier found error. I was then getting an error saying... (1 Reply)
Which gcc compiler release had the Arm 9 multicore support?Whether the compiler that used for the single Arm 9 core can be used for its multicore systems ?
If gcc not support,please tell me which are the compilers that are available for Arm 9 multicore systems (including commerical).Whether... (0 Replies)
hi,
can we install gcc compiler in unix based OS(sun solar,IBM AIX,HP,etc) and also
can we install sun cc compiler in AIX environment and vice versa.
and more ..is linux support cc compiler
regards
Ajay (3 Replies)
Discussion started by: ajaysahoo
3 Replies
LEARN ABOUT DEBIAN
hostname
FBB::Hostname(3bobcat) Host Info FBB::Hostname(3bobcat)NAME
FBB::Hostname - Contains name/address info about a host
SYNOPSIS
#include <bobcat/hostname>
Linking option: -lbobcat
DESCRIPTION
FBB::Hostname objects inherit from Hostent, and offers information about a host, like Hostent. Apart from being initialized by a hostname
or host address, they can also be initialized by a FBB::InetAddress object. Most of the functionality of an FBB::Hostname object is avail-
able through its parent-class FBB::Hostent.
NAMESPACE
FBB
All constructors, members, operators and manipulators, mentioned in this man-page, are defined in the namespace FBB.
INHERITS FROM
FBB::Hostent
CONSTRUCTORS
o Hostname():
The default constructor initializes an empty FBB::Hostname object.
o Hostname((std::string const &host)):
This constructor initializes an FBB::Hostname object from a string representing the name or dotted decimal address of a host. An
FBB::Errno object is thrown if the hostname information could not be retrieved.
o Hostname(InetAddress const &inetAddress):
This constructor initializes an FBB::Hostname object from an InetAddress object. An FBB::Errno object is thrown if the hostname
information could not be retrieved. The copy constructor is available.
MEMBER FUNCTIONS
All members of FBB::Hostent are available, as FBB::Hostname inherits from this class. There are no additional members.
EXAMPLE
#include <iostream>
#include <bobcat/hostname>
#include <bobcat/errno>
using namespace std;
using namespace FBB;
int main(int argc, char **argv)
{
while (true)
{
cout << "Enter name or address:
";
string str;
if (!getline(cin, str))
return 0;
if (str == "")
break;
try
{
Hostname h(str);
cout << "Official name:
";
cout << h.hostname() << endl;
cout << "Aliases:
";
for (size_t idx = 0; idx < h.nAliases(); idx++)
cout << h.alias(idx) << " ";
cout << endl;
cout << "Adresses:
";
for (size_t idx = 0; idx < h.nAddresses(); idx++)
cout << h.dottedDecimalAddress(idx) << " ";
cout << endl;
}
catch (Errno const &err)
{
cout << err.why() << endl;
}
}
return 0;
}
FILES
bobcat/hostname - defines the class interface
SEE ALSO bobcat(7), hostent(3bobcat)BUGS
None Reported.
DISTRIBUTION FILES
o bobcat_3.01.00-x.dsc: detached signature;
o bobcat_3.01.00-x.tar.gz: source archive;
o bobcat_3.01.00-x_i386.changes: change log;
o libbobcat1_3.01.00-x_*.deb: debian package holding the libraries;
o libbobcat1-dev_3.01.00-x_*.deb: debian package holding the libraries, headers and manual pages;
o http://sourceforge.net/projects/bobcat: public archive location;
BOBCAT
Bobcat is an acronym of `Brokken's Own Base Classes And Templates'.
COPYRIGHT
This is free software, distributed under the terms of the GNU General Public License (GPL).
AUTHOR
Frank B. Brokken (f.b.brokken@rug.nl).
libbobcat1-dev_3.01.00-x.tar.gz 2005-2012 FBB::Hostname(3bobcat)