01-18-2002
compilation error in gcc
Hi,
Should be too simple...
I wrote a sample c++ program like
#include <iostream.h>
int main()
{$
int ab=455;
cout << ab << endl;
return 1;
}
I am getting error like
$ gcc u1.cpp
Undefined first referenced
symbol in file
cout /var/tmp/ccK1IfM6.o
ostream:
![Embarrassment Smilie](https://www.unix.com/images/smilies/redface.gif)
perator<<(ostream &(*)(ostream &))/var/tmp/ccK1IfM6.o
endl(ostream &) /var/tmp/ccK1IfM6.o
ostream:
![Embarrassment Smilie](https://www.unix.com/images/smilies/redface.gif)
perator<<(int) /var/tmp/ccK1IfM6.o
ld: fatal: Symbol referencing errors. No output written to a.out
collect2: ld returned 1 exit status
Not able to figure out what the problem is.
THanks
ls1429
10 More Discussions You Might Find Interesting
1. Programming
how can i do static compilation in gcc
my gcc version is
# gcc -v
Reading specs from /usr/lib/gcc-lib/i386-redhat-linux/3.2.2/specs
Configured with: ../configure --prefix=/usr --mandir=/usr/share/man --infodir=/u
sr/share/info --enable-shared --enable-threads=posix --disable-checking... (3 Replies)
Discussion started by: collins
3 Replies
2. Solaris
I have the following declaration in file named vx_solaris.h
(Path : /usr/share/src/tpkgs/veritas/solaris_sparc/include/sys/fs/vx_solaris.h)
typedef (*vx_creatfptr_t)(struct vnode *, char *, struct vattr *, vcexcl_t, int, struct vnode **, vx_cred_t *, int);
I include vx_solaris.h in one of... (5 Replies)
Discussion started by: amitc
5 Replies
3. Programming
Hi All,
I facing the following compilation error; when I implementing the following logic.
ostrstream ostr;
ostr << (( scAxsm.getRecord( i ).getField( 2 ).getShort())%12)!=0?(( scAxsm.getRecord( i ).getField( 2 ).getShort())/12+1)
: (( scAxsm.getRecord( i ).getField( 2 ).getShort())/12) <<... (1 Reply)
Discussion started by: sweta
1 Replies
4. Linux
Hello every one,
here i am attempting to compile a c++ module using gcc.it is throwing a error .
error:
====
> make -S dummyCHARGP
/usr/local/bin/gcc -g -DDEBUG -DMAT -I. -I/swtemp/usbs/cc/unix-ce/root/subsys/lib/Linux/ -I/opt/dce/include -I/opt/dce/include/dce ... (12 Replies)
Discussion started by: mannam srinivas
12 Replies
5. HP-UX
hello everyone,
here i am attempting to compile a c++ submodule.OS is HP-UX.
here i am getting the following error.
======================================
"Make: Don't know how to make compile. Stop."
===================================
could you pls somebody suggest why this error is... (2 Replies)
Discussion started by: mannam srinivas
2 Replies
6. Programming
Hi All
I have a question on the compilation
Assume i am working on 64 bit Linux OS.
i am making shared objects and libraries required for our project.
Can i compile 32 bit libraries using gcc of 64 -bit OS?
Or
Is there any restriction in the 32-bit or 64-bit compilers when trying to... (6 Replies)
Discussion started by: dhanamurthy
6 Replies
7. Solaris
AIM- Install Oracle 11g on Solaris using VMWare
Steps
1.Logged on as root
2.Created subfolders à /usr/local/bin & /usr/local/bin/gcc
3.Downloaded gcc & libiconv & unzipped them on my harddrive & burnt them on CD
4.Copied files from CD to /usr/local/bin/gcc
5.Terminal (root) à pkgadd -d... (8 Replies)
Discussion started by: Ackers
8 Replies
8. Programming
I am getting the below given errors for the following program though all the variables have been declared and used appropriately. Please Help. The environment is AIX.
Error:
------
"gbsizeprofile.c", line 67.4: 1506-275 (S) Unexpected text 'void' encountered.
"gbsizeprofile.c", line 67.10:... (2 Replies)
Discussion started by: yschd
2 Replies
9. Programming
I am facing problem while migrating the c++ code from Linux to Solaris. In linux the code is absolutly compiled fine with GCC compiler but when i am using the same in Solaris it coomplains
bash-3.1$ gcc LibSip.h
gcc: Compilation of header file requested
The same command is working fine in... (2 Replies)
Discussion started by: mrupesh74
2 Replies
10. AIX
Hi,
I have to compile a program on my server, runs on AIX 6.1. On my test server the compilation is ok (AIX 6.1); but when I try it on production server, I have this
gcc prog.c -o prog_out
In file included from resmon.c:111:
/usr/include/unistd.h:924: error: expected ')' before '
I noticed... (1 Reply)
Discussion started by: tnjulius
1 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)