You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The errors go away when using add_definitions(-DGTSAM_EXPORTS) in CMakeLists.txt to set the GTSAM_EXPORT macro to __declspec(dllexport).
However, the problem is that gtsam_points depends on GTSAM and when its headers are included they as well have the GTSAM_EXPORTS macro active and therefore treat GTSAM's symbols as exported symbols! This causes other problems in the build.
So including GTSAM headers should be done under a regime of __declspec(dllimport) (not export!), as we're just using GTSAM as a library, not building it.
Therefore I think gtsam_points should have its own dllexport.h header file and use the definition GTSAM_POINTS_EXPORTS and macro name GTSAM_POINTS_EXPORT to avoid the confusion with the GTSAM macros.
I am building on Windows 10, x64.
The text was updated successfully, but these errors were encountered:
Thanks for reporting the issue.
I agree with that we should have our own EXPORT macros. While I've been occupied with some works in next a few weeks, l try to add these macros to support build on windows in next month.
When building gtsam_points I get plenty of linker errors like this one:
isam2_ext.cpp.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: static void __cdecl
gtsam_points::UpdateImpl::LogStartingUpdate(class gtsam::NonlinearFactorGraph const &,class gtsam_points::ISAM2Ext const &)"
(_imp?LogStartingUpdate@UpdateImpl@gtsam_points@@SAXAEBVNonlinearFactorGraph@gtsam@@AEBVISAM2Ext@2@@z) referenced in function "public: virtual struct gtsam_points::ISAM2ResultExt __cdecl gtsam_points::ISAM2Ext::update(class gtsam::NonlinearFactorGraph const &,class gtsam::Values const &,struct gtsam::ISAM2UpdateParams const &)" (?update@ISAM2Ext@gtsam_points@@UEAA?AUISAM2ResultExt@2@AEBVNonlinearFactorGraph@gtsam@@AEBVValues@5@AEBUISAM2UpdateParams@5@@z)
The errors go away when using
add_definitions(-DGTSAM_EXPORTS)
in CMakeLists.txt to set theGTSAM_EXPORT
macro to__declspec(dllexport)
.However, the problem is that gtsam_points depends on GTSAM and when its headers are included they as well have the
GTSAM_EXPORTS
macro active and therefore treat GTSAM's symbols as exported symbols! This causes other problems in the build.So including GTSAM headers should be done under a regime of
__declspec(dllimport)
(not export!), as we're just using GTSAM as a library, not building it.Therefore I think gtsam_points should have its own
dllexport.h
header file and use the definitionGTSAM_POINTS_EXPORTS
and macro nameGTSAM_POINTS_EXPORT
to avoid the confusion with the GTSAM macros.I am building on Windows 10, x64.
The text was updated successfully, but these errors were encountered: