How to compile tutorial example?

classic Classic list List threaded Threaded
11 messages Options
Reply | Threaded
Open this post in threaded view
|

How to compile tutorial example?

James Frye
Hi,

I've just downloaded and installed VTK 5.0.  I compiled and installed it
in /opt/vtk.  Now I'm trying to get the first example in
Examples/Tutorial/Step1 to run.  

Since there is no Makefile, I made a simple one, which I've included at
the end.  The problem is that this gives me about 54K lines of "undefined
reference to vtkSomething..." messages.  Obviously. something fundamental
is wrong, but what?  How do I get a Makefile that I can use to compile a
simple example?

Thanks,
James

PS: I did read the install instructions, all the FAQs, and tried to search
the mailing list archives (using "how to compile example" as a search
string).


The Makefile:

NAME = Cone

CC   = /usr/bin/gcc
CPP  = /usr/bin/gcc

CFLAGS += -g -Wunused -Wno-deprecated -I/opt/vtk/include/vtk-5.0
LIBS = -L/opt/vtk/lib \
       -lvtkCommon -lvtkDICOMParser -lvtkFiltering -lvtkGenericFiltering \
       -lvtkGraphics -lvtkHybrid -lvtkIO -lvtkImaging -lvtkMPEG2Encode \
       -lvtkNetCDF -lvtkRendering -lvtkVolumeRendering -lvtkWidgets    \
       -lvtkexoIIc -lvtkexpat -lvtkfreetype -lvtkftgl -lvtkjpeg -lvtkpng \
       -lvtksys -lvtktiff -lvtkzlib


$Cone: Cone.o
        $(CC) -o $@ $^ $(LIBS)


.cpp.o:
          $(CPP) $(CFLAGS) -c $<



_______________________________________________
This is the private VTK discussion list.
Please keep messages on-topic. Check the FAQ at: http://www.vtk.org/Wiki/VTK_FAQ
Follow this link to subscribe/unsubscribe:
http://www.vtk.org/mailman/listinfo/vtkusers
Reply | Threaded
Open this post in threaded view
|

Re: How to compile tutorial example?

Anka Kochanowska
Hi!
You should have CMakelist.txt in every example directory. Then you just
run cmake or ccmake to make Makefile.
A


James Frye wrote:

>Hi,
>
>I've just downloaded and installed VTK 5.0.  I compiled and installed it
>in /opt/vtk.  Now I'm trying to get the first example in
>Examples/Tutorial/Step1 to run.  
>
>Since there is no Makefile, I made a simple one, which I've included at
>the end.  The problem is that this gives me about 54K lines of "undefined
>reference to vtkSomething..." messages.  Obviously. something fundamental
>is wrong, but what?  How do I get a Makefile that I can use to compile a
>simple example?
>
>Thanks,
>James
>
>PS: I did read the install instructions, all the FAQs, and tried to search
>the mailing list archives (using "how to compile example" as a search
>string).
>
>
>The Makefile:
>
>NAME = Cone
>
>CC   = /usr/bin/gcc
>CPP  = /usr/bin/gcc
>
>CFLAGS += -g -Wunused -Wno-deprecated -I/opt/vtk/include/vtk-5.0
>LIBS = -L/opt/vtk/lib \
>       -lvtkCommon -lvtkDICOMParser -lvtkFiltering -lvtkGenericFiltering \
>       -lvtkGraphics -lvtkHybrid -lvtkIO -lvtkImaging -lvtkMPEG2Encode \
>       -lvtkNetCDF -lvtkRendering -lvtkVolumeRendering -lvtkWidgets    \
>       -lvtkexoIIc -lvtkexpat -lvtkfreetype -lvtkftgl -lvtkjpeg -lvtkpng \
>       -lvtksys -lvtktiff -lvtkzlib
>
>
>$Cone: Cone.o
> $(CC) -o $@ $^ $(LIBS)
>
>
>.cpp.o:
>  $(CPP) $(CFLAGS) -c $<
>
>
>
>_______________________________________________
>This is the private VTK discussion list.
>Please keep messages on-topic. Check the FAQ at: http://www.vtk.org/Wiki/VTK_FAQ
>Follow this link to subscribe/unsubscribe:
>http://www.vtk.org/mailman/listinfo/vtkusers
>
>  
>
_______________________________________________
This is the private VTK discussion list.
Please keep messages on-topic. Check the FAQ at: http://www.vtk.org/Wiki/VTK_FAQ
Follow this link to subscribe/unsubscribe:
http://www.vtk.org/mailman/listinfo/vtkusers
Reply | Threaded
Open this post in threaded view
|

Re: How to compile tutorial example?

David Cole
In reply to this post by James Frye
If you successfully compiled and installed VTK 5.0, you must have used
CMake to do so...

Use CMake to generate a makefile for you... If you point CMake at
Examples/Tutorial/Step1/Cxx as the source directory you should be able
to get a makefile that will build step 1 linking to the VTK you just built.

HTH,
David

James Frye wrote:

>Hi,
>
>I've just downloaded and installed VTK 5.0.  I compiled and installed it
>in /opt/vtk.  Now I'm trying to get the first example in
>Examples/Tutorial/Step1 to run.  
>
>Since there is no Makefile, I made a simple one, which I've included at
>the end.  The problem is that this gives me about 54K lines of "undefined
>reference to vtkSomething..." messages.  Obviously. something fundamental
>is wrong, but what?  How do I get a Makefile that I can use to compile a
>simple example?
>
>Thanks,
>James
>
>PS: I did read the install instructions, all the FAQs, and tried to search
>the mailing list archives (using "how to compile example" as a search
>string).
>
>
>The Makefile:
>
>NAME = Cone
>
>CC   = /usr/bin/gcc
>CPP  = /usr/bin/gcc
>
>CFLAGS += -g -Wunused -Wno-deprecated -I/opt/vtk/include/vtk-5.0
>LIBS = -L/opt/vtk/lib \
>       -lvtkCommon -lvtkDICOMParser -lvtkFiltering -lvtkGenericFiltering \
>       -lvtkGraphics -lvtkHybrid -lvtkIO -lvtkImaging -lvtkMPEG2Encode \
>       -lvtkNetCDF -lvtkRendering -lvtkVolumeRendering -lvtkWidgets    \
>       -lvtkexoIIc -lvtkexpat -lvtkfreetype -lvtkftgl -lvtkjpeg -lvtkpng \
>       -lvtksys -lvtktiff -lvtkzlib
>
>
>$Cone: Cone.o
> $(CC) -o $@ $^ $(LIBS)
>
>
>.cpp.o:
>  $(CPP) $(CFLAGS) -c $<
>
>
>
>_______________________________________________
>This is the private VTK discussion list.
>Please keep messages on-topic. Check the FAQ at: http://www.vtk.org/Wiki/VTK_FAQ
>Follow this link to subscribe/unsubscribe:
>http://www.vtk.org/mailman/listinfo/vtkusers
>
>  
>
_______________________________________________
This is the private VTK discussion list.
Please keep messages on-topic. Check the FAQ at: http://www.vtk.org/Wiki/VTK_FAQ
Follow this link to subscribe/unsubscribe:
http://www.vtk.org/mailman/listinfo/vtkusers
Reply | Threaded
Open this post in threaded view
|

Re: How to compile tutorial example?

James Frye
David,

Well, it does and it doesn't :-)

After some fumbling, I got it to generate a Makefile that will compile the
example.  The problems are that it's not a standard makefile at all: it
calls CMake internally through several levels of scripts and/or recursive
make calls, creates a bunch of additional directories & files, uses wrong
commands & extensions...

I suppose I could eventually trace through all of this, and extract the
relevant parts to make a useable makefile (My first quick shot did get me
down to a mere 10K or so error lines :-)), but I need to ask whether it's
going to be worth doing, whether that makefile would work as a template
for other programs. Please understand that we're not starting a project
from scratch: we have existing code & makefiles which work.  We really
aren't interested in re-writing all this working code just to integrate
one toolkit, no matter how nice it is.

So I guess the question now is whether it is feasible to use VTK without
CMake, and if so, where to start.

Thanks,
James


On Fri, 10 Feb 2006, David Cole wrote:

> If you successfully compiled and installed VTK 5.0, you must have used
> CMake to do so...
>
> Use CMake to generate a makefile for you... If you point CMake at
> Examples/Tutorial/Step1/Cxx as the source directory you should be able
> to get a makefile that will build step 1 linking to the VTK you just built.
>
> HTH,
> David
>
> James Frye wrote:
>
> >Hi,
> >
> >I've just downloaded and installed VTK 5.0.  I compiled and installed it
> >in /opt/vtk.  Now I'm trying to get the first example in
> >Examples/Tutorial/Step1 to run.  
> >
> >Since there is no Makefile, I made a simple one, which I've included at
> >the end.  The problem is that this gives me about 54K lines of "undefined
> >reference to vtkSomething..." messages.  Obviously. something fundamental
> >is wrong, but what?  How do I get a Makefile that I can use to compile a
> >simple example?
> >
> >Thanks,
> >James
> >
> >PS: I did read the install instructions, all the FAQs, and tried to search
> >the mailing list archives (using "how to compile example" as a search
> >string).
> >
> >
> >The Makefile:
> >
> >NAME = Cone
> >
> >CC   = /usr/bin/gcc
> >CPP  = /usr/bin/gcc
> >
> >CFLAGS += -g -Wunused -Wno-deprecated -I/opt/vtk/include/vtk-5.0
> >LIBS = -L/opt/vtk/lib \
> >       -lvtkCommon -lvtkDICOMParser -lvtkFiltering -lvtkGenericFiltering \
> >       -lvtkGraphics -lvtkHybrid -lvtkIO -lvtkImaging -lvtkMPEG2Encode \
> >       -lvtkNetCDF -lvtkRendering -lvtkVolumeRendering -lvtkWidgets    \
> >       -lvtkexoIIc -lvtkexpat -lvtkfreetype -lvtkftgl -lvtkjpeg -lvtkpng \
> >       -lvtksys -lvtktiff -lvtkzlib
> >
> >
> >$Cone: Cone.o
> > $(CC) -o $@ $^ $(LIBS)
> >
> >
> >.cpp.o:
> >  $(CPP) $(CFLAGS) -c $<
> >
> >
> >
> >_______________________________________________
> >This is the private VTK discussion list.
> >Please keep messages on-topic. Check the FAQ at: http://www.vtk.org/Wiki/VTK_FAQ
> >Follow this link to subscribe/unsubscribe:
> >http://www.vtk.org/mailman/listinfo/vtkusers
> >
> >  
> >
>

_______________________________________________
This is the private VTK discussion list.
Please keep messages on-topic. Check the FAQ at: http://www.vtk.org/Wiki/VTK_FAQ
Follow this link to subscribe/unsubscribe:
http://www.vtk.org/mailman/listinfo/vtkusers
Reply | Threaded
Open this post in threaded view
|

Re: How to compile tutorial example?

Xiaofeng Z
Is it possible there's another version of vtk installed in your computer and
your application is linking to that version instead of the version you just
installed?

Xiaofeng Zhao
www.xzing.org




>From: James Frye <[hidden email]>
>To: David Cole <[hidden email]>
>CC: [hidden email]
>Subject: Re: [vtkusers] How to compile tutorial example?
>Date: Fri, 10 Feb 2006 10:16:10 -0800 (PST)
>
>David,
>
>Well, it does and it doesn't :-)
>
>After some fumbling, I got it to generate a Makefile that will compile the
>example.  The problems are that it's not a standard makefile at all: it
>calls CMake internally through several levels of scripts and/or recursive
>make calls, creates a bunch of additional directories & files, uses wrong
>commands & extensions...
>
>I suppose I could eventually trace through all of this, and extract the
>relevant parts to make a useable makefile (My first quick shot did get me
>down to a mere 10K or so error lines :-)), but I need to ask whether it's
>going to be worth doing, whether that makefile would work as a template
>for other programs. Please understand that we're not starting a project
>from scratch: we have existing code & makefiles which work.  We really
>aren't interested in re-writing all this working code just to integrate
>one toolkit, no matter how nice it is.
>
>So I guess the question now is whether it is feasible to use VTK without
>CMake, and if so, where to start.
>
>Thanks,
>James
>
>
>On Fri, 10 Feb 2006, David Cole wrote:
>
> > If you successfully compiled and installed VTK 5.0, you must have used
> > CMake to do so...
> >
> > Use CMake to generate a makefile for you... If you point CMake at
> > Examples/Tutorial/Step1/Cxx as the source directory you should be able
> > to get a makefile that will build step 1 linking to the VTK you just
>built.
> >
> > HTH,
> > David
> >
> > James Frye wrote:
> >
> > >Hi,
> > >
> > >I've just downloaded and installed VTK 5.0.  I compiled and installed
>it
> > >in /opt/vtk.  Now I'm trying to get the first example in
> > >Examples/Tutorial/Step1 to run.
> > >
> > >Since there is no Makefile, I made a simple one, which I've included at
> > >the end.  The problem is that this gives me about 54K lines of
>"undefined
> > >reference to vtkSomething..." messages.  Obviously. something
>fundamental
> > >is wrong, but what?  How do I get a Makefile that I can use to compile
>a
> > >simple example?
> > >
> > >Thanks,
> > >James
> > >
> > >PS: I did read the install instructions, all the FAQs, and tried to
>search
> > >the mailing list archives (using "how to compile example" as a search
> > >string).
> > >
> > >
> > >The Makefile:
> > >
> > >NAME = Cone
> > >
> > >CC   = /usr/bin/gcc
> > >CPP  = /usr/bin/gcc
> > >
> > >CFLAGS += -g -Wunused -Wno-deprecated -I/opt/vtk/include/vtk-5.0
> > >LIBS = -L/opt/vtk/lib \
> > >       -lvtkCommon -lvtkDICOMParser -lvtkFiltering
>-lvtkGenericFiltering \
> > >       -lvtkGraphics -lvtkHybrid -lvtkIO -lvtkImaging -lvtkMPEG2Encode
>\
> > >       -lvtkNetCDF -lvtkRendering -lvtkVolumeRendering -lvtkWidgets    
>\
> > >       -lvtkexoIIc -lvtkexpat -lvtkfreetype -lvtkftgl -lvtkjpeg
>-lvtkpng \
> > >       -lvtksys -lvtktiff -lvtkzlib
> > >
> > >
> > >$Cone: Cone.o
> > > $(CC) -o $@ $^ $(LIBS)
> > >
> > >
> > >.cpp.o:
> > >  $(CPP) $(CFLAGS) -c $<
> > >
> > >
> > >
> > >_______________________________________________
> > >This is the private VTK discussion list.
> > >Please keep messages on-topic. Check the FAQ at:
>http://www.vtk.org/Wiki/VTK_FAQ
> > >Follow this link to subscribe/unsubscribe:
> > >http://www.vtk.org/mailman/listinfo/vtkusers
> > >
> > >
> > >
> >
>
>_______________________________________________
>This is the private VTK discussion list.
>Please keep messages on-topic. Check the FAQ at:
>http://www.vtk.org/Wiki/VTK_FAQ
>Follow this link to subscribe/unsubscribe:
>http://www.vtk.org/mailman/listinfo/vtkusers


_______________________________________________
This is the private VTK discussion list.
Please keep messages on-topic. Check the FAQ at: http://www.vtk.org/Wiki/VTK_FAQ
Follow this link to subscribe/unsubscribe:
http://www.vtk.org/mailman/listinfo/vtkusers
Reply | Threaded
Open this post in threaded view
|

Re: How to compile tutorial example?

Xiaofeng Z
In reply to this post by James Frye
James,

I realized that you did placed '-L' and '-I' options and they seemed to be
consistent.  So your Makefile should work.  I would try linking only to
vtkCommon, vtkGraphics, vtkFiltering, and vtkRendering and see if it works.

Also make sure the same version of compiler is used for installation.

Xiaofeng Zhao
www.xzing.orgh




>From: James Frye <[hidden email]>
>To: David Cole <[hidden email]>
>CC: [hidden email]
>Subject: Re: [vtkusers] How to compile tutorial example?
>Date: Fri, 10 Feb 2006 10:16:10 -0800 (PST)
>
>David,
>
>Well, it does and it doesn't :-)
>
>After some fumbling, I got it to generate a Makefile that will compile the
>example.  The problems are that it's not a standard makefile at all: it
>calls CMake internally through several levels of scripts and/or recursive
>make calls, creates a bunch of additional directories & files, uses wrong
>commands & extensions...
>
>I suppose I could eventually trace through all of this, and extract the
>relevant parts to make a useable makefile (My first quick shot did get me
>down to a mere 10K or so error lines :-)), but I need to ask whether it's
>going to be worth doing, whether that makefile would work as a template
>for other programs. Please understand that we're not starting a project
>from scratch: we have existing code & makefiles which work.  We really
>aren't interested in re-writing all this working code just to integrate
>one toolkit, no matter how nice it is.
>
>So I guess the question now is whether it is feasible to use VTK without
>CMake, and if so, where to start.
>
>Thanks,
>James
>
>
>On Fri, 10 Feb 2006, David Cole wrote:
>
> > If you successfully compiled and installed VTK 5.0, you must have used
> > CMake to do so...
> >
> > Use CMake to generate a makefile for you... If you point CMake at
> > Examples/Tutorial/Step1/Cxx as the source directory you should be able
> > to get a makefile that will build step 1 linking to the VTK you just
>built.
> >
> > HTH,
> > David
> >
> > James Frye wrote:
> >
> > >Hi,
> > >
> > >I've just downloaded and installed VTK 5.0.  I compiled and installed
>it
> > >in /opt/vtk.  Now I'm trying to get the first example in
> > >Examples/Tutorial/Step1 to run.
> > >
> > >Since there is no Makefile, I made a simple one, which I've included at
> > >the end.  The problem is that this gives me about 54K lines of
>"undefined
> > >reference to vtkSomething..." messages.  Obviously. something
>fundamental
> > >is wrong, but what?  How do I get a Makefile that I can use to compile
>a
> > >simple example?
> > >
> > >Thanks,
> > >James
> > >
> > >PS: I did read the install instructions, all the FAQs, and tried to
>search
> > >the mailing list archives (using "how to compile example" as a search
> > >string).
> > >
> > >
> > >The Makefile:
> > >
> > >NAME = Cone
> > >
> > >CC   = /usr/bin/gcc
> > >CPP  = /usr/bin/gcc
> > >
> > >CFLAGS += -g -Wunused -Wno-deprecated -I/opt/vtk/include/vtk-5.0
> > >LIBS = -L/opt/vtk/lib \
> > >       -lvtkCommon -lvtkDICOMParser -lvtkFiltering
>-lvtkGenericFiltering \
> > >       -lvtkGraphics -lvtkHybrid -lvtkIO -lvtkImaging -lvtkMPEG2Encode
>\
> > >       -lvtkNetCDF -lvtkRendering -lvtkVolumeRendering -lvtkWidgets    
>\
> > >       -lvtkexoIIc -lvtkexpat -lvtkfreetype -lvtkftgl -lvtkjpeg
>-lvtkpng \
> > >       -lvtksys -lvtktiff -lvtkzlib
> > >
> > >
> > >$Cone: Cone.o
> > > $(CC) -o $@ $^ $(LIBS)
> > >
> > >
> > >.cpp.o:
> > >  $(CPP) $(CFLAGS) -c $<
> > >
> > >
> > >
> > >_______________________________________________
> > >This is the private VTK discussion list.
> > >Please keep messages on-topic. Check the FAQ at:
>http://www.vtk.org/Wiki/VTK_FAQ
> > >Follow this link to subscribe/unsubscribe:
> > >http://www.vtk.org/mailman/listinfo/vtkusers
> > >
> > >
> > >
> >
>
>_______________________________________________
>This is the private VTK discussion list.
>Please keep messages on-topic. Check the FAQ at:
>http://www.vtk.org/Wiki/VTK_FAQ
>Follow this link to subscribe/unsubscribe:
>http://www.vtk.org/mailman/listinfo/vtkusers


_______________________________________________
This is the private VTK discussion list.
Please keep messages on-topic. Check the FAQ at: http://www.vtk.org/Wiki/VTK_FAQ
Follow this link to subscribe/unsubscribe:
http://www.vtk.org/mailman/listinfo/vtkusers
Reply | Threaded
Open this post in threaded view
|

Re: How to compile tutorial example?

Obada Mahdi
In reply to this post by James Frye
Hi James,

here is another hint which might be worth trying.

On Feb 9, 2006, at 11:36 PM, James Frye wrote:
 > Since there is no Makefile, I made a simple one, which I've  
included at
 > the end.  The problem is that this gives me about 54K lines of  
"undefined
 > reference to vtkSomething..." messages.  [...]

[Makefile]
 > LIBS = -L/opt/vtk/lib \
 >        -lvtkCommon -lvtkDICOMParser -lvtkFiltering -
lvtkGenericFiltering \
 >        -lvtkGraphics -lvtkHybrid -lvtkIO -lvtkImaging -
lvtkMPEG2Encode \
 >        -lvtkNetCDF -lvtkRendering -lvtkVolumeRendering -
lvtkWidgets    \
 >        -lvtkexoIIc -lvtkexpat -lvtkfreetype -lvtkftgl -lvtkjpeg -
lvtkpng \
 >        -lvtksys -lvtktiff -lvtkzlib

In your Makefile, libraries are mentioned based on lexicographical
order.  From what I know about the linking process, the order is
significant; undefined symbols are looked up in the libraries in the
order they are mentioned in the argument list, but (yet unused) symbols
exported by a library are not remembered for later lookup.

You can check library dependencies by having a look at the file
"VTKLibraryDepends.cmake", which in your installation should reside
somewhere in "/opt/vtk/lib/vtk-5.0".  In case this is the cause of your
"undefined symbols" problem, rearranging the libraries in the argument
list (so that every library is mentioned _before_ its dependencies)
should help.


Regards

Obada

_______________________________________________
This is the private VTK discussion list.
Please keep messages on-topic. Check the FAQ at: http://www.vtk.org/Wiki/VTK_FAQ
Follow this link to subscribe/unsubscribe:
http://www.vtk.org/mailman/listinfo/vtkusers
Reply | Threaded
Open this post in threaded view
|

Re: How to compile tutorial example?

James Frye
In reply to this post by Xiaofeng Z
Still the same 50K lines of errors.

I think the compiler is the same: CMake calls it "c++" instead of "gcc",
but the -v option reports the same "gcc version 3.3.3 20040412" for both.

Thanks,
James

On Fri, 10 Feb 2006, X Z wrote:

> James,
>
> I realized that you did placed '-L' and '-I' options and they seemed to be
> consistent.  So your Makefile should work.  I would try linking only to
> vtkCommon, vtkGraphics, vtkFiltering, and vtkRendering and see if it works.
>
> Also make sure the same version of compiler is used for installation.
>
> Xiaofeng Zhao
> www.xzing.orgh
>
>
>
>
> >From: James Frye <[hidden email]>
> >To: David Cole <[hidden email]>
> >CC: [hidden email]
> >Subject: Re: [vtkusers] How to compile tutorial example?
> >Date: Fri, 10 Feb 2006 10:16:10 -0800 (PST)
> >
> >David,
> >
> >Well, it does and it doesn't :-)
> >
> >After some fumbling, I got it to generate a Makefile that will compile the
> >example.  The problems are that it's not a standard makefile at all: it
> >calls CMake internally through several levels of scripts and/or recursive
> >make calls, creates a bunch of additional directories & files, uses wrong
> >commands & extensions...
> >
> >I suppose I could eventually trace through all of this, and extract the
> >relevant parts to make a useable makefile (My first quick shot did get me
> >down to a mere 10K or so error lines :-)), but I need to ask whether it's
> >going to be worth doing, whether that makefile would work as a template
> >for other programs. Please understand that we're not starting a project
> >from scratch: we have existing code & makefiles which work.  We really
> >aren't interested in re-writing all this working code just to integrate
> >one toolkit, no matter how nice it is.
> >
> >So I guess the question now is whether it is feasible to use VTK without
> >CMake, and if so, where to start.
> >
> >Thanks,
> >James
> >
> >
> >On Fri, 10 Feb 2006, David Cole wrote:
> >
> > > If you successfully compiled and installed VTK 5.0, you must have used
> > > CMake to do so...
> > >
> > > Use CMake to generate a makefile for you... If you point CMake at
> > > Examples/Tutorial/Step1/Cxx as the source directory you should be able
> > > to get a makefile that will build step 1 linking to the VTK you just
> >built.
> > >
> > > HTH,
> > > David
> > >
> > > James Frye wrote:
> > >
> > > >Hi,
> > > >
> > > >I've just downloaded and installed VTK 5.0.  I compiled and installed
> >it
> > > >in /opt/vtk.  Now I'm trying to get the first example in
> > > >Examples/Tutorial/Step1 to run.
> > > >
> > > >Since there is no Makefile, I made a simple one, which I've included at
> > > >the end.  The problem is that this gives me about 54K lines of
> >"undefined
> > > >reference to vtkSomething..." messages.  Obviously. something
> >fundamental
> > > >is wrong, but what?  How do I get a Makefile that I can use to compile
> >a
> > > >simple example?
> > > >
> > > >Thanks,
> > > >James
> > > >
> > > >PS: I did read the install instructions, all the FAQs, and tried to
> >search
> > > >the mailing list archives (using "how to compile example" as a search
> > > >string).
> > > >
> > > >
> > > >The Makefile:
> > > >
> > > >NAME = Cone
> > > >
> > > >CC   = /usr/bin/gcc
> > > >CPP  = /usr/bin/gcc
> > > >
> > > >CFLAGS += -g -Wunused -Wno-deprecated -I/opt/vtk/include/vtk-5.0
> > > >LIBS = -L/opt/vtk/lib \
> > > >       -lvtkCommon -lvtkDICOMParser -lvtkFiltering
> >-lvtkGenericFiltering \
> > > >       -lvtkGraphics -lvtkHybrid -lvtkIO -lvtkImaging -lvtkMPEG2Encode
> >\
> > > >       -lvtkNetCDF -lvtkRendering -lvtkVolumeRendering -lvtkWidgets    
> >\
> > > >       -lvtkexoIIc -lvtkexpat -lvtkfreetype -lvtkftgl -lvtkjpeg
> >-lvtkpng \
> > > >       -lvtksys -lvtktiff -lvtkzlib
> > > >
> > > >
> > > >$Cone: Cone.o
> > > > $(CC) -o $@ $^ $(LIBS)
> > > >
> > > >
> > > >.cpp.o:
> > > >  $(CPP) $(CFLAGS) -c $<
> > > >
> > > >
> > > >
> > > >_______________________________________________
> > > >This is the private VTK discussion list.
> > > >Please keep messages on-topic. Check the FAQ at:
> >http://www.vtk.org/Wiki/VTK_FAQ
> > > >Follow this link to subscribe/unsubscribe:
> > > >http://www.vtk.org/mailman/listinfo/vtkusers
> > > >
> > > >
> > > >
> > >
> >
> >_______________________________________________
> >This is the private VTK discussion list.
> >Please keep messages on-topic. Check the FAQ at:
> >http://www.vtk.org/Wiki/VTK_FAQ
> >Follow this link to subscribe/unsubscribe:
> >http://www.vtk.org/mailman/listinfo/vtkusers
>
>

_______________________________________________
This is the private VTK discussion list.
Please keep messages on-topic. Check the FAQ at: http://www.vtk.org/Wiki/VTK_FAQ
Follow this link to subscribe/unsubscribe:
http://www.vtk.org/mailman/listinfo/vtkusers
Reply | Threaded
Open this post in threaded view
|

Re: How to compile tutorial example?

James Frye
In reply to this post by Obada Mahdi
Hey, that's it!

I haven't figured out the dependencies, though, but just repeating the
list of libraries a second time did the trick.  Thanks!

Now I just have to either figure out how to make it run with Xinerama, or
hope FedEx delivers my new display inverter sometime soon :-)

Thanks again,
James

On Fri, 10 Feb 2006, Obada Mahdi wrote:

> here is another hint which might be worth trying.
>
> In your Makefile, libraries are mentioned based on lexicographical
> order.  From what I know about the linking process, the order is
> significant; undefined symbols are looked up in the libraries in the
> order they are mentioned in the argument list, but (yet unused) symbols
> exported by a library are not remembered for later lookup.
>
> You can check library dependencies by having a look at the file
> "VTKLibraryDepends.cmake", which in your installation should reside
> somewhere in "/opt/vtk/lib/vtk-5.0".  In case this is the cause of your
> "undefined symbols" problem, rearranging the libraries in the argument
> list (so that every library is mentioned _before_ its dependencies)
> should help.

_______________________________________________
This is the private VTK discussion list.
Please keep messages on-topic. Check the FAQ at: http://www.vtk.org/Wiki/VTK_FAQ
Follow this link to subscribe/unsubscribe:
http://www.vtk.org/mailman/listinfo/vtkusers
Reply | Threaded
Open this post in threaded view
|

Re: How to compile tutorial example?

Xiaofeng Z
In reply to this post by Obada Mahdi
>In your Makefile, libraries are mentioned based on lexicographical
>order.  From what I know about the linking process, the order is
>significant;

I don't think that's true anymore for the latest gcc.

Xiaofeng Zhao
www.xzing.org




>From: Obada Mahdi <[hidden email]>
>To: James Frye <[hidden email]>
>CC: [hidden email]
>Subject: Re: [vtkusers] How to compile tutorial example?
>Date: Fri, 10 Feb 2006 21:14:01 +0100
>
>Hi James,
>
>here is another hint which might be worth trying.
>
>On Feb 9, 2006, at 11:36 PM, James Frye wrote:
> > Since there is no Makefile, I made a simple one, which I've  included at
> > the end.  The problem is that this gives me about 54K lines of  
>"undefined
> > reference to vtkSomething..." messages.  [...]
>
>[Makefile]
> > LIBS = -L/opt/vtk/lib \
> >        -lvtkCommon -lvtkDICOMParser -lvtkFiltering -
>lvtkGenericFiltering \
> >        -lvtkGraphics -lvtkHybrid -lvtkIO -lvtkImaging - lvtkMPEG2Encode
>\
> >        -lvtkNetCDF -lvtkRendering -lvtkVolumeRendering - lvtkWidgets    
>\
> >        -lvtkexoIIc -lvtkexpat -lvtkfreetype -lvtkftgl -lvtkjpeg -
>lvtkpng \
> >        -lvtksys -lvtktiff -lvtkzlib
>
>In your Makefile, libraries are mentioned based on lexicographical
>order.  From what I know about the linking process, the order is
>significant; undefined symbols are looked up in the libraries in the
>order they are mentioned in the argument list, but (yet unused) symbols
>exported by a library are not remembered for later lookup.
>
>You can check library dependencies by having a look at the file
>"VTKLibraryDepends.cmake", which in your installation should reside
>somewhere in "/opt/vtk/lib/vtk-5.0".  In case this is the cause of your
>"undefined symbols" problem, rearranging the libraries in the argument
>list (so that every library is mentioned _before_ its dependencies)
>should help.
>
>
>Regards
>
>Obada
>
>_______________________________________________
>This is the private VTK discussion list. Please keep messages on-topic.
>Check the FAQ at: http://www.vtk.org/Wiki/VTK_FAQ
>Follow this link to subscribe/unsubscribe:
>http://www.vtk.org/mailman/listinfo/vtkusers


_______________________________________________
This is the private VTK discussion list.
Please keep messages on-topic. Check the FAQ at: http://www.vtk.org/Wiki/VTK_FAQ
Follow this link to subscribe/unsubscribe:
http://www.vtk.org/mailman/listinfo/vtkusers
Reply | Threaded
Open this post in threaded view
|

Re: How to compile tutorial example?

Xiaofeng Z
In reply to this post by James Frye
Apparently, the ordering of library is import for gcc 3.3.3

Xiaofeng Zhao
www.xzing.org




>From: James Frye <[hidden email]>
>To: Obada Mahdi <[hidden email]>
>CC: [hidden email]
>Subject: Re: [vtkusers] How to compile tutorial example?
>Date: Fri, 10 Feb 2006 12:30:44 -0800 (PST)
>
>Hey, that's it!
>
>I haven't figured out the dependencies, though, but just repeating the
>list of libraries a second time did the trick.  Thanks!
>
>Now I just have to either figure out how to make it run with Xinerama, or
>hope FedEx delivers my new display inverter sometime soon :-)
>
>Thanks again,
>James
>
>On Fri, 10 Feb 2006, Obada Mahdi wrote:
>
> > here is another hint which might be worth trying.
> >
> > In your Makefile, libraries are mentioned based on lexicographical
> > order.  From what I know about the linking process, the order is
> > significant; undefined symbols are looked up in the libraries in the
> > order they are mentioned in the argument list, but (yet unused) symbols
> > exported by a library are not remembered for later lookup.
> >
> > You can check library dependencies by having a look at the file
> > "VTKLibraryDepends.cmake", which in your installation should reside
> > somewhere in "/opt/vtk/lib/vtk-5.0".  In case this is the cause of your
> > "undefined symbols" problem, rearranging the libraries in the argument
> > list (so that every library is mentioned _before_ its dependencies)
> > should help.
>
>_______________________________________________
>This is the private VTK discussion list.
>Please keep messages on-topic. Check the FAQ at:
>http://www.vtk.org/Wiki/VTK_FAQ
>Follow this link to subscribe/unsubscribe:
>http://www.vtk.org/mailman/listinfo/vtkusers


_______________________________________________
This is the private VTK discussion list.
Please keep messages on-topic. Check the FAQ at: http://www.vtk.org/Wiki/VTK_FAQ
Follow this link to subscribe/unsubscribe:
http://www.vtk.org/mailman/listinfo/vtkusers