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
repeat
FBB::repeat(3bobcat) repeated function calls FBB::repeat(3bobcat)NAME
FBB::repeat - call a (member) function a fixed number of times
SYNOPSIS
#include <bobcat/repeat>
DESCRIPTION
The FBB::repeat function template allows a function or member function to be called a certain number of times. The functions or member
functions may define arguments. Arguments to these functions are specified when repeat is called, and are perfectly forwarded by the repeat
function template to the (member) function called by repeat.
The first argument of the repeat function template defines the number of times the (member) function must be called.
The FBB::repeat function template are defined inline, allowing the compiler to `optimize away' the repeat function call itself.
NAMESPACE
FBB
All constructors, members, operators and manipulators, mentioned in this man-page, are defined in the namespace FBB.
INHERITS FROM -
REPEAT FUNCTION TEMPLATE
The repeat function template is declared as:
template <typename Counter, typename First, typename ...Params>
void repeat(Counter counter, First &&first, Params &&...params);
In this declaration,
o Counter represents the counter's type. Usually an int or size_t. When calling repeat counter must be initialized to the number of
times repeat must call the (member) function (see below);
o First represents the prototype of a function or the name of a class. name of a class. Likewise, first either is the address (name)
of the function to be called or the name of an object of class type First. In the latter case the object may or may not be a const
object.
o ...Params represents the set of parameter types of arguments which must be perfectly forwarded to the called function. If first rep-
resents a class type object, the first argument must be the address of a member function of the class First.
EXAMPLES
#include <iostream>
#include <iterator>
#include <algorithm>
#include "../repeat"
using namespace std;
using namespace FBB;
class Object
{
public:
void member(int argc, char **argv) const;
void member2(size_t &rept, int argc, char **argv);
};
void Object::member(int argc, char **argv) const
{
cout << "member called
";
copy(argv, argv + argc, ostream_iterator<char const *>(cout, "
"));
}
void Object::member2(size_t &rept, int argc, char **argv)
{
cout << "member2 called, iteration " << rept++ << "
";
copy(argv, argv + argc, ostream_iterator<char const *>(cout, "
"));
}
void fun()
{
cout << "Fun called
";
}
int main(int argc, char **argv)
{
Object object;
cout << "
"
"*** The number of arguments determines the repeat-count ***
";
cout << "Fun without arguments:
";
repeat(argc, fun);
cout << "Object receiving argc and argv:
";
repeat(argc, object, &Object::member, argc, argv);
cout << "Object receiving argc and argv, showing the iteration count:
";
size_t count = 0;
repeat(argc, object, &Object::member2, count, argc, argv);
Object const obj;
cout << "Const Object receiving argc and argv:
";
repeat(argc, obj, &Object::member, argc, argv);
}
FILES
bobcat/repeat - defines the class interface
SEE ALSO bobcat(7)BUGS
Be careful when using overloaded functions, as the template argument resolution mechanism may be unable to determine which function to
call. If overloaded functions must be used, a static_cast is likely required to disambiguate your intentions.
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::repeat(3bobcat)