LNK2038 error when trying to compile PCL - debug and release mixup? pcl-1.8.0

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

LNK2038 error when trying to compile PCL - debug and release mixup? pcl-1.8.0

Mike6000
I have problems compiling PCL 1.8.0 for use with QT. I need to get the pcl visualizer running in QT as I need a more rich GUI than PCL can provide alone.

I followed advice from both these references:
http://sideproject.acraig.za.net/2016/11/17/building-pcl-with-qt-support/
https://translate.googleusercontent.com/translate_c?depth=1&hl=en&rurl=translate.google.com&sl=ja&sp=nmt4&tl=en&u=https://gist.github.com/UnaNancyOwen/59319050d53c137ca8f3&usg=ALkJrhhq5qc6kVbIm7-JpLUKkp7emwGJiA#file-pcl1-8-0-md

pcl 1.8.0
qt from precompiled binaries
Boost from precompiled binaries
Eigen (running CMAKE on it and loading into MS VC2015 Express edition and INSTALLING from there).
Flann (configured with cmake as well as compiled and Installed from MS VC 2015 Express edition). CMAKE finds it and seems happy.
VTK7.00 (configured with cmake as well as compiled and Installed from MS VC 2015 Express edition). CMAKE finds it and seems happy.
qhull-2015.2 (configured with cmake as well as compiled and Installed from MS VC 2015 Express edition). CMAKE finds it and seems happy.

When i make a build folder under the c:\pcl-pcl-1.8.0 folder and start CMAKE I am able to comfigure and generate without any errors. See results from CMAKE below.

Problem:

I get LNK2038 errors when trying to build ALL_BUILD in release

Error LNK2038 mismatch detected for '_ITERATOR_DEBUG_LEVEL': value '2' doesn't match value '0' in pcd_grabber.obj pcl_io C:\pcl-pcl-1.8.0\build\io\vtkCommonDataModel-7.0.lib(vtkFieldData.obj) 1


I also get LNK2001 errors when trying to build ALL_BUILD in release

Error LNK2001 unresolved external symbol __imp__invalid_parameter pcl_visualization C:\pcl-pcl-1.8.0\build\visualization\vtkViewsCore-7.0.lib(vtkDataRepresentation.obj) 1

It seems to be pcl_io, pcl_visualization and pcl_filters that generate these error messages.

I am becoming desperate after several days of trying to get this to work. Can anyone give any hints to what I am doing wrong?

Results from CMAKE when pointed to src c:\pcl-pcl-1.8.0 and where to build C:/pcl-pcl-1.8.0/build  -->

Could NOT find PkgConfig (missing:  PKG_CONFIG_EXECUTABLE)
Found OpenMP
Eigen found (include: C:/Program Files/Eigen3/include/eigen3, version: 3.3.90)
FLANN found (include: C:/Program Files/flann/include, lib: optimized;C:/Program Files/flann/lib/flann_cpp_s.lib;debug;C:/Program Files/flann/lib_d/flann_cpp_s-gd.lib)
QHULL found (include: C:/Program Files/qhull/include, lib: optimized;C:/Program Files/qhull/lib/qhullstatic.lib;debug;C:/Program Files/qhull/lib/qhullstatic_d.lib)
VTK_MAJOR_VERSION 7, rendering backend: OpenGL
VTK found (include: C:/Program Files/VTK/include/vtk-7.0, lib: vtkChartsCore;vtkCommonColor;vtkCommonDataModel;vtkCommonMath;vtkCommonCore;vtksys;vtkCommonMisc;vtkCommonSystem;vtkCommonTransforms;vtkInfovisCore;vtkFiltersExtraction;vtkCommonExecutionModel;vtkFiltersCore;vtkFiltersGeneral;vtkCommonComputationalGeometry;vtkFiltersStatistics;vtkImagingFourier;vtkImagingCore;vtkalglib;vtkRenderingContext2D;vtkRenderingCore;vtkFiltersGeometry;vtkFiltersSources;vtkRenderingFreeType;vtkfreetype;vtkzlib;vtkDICOMParser;vtkDomainsChemistry;vtkIOXML;vtkIOGeometry;vtkIOCore;vtkIOXMLParser;vtkexpat;vtkFiltersAMR;vtkParallelCore;vtkIOLegacy;vtkFiltersFlowPaths;vtkFiltersGeneric;vtkFiltersHybrid;vtkImagingSources;vtkFiltersHyperTree;vtkFiltersImaging;vtkImagingGeneral;vtkFiltersModeling;vtkFiltersParallel;vtkFiltersParallelImaging;vtkFiltersProgrammable;vtkFiltersSMP;vtkFiltersSelection;vtkFiltersTexture;vtkFiltersVerdict;verdict;vtkGUISupportQt;vtkInteractionStyle;vtkRenderingOpenGL;vtkImagingHybrid;vtkIOImage;vtkmetaio;vtkjpeg;vtkpng;vtktiff;vtkGUISupportQtOpenGL;vtkGUISupportQtSQL;vtkIOSQL;vtksqlite;vtkGeovisCore;vtkInfovisLayout;vtkInteractionWidgets;vtkRenderingAnnotation;vtkImagingColor;vtkRenderingVolume;vtkViewsCore;vtkproj4;vtkIOAMR;vtkhdf5_hl;vtkhdf5;vtkIOEnSight;vtkIOExodus;vtkexoIIc;vtkNetCDF;vtkNetCDF_cxx;vtkIOExport;vtkRenderingGL2PS;vtkRenderingContextOpenGL;vtkgl2ps;vtkRenderingLabel;vtkIOImport;vtkIOInfovis;vtklibxml2;vtkIOLSDyna;vtkIOMINC;vtkIOMovie;vtkoggtheora;vtkIONetCDF;vtkIOPLY;vtkIOParallel;vtkjsoncpp;vtkIOParallelXML;vtkIOVideo;vtkImagingMath;vtkImagingMorphological;vtkImagingStatistics;vtkImagingStencil;vtkInteractionImage;vtkRenderingImage;vtkRenderingLIC;vtkRenderingLOD;vtkRenderingQt;vtkRenderingVolumeOpenGL;vtkViewsContext2D;vtkViewsInfovis;vtkViewsQt
Boost version: 1.59.0
Found the following Boost libraries:
  system
  filesystem
  thread
  date_time
  iostreams
  chrono
  atomic
  regex
DOXYGEN_FOUND
HTML_HELP_COMPILER
Found CPack generators: NSIS
The following subsystems will be built:
  common
  octree
  io
  kdtree
  search
  sample_consensus
  filters
  2d
  geometry
  features
  ml
  segmentation
  visualization
  surface
  registration
  keypoints
  tracking
  recognition
  stereo
  outofcore
  people
The following subsystems will not be built:
  apps: No reason
  examples: Code examples are disabled by default.
  simulation: Disabled by default.
  global_tests: No reason
  tools: Disabled manually.
Configuring done
Generating done



Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: LNK2038 error when trying to compile PCL - debug and release mixup? pcl-1.8.0

Sérgio Agostinho
The easy solution is to use the all-in-one installer Tsukasa (UnaNancyOwen) compiled.


Cheers


_______________________________________________
[hidden email] / http://pointclouds.org
http://pointclouds.org/mailman/listinfo/pcl-users

smime.p7s (4K) Download Attachment
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: LNK2038 error when trying to compile PCL - debug and release mixup? pcl-1.8.0

Mike6000
Hi @Sergio Agostinho I am going to use the pcl visualizer with QT. Sometthing like this as I need a rich GUI with buttons etc but also the PCL visualizer.



UnaNancuOwen wrote that for at least the pcl-1.8.0 that you MUST compile from sources and not use the all-in-one-installer (?). Or did I misunderstand?

https://translate.googleusercontent.com/translate_c?depth=1&hl=en&rurl=translate.google.com&sl=ja&sp=nmt4&tl=en&u=https://github.com/UnaNancyOwen/qt_visualizer&usg=ALkJrhjuGMD5BkdPTyvfyuY9Fms4Oy-mEQ

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: LNK2038 error when trying to compile PCL - debug and release mixup? pcl-1.8.0

Sérgio Agostinho
I don’t see why the all-in-one installer shouldn’t work. If he’s bundling QT and VTK, it’s likely that he’s enabling already the qt-vtk-widget, the thing you’re gonna need in order to visualize a pointcloud inside your Qt app. Some of PCL’s apps use the same concept. Then again, I’m not a windows users and I’ve never checked the contents of the bundle.

PCLvisualizer is a standalone VTK enabled class, it has nothing to do with QT. But it’s a good way to debug things in case your interaction with the widget is not generating what you expected.

Cheers


_______________________________________________
[hidden email] / http://pointclouds.org
http://pointclouds.org/mailman/listinfo/pcl-users

smime.p7s (4K) Download Attachment
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: LNK2038 error when trying to compile PCL - debug and release mixup? pcl-1.8.0

Mike6000
No that all in one installer didnt work. The all in one installers does not have the needed QT support. That's why it is needed to compile from scratch. Still stuck.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: LNK2038 error when trying to compile PCL - debug and release mixup? pcl-1.8.0

Sérgio Agostinho
I'll relay the info to Tsukasa. Nevertheless there's still gonna be at least one more RC before the final release.

2017-07-12 11:47 GMT+01:00 Mike6000 <[hidden email]>:
No that all in one installer didnt work. The all in one installers does not
have the needed QT support. That's why it is needed to compile from scratch.
Still stuck.



--
View this message in context: http://www.pcl-users.org/LNK2038-error-when-trying-to-compile-PCL-debug-and-release-mixup-pcl-1-8-0-tp4044738p4044755.html
Sent from the Point Cloud Library (PCL) Users mailing list mailing list archive at Nabble.com.
_______________________________________________
[hidden email] / http://pointclouds.org
http://pointclouds.org/mailman/listinfo/pcl-users


_______________________________________________
[hidden email] / http://pointclouds.org
http://pointclouds.org/mailman/listinfo/pcl-users
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: LNK2038 error when trying to compile PCL - debug and release mixup? pcl-1.8.0

Tsukasa Sugiura
If you want to use PCL with Qt, You can not use pre-built PCL (and VTK) that installed by all-in-one installer.
These binaries has been disabled the Qt option.

First, You need to build QVTK from source code. (That is built VTK with enable Qt option.)
At this step, please install Qt, and check VTK_Group_Qt option, set VTK_QT_VERSION to 5 in CMake configuration of VTK.

Then, You need to build PCL that linked QVTK from source code.
At this step, set QVTK path to VTK_DIR, and check WITH_QT option in CMake congfiguration.
Incidentally, You can use pre-built 3rd-Party libraries (Boost, Eigen, FLANN, QHull, OpenNI2) other than VTK that included in all-in-one installer.

Please read this article for details.
http://unanancyowen.com/en/pcl-with-qt/

Best regards,
Tsukasa Sugiura

_______________________________________________
[hidden email] / http://pointclouds.org
http://pointclouds.org/mailman/listinfo/pcl-users
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

earn to die

earntodieaz
This post has NOT been accepted by the mailing list yet.
In reply to this post by Mike6000
Thanks for sharing. I hope it will be helpful for too many people that are searching for this topic.
-earn to die
-age of war
-plants vs zombies
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: LNK2038 error when trying to compile PCL - debug and release mixup? pcl-1.8.0

Mike6000
In reply to this post by Tsukasa Sugiura
Thanks for info Tsukasa!

I downloaded the latest all-in-one installer pcl-1.8.1rc1 from here as suggested by the other gentleman over from this link ->  https://github.com/PointCloudLibrary/pcl/releases/tag/pcl-1.8.1rc1

I have downloaded VTK 8.0.0

I downloaded the qt5 source files.

I discovered that the qt5 sources seems to be "intended for" compiling with VS2015 (?)

Question: should I / can I compile PCL1.8.1rc1 and VTK8.00 with linking against the prebuilt libraries (boost, flann etc in the all-in-one installer from the link above) with VS2017 without problems.

Or: should I use VS2015?

Summarized: I have both VS2015 and VS2017 on my dev system. For the latest versions of PCL (1.1.1rc1), VTK (8.00) should I use VS2015 or VS2017?
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: LNK2038 error when trying to compile PCL - debug and release mixup? pcl-1.8.0

Mike6000
In reply to this post by Tsukasa Sugiura
One more question Tsukasa:

if I specify OPENGL_gl_LIBRARY as opengl and not opengl32 when I compile VTK, I get a compile error when I try to build the shared libs (.DLL). The compile of the libraries compiles without errors when specifying opengl by the way.

Your tutorial mentions opengl and not opengl32. What is the correct setting opengl or opengl32? I am on Windows 10.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: LNK2038 error when trying to compile PCL - debug and release mixup? pcl-1.8.0

Mike6000
In reply to this post by Tsukasa Sugiura
Update: I got PCL 1.8.1rc1 to compile but I got something like 6000 warnings (no errors so the compile went thru). However 6000 + warnings makes me feel a but well ... "warned" lol. Is this ok or not?

Mainly it is these two classes of warnings (apart from some argument type and constant type warnings that looks fairly harmless):

C4251 xxx needs to have dll-interface to be used by clients of class yyy

C4275 non dll-interface class aaa used as base for dll-interface class bbb

What causes these warnings?

Loading...