Hello,

>I'm getting the following error when running make:
>[ 78%] Built target openbabel
>Linking CXX executable ../bin/babel.exe
>../src/libopenbabel.a(plugin.obj):c:/msys/1.0/home/igor/openbabel-2.3.1/src/plug
>in.cpp:336: undefined reference to `OpenBabel::theQEqCharges'
>../src/libopenbabel.a(plugin.obj):c:/msys/1.0/home/igor/openbabel-2.3.1/src/plug
>in.cpp:337: undefined reference to `OpenBabel::theQTPIECharges'
>../src/libopenbabel.a(genbankformat.obj):c:/msys/1.0/home/igor/openbabel-2.3.1/s
>rc/formats/genbankformat.cpp:137: undefined reference to
>`OpenBabel::ReadFASTASe
>quence(OpenBabel::OBMol*, int, std::istream*, bool, bool)'
>collect2: ld returned 1 exit status
>make[2]: *** [bin/babel.exe] Error 1
>make[1]: *** [tools/CMakeFiles/babel.dir/all] Error 2
>make: *** [all] Error 2

ok, you've caught me cheating a bit. :-) I've got those too but worked around 
them by commenting out the affected lines of code in plugin.cpp and 
genbankformat.cpp since I don't need them at the moment. After doing that I ran 
into the problems I've already mentioned.

The next thing I've tried is to change this code in src/formats/CMakeLists.txt:

set(ADD_INCHI_FORMAT FALSE)
if(WITH_INCHI)
  if(NOT OPENBABEL_USE_SYSTEM_INCHI)
    set(ADD_INCHI_FORMAT TRUE)
  else()
    if (EXISTS ${INCHI_LIBRARY})
      set(ADD_INCHI_FORMAT TRUE)
    else (EXISTS ${INCHI_LIBRARY})
      message("WARNING: INCHI_LIBRARY not set, or does not exist.\n....InChI 
format will NOT be compiled.")
    endif()
  endif()
endif()

if(ADD_INCHI_FORMAT)
  add_definitions(-DINCHI_LINK_AS_DLL)
  if(NOT OPENBABEL_USE_SYSTEM_INCHI)
    add_subdirectory(inchi103)
    include_directories(${CMAKE_SOURCE_DIR}/include/inchi103)
    set(libs ${libs} inchi)
  else()
    include_directories(${INCHI_INCLUDE_DIR})
    set(libs ${libs} ${INCHI_LIBRARY})
  endif()
  set(inchiformat_additional_sources getinchi.cpp ../ops/unique.cpp)
  set(formats_common
    ${formats_common}
    inchiformat
  )
endif()

which, if I understand it correctly, should include the /inchi103 subdirectory 
and the neccessary include files into the compilation and add 'inchiformat' to 
the list of supported formats.

But even when I change it to:

  add_definitions(-DINCHI_LINK_AS_DLL)  //Is this needed for static linking as 
well?
    add_subdirectory(inchi103)
    include_directories(${CMAKE_SOURCE_DIR}/include/inchi103)
    set(libs ${libs} inchi)
  set(formats_common
    ${formats_common}
    inchiformat
  )

which should force inclusion of inchiformat regardless of any environment 
variables set, the linking errors persist.

Best regards,

Ernst-Georg

------------------------------------------------------------------------------
The demand for IT networking professionals continues to grow, and the
demand for specialized networking skills is growing even more rapidly.
Take a complimentary Learning@Cisco Self-Assessment and learn 
about Cisco certifications, training, and career opportunities. 
http://p.sf.net/sfu/cisco-dev2dev
_______________________________________________
OpenBabel-Devel mailing list
OpenBabel-Devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openbabel-devel

Reply via email to