[CMake] problem creating a library on mac

John Doe ufnoise at gmail.com
Thu Sep 27 20:59:43 EDT 2007


Did you run nm on the library containing these symbols to verify they exist?

_tetra_zone_copy_
_xyz_vertex_copy_

The trailing underscore is reminiscent of a Fortran compiler.  Are you using
the write convention when calling these functions from C code?  On Linux,
you would call the Fortran function foo as foo_.

Should you be linking against libm, if you are getting the same symbols from
libimf.a?

ld: warning multiple definitions of symbol _modf
/opt/intel/cc/10.0.016/lib/libimf.a(modf_stub.o) definition of _modf in
section (__TEXT,__text)
/usr/lib/gcc/i686-apple-darwin8/4.0.1/../../..//libm.dylib(xmm_floor.o)
definition of _modf

Regards,

Juan

On 9/27/07, Marie-Christine Vallet <mmvallet at ucdavis.edu> wrote:
>
> Mike Jackson wrote:
> > Marie,
> >   Use the following in your CMakeLists.txt file, generally near the
> > top just after you define the PROJECT (... )
> >
> > SET (LIBRARY_OUTPUT_PATH "${PROJECT_BINARY_DIR}/Bin" CACHE INTERNAL
> > "For libraries.")
> > SET (EXECUTABLE_OUTPUT_PATH "${PROJECT_BINARY_DIR}/Bin" CACHE INTERNAL
> > "For executables.")
> >
> done
> > This will put all the compiled libraries and executables into the same
> > bin directory.
> >
> > Also, I think you may be missing a key philosophy of CMake which is
> > "Out of Source" builds. In your project folder create a new folder
> > called "Build". Then from the a terminal run the following commands:
> >  cd Build
> >  cmake ../
> >  make
> >
> thanks, I did not know that
> >
> > Also, on to the actual problem, can you post the actual linker
> > command? Run "make VERBOSE=1" and post the output.
> >
> I did the modifications you suggested, but  it still does not work. For
> the include directory, I had to keep
> these lines :
>
> *--------------------------
>
> > SET(SKINMESH_INCLUDE_DIR
> > ${CMAKE_SOURCE_DIR}/skinmesh
> > )
>
>
> > SET(INCLUDE_DIR
> >         ${INCLUDE_DIR}
> > ${SKINMESH_INCLUDE_DIR}
> >
> > )
>
> > SET(INCLUDE_DIR
> >         ${INCLUDE_DIR}
> > ${SKINMESH_INCLUDE_DIR}
> >
> > )
> *--------------------------
> even though I did made the modification suggested in cmake file  the
> source directory otherwise, it was not working
>
> Here is my  linker command:
>
> Linking CXX executable ../bin/mdi
> cd /Users/program/qtskinmesh/build/mdi && /usr/local/bin/cmake -P
> CMakeFiles/mdi.dir/cmake_clean_target.cmake
> cd /Users/program/qtskinmesh/build/mdi &&
> /opt/intel/cc/10.0.016/bin/icpc     -O3 -mp1 -Kc++ -Dintel
> -headerpad_max_install_names  -bind_at_load "CMakeFiles/mdi.dir/main.o"
> "CMakeFiles/mdi.dir/csbdmainwindow.o" "CMakeFiles/mdi.dir/csbdmdichild.o"
> "CMakeFiles/mdi.dir/moc_csbdmainwindow.o"
> "CMakeFiles/mdi.dir/moc_csbdmdichild.o"
> "CMakeFiles/mdi.dir/qrc_qt4skinmesh.o"   -o ../bin/mdi
> -L/Users/program/qtskinmesh/build/skinmesh
> -L/Users/program/qtskinmesh/build/bin -L/usr/local/lib
> -L/usr/X11R6/lib -L/opt/intel/fc/10.0.016/lib -F/Library/Frameworks
> -framework QtGui -framework Carbon -framework QuickTime -framework QtXml
> -framework QtCore -lz -framework ApplicationServices -framework QtOpenGL
> -lQGLViewer -lgmp -lm -lGL -lGLU -lirc -limf -lifcore -lskinmesh -lgmp -lm
> -lGL -lGLU -lirc -limf -lifcore
> ld: warning multiple definitions of symbol _modf
> /opt/intel/cc/10.0.016/lib/libimf.a(modf_stub.o) definition of _modf in
> section (__TEXT,__text)
> /usr/lib/gcc/i686-apple-darwin8/4.0.1/../../..//libm.dylib(xmm_floor.o)
> definition of _modf
> ld: Undefined symbols:
> _tetra_zone_copy_
> _xyz_vertex_copy_
>
>
> and my Undefined symbols are all part of my newly created library
> skinmesh.  What suprrisses me the most is that all that works on fedora
> core 6....
>
> Thanks again,
> Marie
>
>
>
>
> _______________________________________________
> CMake mailing list
> CMake at cmake.org
> http://www.cmake.org/mailman/listinfo/cmake
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://public.kitware.com/pipermail/cmake/attachments/20070927/13ba4018/attachment.htm


More information about the CMake mailing list