View Issue Details Jump to Notes ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0000833CMakepublic2004-05-11 23:232004-05-17 14:43
ReporterMathieu Malaterre 
Assigned ToBill Hoffman 
PrioritynormalSeveritymajorReproducibilityalways
StatusclosedResolutionno change required 
PlatformOSOS Version
Product Version 
Target VersionFixed in Version 
Summary0000833: Duplicate objects files with SWIG_ADD_MODULE
DescriptionCMake Version 2.x

When using:
  FIND_PACKAGE(SWIG REQUIRED)
  INCLUDE(${SWIG_USE_FILE})

  SET_SOURCE_FILES_PROPERTIES(gdcm.i PROPERTIES CPLUSPLUS ON)
  SET_SOURCE_FILES_PROPERTIES(gdcm.i PROPERTIES SWIG_FLAGS "-includeall")
  SWIG_ADD_MODULE(foobar python
    gdcm.i gdcm_wrap.cxx)
  SWIG_LINK_LIBRARIES(foobar gdcm ${PYTHON_LIBRARIES})


It produces:

c++ -fPIC -shared -Wl,-soname,_foobar.so -o /home/malaterre/Creatis/write/gdcmbin2/bin/_foobar.so gdcm_wrap.o gdcm_wrap.o -L/home/malaterre/Creatis/write/gdcmbin2/bin -L/usr/lib/python2.3/config -lgdcm -lpython2.3 -lgdcmijpeg8 -lgdcmijpeg12 -lgdcmljpeg -Wl,-rpath,/home/malaterre/Creatis/write/gdcmbin2/bin:/usr/lib/python2.3/config -lgcc


Since gdcm_wrap.o is being duplicate I get an error.
TagsNo tags attached.
Attached Files

 Relationships

  Notes
(0001062)
Bill Hoffman (manager)
2004-05-17 14:43

By including gdcm.i in the SWIG_ADD_MODULE line, the generated file gdcm_wrap.cxx will automatically be included by the SWIG_ADD_MODULE command. So just remove the gdcm_wrap.cxx from the SWIG_ADD_MODULE call, and it should work as expected.


 Issue History
Date Modified Username Field Change


Copyright © 2000 - 2018 MantisBT Team