473,385 Members | 1,893 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

icc compiler, object file problem

Hi all,

I am current engage in a project that require me to create object
files. However I am struck in compiling all the object files
together. I tend to get lots of undefined reference some of which is
from iostream and others are from "new" and "delete"

This is what i did,
test: myprog.o myprog2.o myprog3.o
icc myprog.o myprog2.o myprog3.o -o myprog -lbz2 -lcrytopp -openmp

myprog.o: myprog.cpp
icc -DINTEL -march=i686 -c myprog.cpp -lbz2 -lcrytopp -openmp

myprog2.o: myprog2.c
icc -DINTEL -march=i686 -c myprog2.c

myprog3.o myprog3.c
icc -DINTEL -march=i686 -c myprog3.c

some Errors,

undefined reference to std::istream::seekg...
undefined reference to std::istream::tellg
undefined reference to operator new
undefined reference to operator delete
and many more undefined reference

Anyone know how to solve it. By the way I can't use gcc because I am
required to use openmp.
Thanks

P.S. I am apologize if I place this post in the wrong group.

May 28 '07 #1
2 2780
On 28 Maj, 04:25, eva2002 <Eva2...@gmail.comwrote:
Hi all,

I am current engage in a project that require me to create object
files. However I am struck in compiling all the object files
together. I tend to get lots of undefined reference some of which is
from iostream and others are from "new" and "delete"

This is what i did,
test: myprog.o myprog2.o myprog3.o
icc myprog.o myprog2.o myprog3.o -o myprog -lbz2 -lcrytopp -openmp

myprog.o: myprog.cpp
icc -DINTEL -march=i686 -c myprog.cpp -lbz2 -lcrytopp -openmp

myprog2.o: myprog2.c
icc -DINTEL -march=i686 -c myprog2.c

myprog3.o myprog3.c
icc -DINTEL -march=i686 -c myprog3.c

some Errors,

undefined reference to std::istream::seekg...
undefined reference to std::istream::tellg
undefined reference to operator new
undefined reference to operator delete
and many more undefined reference

Anyone know how to solve it. By the way I can't use gcc because I am
required to use openmp.
Thanks

P.S. I am apologize if I place this post in the wrong group.
Yes, this is the wrong group, next time see if there is one for your
compiler or search around the Intel support pages.

As to your problem, it seems like you don't link against the standard C
++ library, either you have to specify a C++ library implementation
(just like you did with -lbz2 etc.) or you have to specify that you
are compiling C++ code and the compiler will take care of the rest.
Searching through the compiler documentation should give you an
answer.

--
Erik Wikström

May 28 '07 #2
On Sun, 27 May 2007 19:25:33 -0700, eva2002 wrote:
Hi all,

I am current engage in a project that require me to create object files.
However I am struck in compiling all the object files together. I tend
to get lots of undefined reference some of which is from iostream and
others are from "new" and "delete"
I think the Intel C++ compiler is called `icpc' - `icc' is the C
compiler. So compile your C modules with `icc' and your C++ modules with
`icpc' - and link with `icpc'.
>
This is what i did,
test: myprog.o myprog2.o myprog3.o
icc myprog.o myprog2.o myprog3.o -o myprog -lbz2 -lcrytopp -openmp
icpc myprog.o myprog2.o myprog3.o -o myprog -lbz2 -lcrytopp -openmp

(link using C++ compiler)
myprog.o: myprog.cpp
icc -DINTEL -march=i686 -c myprog.cpp -lbz2 -lcrytopp -openmp
icpc -DINTEL -march=i686 -c myprog.cpp -openmp

(compile using C++ compiler... and I don't think you need the link flags here)
myprog2.o: myprog2.c
icc -DINTEL -march=i686 -c myprog2.c

myprog3.o myprog3.c
icc -DINTEL -march=i686 -c myprog3.c

some Errors,

undefined reference to std::istream::seekg... undefined reference to
std::istream::tellg undefined reference to operator new
undefined reference to operator delete and many more undefined reference

Anyone know how to solve it. By the way I can't use gcc because I am
required to use openmp.
Thanks

P.S. I am apologize if I place this post in the wrong group.
Yes you probably did, but I'm feeling kind ;-)

--
Lionel B
May 29 '07 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Ryan Mitchley | last post by:
Hi all I have code for an object factory, heavily based on an article by Jim Hyslop (although I've made minor modifications). The factory was working fine using g++, but since switching to the...
1
by: Sacha Faust | last post by:
I have an abstract class, RuleResponse, and then create a new class base on it, RuleResponseSequence, and override the ++ operater. If I try to cast a RuleResponse as a RuleResponseSequence and...
2
by: Mary | last post by:
Hello, I am having a problem with the cl compiler. I have written a C class (RegConnect.c) which uses Win32 API functions such as RegOpenKey, RegCloseKey etc. Initially when I was trying to...
7
by: ajm | last post by:
Hi All, given an object file is there any way (or tool) to determine which compiler created it ? tia, A.
0
by: rollasoc | last post by:
Hi, I seem to be getting a compiler error Internal Compiler Error (0xc0000005 at address 535DB439): likely culprit is 'BIND'. An internal error has occurred in the compiler. To work around...
3
by: babak | last post by:
Hi I am running a project in eVC 4.0 and I have been running into a bug that only appears in the release build of the project. I eventually found out that when I had the compiler option /Od set...
2
by: mudge | last post by:
Hi, I'm getting some very strange problems with some C# code. We're running an ASP.NET application on a local server in a DMZ. If I access it using the internal address, the application works...
4
by: cnixuser | last post by:
Hello, I am posting reguarding some modifications I made to a text editor program that I wrote in my java class at my school today. The file I was modifying is a very simple java text editor with...
4
by: aaragon | last post by:
Hello everyone, I have this problem that is driving me crazy! I have a typedef for a singleton object in a file "fileA.h", then I try to use that object in "fileB.h" and then the compiler says...
27
by: Dave | last post by:
I'm having a hard time tying to build gcc 4.3.1 on Solaris using the GNU compilers. I then decided to try to use Sun's compiler. The Sun Studio 12 compiler reports the following code, which is in...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.