Error: :cannot specify -o when generating multiple output files VTK + QT
-
@mcosta My pro file:
INCLUDEPATH += "/usr/include/vtk-6.2/"
LIBS += -L"/usr/lib/vtk-6.2" -lvtkCommon -lvtksys -lQVTK -lvtkRendering -lvtkGraphics -lvtkIO -lvtkInfovis -lvtkViews -lvtkFiltering -lvtkHybrid -lvtkWidgetsI correct my error, but the qt is not find the vtk libraries. Any tips?
-
@mcosta I made a mistake, now this is my pro file:
QT += core guigreaterThan(QT_MAJOR_VERSION, 4): QT += widgets
TARGET = Pandora
TEMPLATE = app
TRANSLATIONS = EN_english.ts
PT_portuguese.ts\SOURCES += main.cpp
brprint3d.cpp
loading.cpp
legalwarning.cpp
aboutbrprint.cpp
documentation.cpp
help.cpp
warning.cppHEADERS += brprint3d.h
loading.h
legalwarning.h
aboutbrprint.h
documentation.h
help.h
warning.h \FORMS +=
loading.ui
legalwarning.ui
aboutbrprint.ui
documentation.ui
help.ui
warning.ui
Pandora.uiRESOURCES +=
images.qrc
translations.qrc
fonts.qrcDISTFILES +=
But i'm still have problems, if i do this way:
INCLUDEPATH += "/usr/local/include/vtk-6.2/"
LIBS += -L"/usr/local/lib" -lvtksys -lQVTK -lvtkRendering -lvtkGraphics -lvtkIO -lvtkInfovis -lvtkViews -lvtkFiltering -lvtkHybrid -lvtkWidgetsI'm get this errors:
/usr/bin/ld: cannot find -lvtkCommon
/usr/bin/ld: cannot find -lvtksys
/usr/bin/ld: cannot find -lQVTK
/usr/bin/ld: cannot find -lvtkRendering
/usr/bin/ld: cannot find -lvtkGraphics
/usr/bin/ld: cannot find -lvtkIO
/usr/bin/ld: cannot find -lvtkInfovis
/usr/bin/ld: cannot find -lvtkViews
/usr/bin/ld: cannot find -lvtkFiltering
/usr/bin/ld: cannot find -lvtkHybridIf i do this:
INCLUDEPATH += "/usr/local/include/vtk-6.2/"
LIBS += -L"/usr/local/lib"
I get this errors:
"../Pandora/brprint3d.cpp:(.text+0x49cc): undefined reference to `vtkSmartPointerBase::~vtkSmartPointerBase()'"How to link the libraries?
-
@mcosta I did this:
INCLUDEPATH += "/usr/local/include/vtk-6.2/"
LIBS += -L"/usr/local/lib" -lvtkCommonCore-6.2 -lvtkalglib-6.2 -lvtkChartsCore-6.2 -lvtkDICOMParser-6.2 -lvtkDomainsChemistry-6.2 -lvtkexpat-6.2
-lvtkFiltersCore-6.2 -lvtkfreetype-6.2 -lvtkGeovisCore-6.2 -lvtkgl2ps-6.2 -lvtkGUISupportQt-6.2 -lvtkhdf5-6.2 -lvtkImagingCore-6.2 -lvtkInfovisCore-6.2
-lvtkInteractionImage-6.2 -lvtkInteractionStyle-6.2 -lvtkInteractionWidgets-6.2 -lvtkIOCore-6.2 -lvtkParallelCore-6.2 -lvtkRenderingCore-6.2 -lvtksys-6.2 -lvtkViewsCore-6.2\ -lvtkViewsQt-6.2 -lvtkzlib-6.2And now i got this error:
error: brprint3d.o: undefined reference to symbol '_ZN12vtkAlgorithm13GetOutputPortEi'Because of this: "If you get something that looks like:
undefined reference to `__imp___ZN13vtkTIFFReader3NewEv' collect2: ld returned 1 exit status. You certainly forgot to pass in a library to your executable."
But if i add all the vtk libs, how i forgot to pass a library?how to fix it?
-
Try to put
#include <vtkAutoInit.h>VTK_MODULE_INIT( vtkRenderingOpenGL );
VTK_MODULE_INIT( vtkInteractionStyle );
VTK_MODULE_INIT( vtkRenderingFreeTypeOpenGL );
VTK_MODULE_INIT( vtkRenderingFreeType );right before your main
Also vtk has its own mailing list you could try there.
I just have not used it on Linux for ages. -
I alredy compiled my app, but now i have this error: no override found for 'vtkPolyDataMapper' when i run my app and try to read my file, the app crash.
I discover that i need to use cmake, but i dont now how to write the cmakelists.txt@alex_malyu this is to put and works without build with cmake?
-
I do not have to use cmake,
We just build vtk and qt and link to them in VS project.If it is linked but you get run-time error it means there is lack of run-time initialization ( related to system/driver specific needs),
If you used CMAKE this would be handled buy cot it generate.
Above given code provides initialization of some modules and is sufficient for me .