473,386 Members | 1,693 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,386 software developers and data experts.

compiler error

hi all

I am getting the following error when i try to compile a source file:

/home/christos/VIVE02/project/asm_3d/asm_3d/main.cpp:57: undefined
reference to `vtkUnstructuredGrid::InsertNextCell(int, vtkIdList*)'
collect2: ld returned 1 exit status

I have double checked that:
1.the .h and .cxx files i have for InsertNextCell exist and their
definiton of InsertNextCell is the same with the one I am calling

2. I have double checked that I include the .h file with the correct
path in the project options (I use KDevelop)

I dont know what is wrong
I would be greatfull for any help
thanks
Christos Panagiotou

Jul 19 '05 #1
4 7113
"christos panagiotou" <cp******@cs.ucl.ac.uk> wrote...
I am getting the following error when i try to compile a source file:

/home/christos/VIVE02/project/asm_3d/asm_3d/main.cpp:57: undefined
reference to `vtkUnstructuredGrid::InsertNextCell(int, vtkIdList*)'
collect2: ld returned 1 exit status

I have double checked that:
1.the .h and .cxx files i have for InsertNextCell exist and their
definiton of InsertNextCell is the same with the one I am calling

2. I have double checked that I include the .h file with the correct
path in the project options (I use KDevelop)

I dont know what is wrong


The most probable cause for this error is that you forget
to add the file that contains the InsertNextCell function
to the final program. How to do that is governed by the
compiler command-line options and switches and not by the
language rules. Since you seem to be using G++, you should
probably ask in gnu.g++.help how to set up your project.

Victor
Jul 19 '05 #2
christos panagiotou <cp******@cs.ucl.ac.uk> wrote in message
news:bd**********@news8.svr.pol.co.uk...
hi all

I am getting the following error when i try to compile a source file:

/home/christos/VIVE02/project/asm_3d/asm_3d/main.cpp:57: undefined
reference to `vtkUnstructuredGrid::InsertNextCell(int, vtkIdList*)'
collect2: ld returned 1 exit status

I have double checked that:
1.the .h and .cxx files i have for InsertNextCell exist and their
definiton of InsertNextCell is the same with the one I am calling

2. I have double checked that I include the .h file with the correct
path in the project options (I use KDevelop)

I dont know what is wrong
I would be greatfull for any help


So, you are convinced that the definition is there, and your compiler is
convinced that it isn't. How can anyone here possibly help without any
samples of code?

Try moving the function "vtkUnstructuredGrid::InsertNextCell(int,
vtkIdList*)" from where it is to main.cpp, and see what happens. If the
error goes away then clearly your compiler is not coming across the function
in the other file. This could be because the code is excluded by an #ifdef
or the like, or because you are not including the file, despite your
certainty that you are.

David

Jul 19 '05 #3

"christos panagiotou" <cp******@cs.ucl.ac.uk> wrote in message
news:bd**********@news8.svr.pol.co.uk...
hi all

I am getting the following error when i try to compile a source file:

/home/christos/VIVE02/project/asm_3d/asm_3d/main.cpp:57: undefined
reference to `vtkUnstructuredGrid::InsertNextCell(int, vtkIdList*)'
collect2: ld returned 1 exit status

I have double checked that:
1.the .h and .cxx files i have for InsertNextCell exist and their
definiton of InsertNextCell is the same with the one I am calling

2. I have double checked that I include the .h file with the correct
path in the project options (I use KDevelop)

I dont know what is wrong
I would be greatfull for any help
thanks
Christos Panagiotou


Did you add the paths to the vtk libraries to your project? The linker
doesn't know where to find vtkUnstructuredGrid::InsertNextCall and complains
about it. Thus I assume that you forgot to set the library paths.

HTH
Chris
Jul 19 '05 #4


christos panagiotou wrote:
hi all

I am getting the following error when i try to compile a source file:

/home/christos/VIVE02/project/asm_3d/asm_3d/main.cpp:57: undefined
reference to `vtkUnstructuredGrid::InsertNextCell(int, vtkIdList*)'
collect2: ld returned 1 exit status

I have double checked that:
1.the .h and .cxx files i have for InsertNextCell exist and their
definiton of InsertNextCell is the same with the one I am calling

2. I have double checked that I include the .h file with the correct
path in the project options (I use KDevelop)

I dont know what is wrong
I would be greatfull for any help
thanks
Christos Panagiotou


A problem that can occur with gcc is if you accidentally moved the body
of the function from the .h where you typed it initially to the .cpp
where it finally is. If you forget a leading "inline", the linker won't
find the function.

ex:
//file a.h
//------
struct A
{
void doIt() const;
}

//file a.cpp
//------
inline void A::doIt() const // Ah! The inline is the culprit!
{
cout<<"done!\n";
}

//file main.C
//----------
#include "a.h"
#include <iostream>

using namespace std;

int
main(int,char**)
{
A a;
a.doIt();
return 0;
}

The aboce example won't link on gcc3.3

--
+-------------------------------------------------+
| Xavier Décoret - Post Doct |
| Graphics Lab (LCS) - MIT |
| mailto: de*****@graphics.lcs.mit.edu |
| home : http://www.graphics.lcs.mit.edu/~decoret|
+-------------------------------------------------+

Jul 19 '05 #5

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

Similar topics

6
by: paul calvert | last post by:
I hope somewhere here has encountered and solved a similar problem in the past. 1) on a new Win2000 PC: installed Visual C++ 6.0 download & install single file Service Pack 5.0 2) try to...
2
by: Mike Fisher | last post by:
I'm seeing an error when I try to run/debug a web service. Although it doesn't happen every time, it does occur more than half of the times I hit F5. It appears to be returned by the the JIT...
10
by: Bjorn | last post by:
I'm using interfaces in C++ by declaring classes with only pure virtual methods. If then someone wants to implement the interface they needs to inherit from the class. If the implementing class...
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...
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...
1
by: Ayende Rahien | last post by:
reparing resources... Updating references... Performing main compilation... error CS0583: Internal Compiler Error (0xc0000005 at address 53168B12): likely culprit is 'BIND'. An internal...
3
by: Mark Rockman | last post by:
------ Build started: Project: USDAver2, Configuration: Debug .NET ------ Preparing resources... Updating references... Performing main compilation... error CS0583: Internal Compiler Error...
4
by: David Sworder | last post by:
Consider the following line of code (it's not important what it does): resp.DocItem=Relations.SelectDocItems_BySearchString(req.SearchPhrase); It turns out that this line is in error. The...
6
by: David Lack | last post by:
Hi, I recently installed a 60-day trial of .NET 2003 on my development system. I made tests with previous personal projects (which compiled ok with VC6) and some open source files, and keep...
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
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
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...

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.