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
randbuffer
FBB::RandBuffer(3bobcat) random number streambuf FBB::RandBuffer(3bobcat)NAME
FBB::RandBuffer - std::streambuf generating random numbers
SYNOPSIS
#include <bobcat/randbuffer>
Linking option: -lbobcat
DESCRIPTION
FBB:RandBuffer objects may be used as a std::streambuf of std::istream objects to allow the extraction of random numbers from the stream.
NAMESPACE
FBB
All constructors, members, operators and manipulators, mentioned in this man-page, are defined in the namespace FBB.
INHERITS FROM
std::streambuf
CONSTRUCTOR
o Randbuffer(int min, int max, size_t seed = 1):
This Randbuffer() constructor initializes the random generator. The seed is used to initialze the random number generator.Random
values between min and max (inclusive) are returned.
VIRTUAL MEMBERS
o int underflow():
This function is called by std::istream objects using Randbuffer. It produces the next available random number, separating the ran-
dom numbers by one blanks space. Random values between min and max (inclusive) are returned (see the description of the construc-
tor).
INHERITED MEMBERS
Since the class uses public derivation from std::streambuf, all members of this class can be used.
EXAMPLE
#include <iostream>
#include <istream>
#include <bobcat/randbuffer>
#include <bobcat/a2x>
using namespace std;
using namespace FBB;
int main(int argc, char **argv)
{
if (argc == 1)
{
cout << "expect: nruns min max seed
";
return 1;
}
Randbuffer rb(A2x(argv[2]), A2x(argv[3]), A2x(argv[4]).to<size_t>());
istream istr(&rb);
for (int idx = A2x(argv[1]); idx--; )
{
int c;
if (!(istr >> c))
{
cout << "extraction failed
";
break;
}
cout << "next: " << c << endl;
}
int count = 0;
while (istr.unget())
count++;
cout << "number of successful unget()-calls: " << count << endl;
istr.clear();
istr >> count;
cout << "and read: " << count << endl;
return 0;
}
FILES
bobcat/randbuffer - defines the class interface
SEE ALSO bobcat(7), irandstream(3bobcat), rand(3), srand(3), std::streambuf
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::RandBuffer(3bobcat)