[vtkusers] FLTK and VTK on VC++

Sean McInerney seanm at nmr.mgh.harvard.edu
Fri Jun 24 14:43:43 EDT 2005


Hi Hassan,

A couple points:

1. Fl_Window should be included as <FL/Fl_Window.H>
2. I have never had the compile-time problem finding 'floor' using VS71
or BCB5.5 on Win32 or GCC on Linux and Solaris, so I think that the
include order for <math.h> may be a red herring.
3. You should be using CMake for your build process. Handcrafting
makefiles for a project using VTK is not recommended.

Have a look at either my or Charl Botha's VTK - FLTK projects.

Good Luck!

-Sean

Hassan Amin wrote:
> Sean McInerney wrote:
> 
>> Hi Hassan,
>>
>> Your main function does not seem to require FLTK at all. You have VTK's
>> standard interactor handling the event loop and never create any FLTK
>> widgets or start the FLTK event loop. I suggest testing what you have
>> without FLTK and later looking to available VTK - FLTK examples as
>> guides when it comes time to add a GUI.
>>
>> -Sean
>>
>> Hassan Amin wrote:
>>  
>>
>>> Cesar Rabak wrote:
>>>
>>>   
>>>
>>>> It seems FLTK includes in its 'math.h' the header file
>>>> <float.h>, but VC++ declares floor in its own <math.h>
>>>> header.
>>>>
>>>> Try to put #include <math.h> ahead of the FLTK include
>>>> files and see if the compilation goes.
>>>>
>>>> HTH
>>>>
>>>> --- Hassan Amin <sha1 at doc.ic.ac.uk> escreveu:
>>>>
>>>>
>>>>
>>>>     
>>>>
>>>>> I am a beginner at VTK.I am trying to use FLTK with
>>>>> VTK on VC++ .Net platform. I am getting the following compilation
>>>>> error :
>>>>> C:\fltk_bin\FL\math.H(59): error C3861: 'floor':
>>>>> identifier not found, even with argument-dependent lookup
>>>>> Please help me with this error. Has anybody tried to
>>>>> use MFC-VTK combination on windows , is there any help available
>>>>> on that direction.
>>>>>
>>>>> S. Hassan Amin
>>>>>
>>>>>
>>>>> _______________________________________________
>>>>> 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
>>>>>
>>>>>  
>>>>>       
>>>>
>>>>
>>>>
>>>>             _______________________________________________________
>>>> Yahoo! Acesso
>>>> Grátis - Internet rápida e grátis. Instale o discador agora!
>>>> http://br.acesso.yahoo.com/
>>>>
>>>>
>>>>     
>>>
>>> No , it did not work , here is the code that I am trying to compile on
>>> VC++ .Net :-
>>> #include <math.h>
>>> #include <Fl_Window.H>
>>> #include "vtkConeSource.h"
>>> #include "vtkPolyDataMapper.h"
>>> #include "vtkPolyDataReader.h"
>>> #include "vtkRenderWindow.h"
>>> #include "vtkRenderWindowInteractor.h"
>>> #include "vtkCamera.h"
>>> #include "vtkActor.h"
>>> #include "vtkRenderer.h"
>>>
>>> //**************************************************************************
>>>
>>>
>>> void FL_Initialize();
>>> //**************************************************************************
>>>
>>>
>>> void main()
>>> {
>>> vtkPolyDataReader *lmk_reader = vtkPolyDataReader::New();
>>> lmk_reader->SetFileName("C:\\notred\\eigenspace\\02463_458.vtk");
>>> vtkPolyDataMapper *coneMapper = vtkPolyDataMapper::New();
>>> coneMapper->SetInput( lmk_reader->GetOutput() );
>>> vtkActor *coneActor = vtkActor::New();
>>> coneActor->SetMapper( coneMapper );
>>> vtkRenderer *ren1= vtkRenderer::New();
>>> ren1->AddActor( coneActor );
>>> ren1->SetBackground( 0.1, 0.2, 0.4 );
>>> vtkRenderWindow *renWin = vtkRenderWindow::New();
>>> renWin->AddRenderer( ren1 );
>>> renWin->SetSize( 300, 300 );
>>> int i;
>>> for (i = 0; i < 360; ++i)
>>>   {
>>>   // render the image
>>>   renWin->Render();
>>>   // rotate the active camera by one degree
>>>   ren1->GetActiveCamera()->Azimuth( 1 );
>>>   }
>>>
>>> //
>>> vtkRenderWindowInteractor *iren = vtkRenderWindowInteractor::New();
>>> iren->SetRenderWindow(renWin);
>>> //Setting up event processing loop
>>> iren->Initialize();
>>> iren->Start();
>>> //Cleaning
>>> lmk_reader->Delete();
>>> coneMapper->Delete();
>>> coneActor->Delete();
>>> ren1->Delete();
>>> renWin->Delete();
>>>
>>>
>>> }
>>> //******************************************************************************
>>>
>>>
>>> void FL_Initialize()
>>> {
>>> // set up main FLTK window
>>> Fl_Window *mainWindow = new Fl_Window(875, 650,"Matcher");
>>> }
>>>
>>> Thanks,
>>>
>>> S. Hassan Amin
>>> _______________________________________________
>>> 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
>>>   
>>
>>
>>  
>>
> u r right , but if I cant even compile them properly. Then I cant try
> them together .
> 
> 



More information about the vtkusers mailing list