[Cmake] Adding executables that use dlls

Asad Abu-Tarif tarifa at rpi.edu
Wed Dec 12 11:16:24 EST 2001


Thank you very much.
You've been of a great help.
Asad

----- Original Message -----
From: "Miller, James V (CRD)" <millerjv at crd.ge.com>
To: "'Asad A. Abu-Tarif'" <tarifa at rpi.edu>; "CMake mailing list"
<cmake at public.kitware.com>
Sent: Wednesday, December 12, 2001 10:31 AM
Subject: RE: [Cmake] Adding executables that use dlls


> In our UseITK.cmake file we have lines like...
>
> IF (UNIX)
>   LINK_LIBRARIES(${THREAD_LIBS} ${DL_LIBS} -lm)
> ENDIF (UNIX)
>
> Don't know if this helps. Attached are our toplevel CMakeLists.txt file as
well as
> itkCMakeOptions.cmake and UseITK.cmake in case these help.
>
>
> -----Original Message-----
> From: Asad A. Abu-Tarif [mailto:tarifa at rpi.edu]
> Sent: Wednesday, December 12, 2001 9:57 AM
> To: CMake mailing list
> Subject: Re: [Cmake] Adding executables that use dlls
>
>
> Thanks a million.
> What flags do you use for the function 'max' ? (The CMAKE_THREAD_LIBS and
> CMAKE_DL_LIBS solve all the thread and lperror ...etc but the reference to
> the
> max function which is part of the math library).
> Do use have a flag for that in CMake?
>
> Thanks again,
> Asad
>
> ----- Original Message -----
> From: "Miller, James V (CRD)" <millerjv at crd.ge.com>
> To: "'Asad A. Abu-Tarif'" <tarifa at rpi.edu>; "CMake mailing list"
> <cmake at public.kitware.com>
> Sent: Wednesday, December 12, 2001 9:27 AM
> Subject: RE: [Cmake] Adding executables that use dlls
>
>
> > We usually have a section of our CMakeLists.txt file for Unix builds
that
> sets the threads and dl
> > libraries.
> >
> > # set link libraries for project
> > IF(UNIX)
> >   LINK_LIBRARIES(${CMAKE_THREAD_LIBS} ${CMAKE_DL_LIBS})
> > ENDIF(UNIX)
> >
> > -----Original Message-----
> > From: Asad A. Abu-Tarif [mailto:tarifa at rpi.edu]
> > Sent: Wednesday, December 12, 2001 9:04 AM
> > To: CMake mailing list
> > Subject: Re: [Cmake] Adding executables that use dlls
> >
> >
> > Thanks.
> > I tried that it works fine with VC++ and windows NT
> > and the exe files are generated. However, on linux
> > I get the following errors as soon as it tries to link
> > the object files to create the very first executable it finds:
> > ===============errors===================================
> > /usr/vtk3.2/Debug/lib/libVTKCommon.so: undefined reference to `dlerror'
> > /usr/vtk3.2/Debug/lib/libVTKCommon.so: undefined reference to
> > `pthread_create'
> > /usr/vtk3.2/Debug/lib/libVTKCommon.so: undefined reference to `dlclose'
> > /usr/vtk3.2/Debug/lib/libVTKCommon.so: undefined reference to `dlopen'
> > /usr/asad/RegMagicTKBin/Numerics/libRegMagicTKNumerics.so: undefined
> > reference to `max'
> > /usr/vtk3.2/Debug/lib/libVTKCommon.so: undefined reference to `dlsym'
> > /usr/vtk3.2/Debug/lib/libVTKCommon.so: undefined reference to
> `pthread_join'
> > ===============end of errors===================================
> >
> > Any help would be greatly appreciated. The CMakeLists.txt file I used
> > is below.
> >
> > Regards,
> > Asad
> >
> > =============CMakeLists.txt=====================================
> > PROJECT (NumericsTesting)
> > LINK_LIBRARIES(RegMagicTKNumerics VTKCommon )
> > ADD_EXECUTABLE(ExecTestingPowellCompilation
> ExecTestingPowellCompilation.cpp
> > TestingPowellCompilation.cpp )
> > ADD_EXECUTABLE(ExecTestingBracketCompilation
> > ExecTestingBracketCompilation.cpp TestingregBracketCompilation.cpp )
> > ADD_EXECUTABLE(ExecMatrixGeneration ExecMatrixGeneration.cpp )
> > =============CMakeLists.txt=====================================
> >
> >
> >       __________________________________________________
> >      /                        Asad A. Abu-Tarif
> > \
> >      |   Computer Engineering.
> > |
> >      |   PhD Candidate, Rensselaer Polytechnic Institute (RPI).       |
> >      |   tarifa at rpi.ed
> > |
> >      \___________________________________________________/
> >
> > ----- Original Message -----
> > From: "William A. Hoffman" <bill.hoffman at kitware.com>
> > To: "Asad A. Abu-Tarif" <tarifa at rpi.edu>; "CMake mailing list"
> > <cmake at public.kitware.com>
> > Sent: Wednesday, December 12, 2001 8:26 AM
> > Subject: Re: [Cmake] Adding executables that use dlls
> >
> >
> > > Use either the LINK_LIBRARIES command or the TARGET_LINK_LIBRARIES
> > command.
> > > For an example with VTK, see
Examples/Tutorial/Step1/Cxx/CMakeLists.txt.
> > >
> > > -Bill
> > >
> > > At 08:00 AM 12/12/2001 -0500, Asad A. Abu-Tarif wrote:
> > > >Hi,
> > > >I'm trying to use CMake to build a package that I wrote.
> > > >I can generate the libraries fine. However, as soon as I
> > > >start adding executables, I start getting errors like: undefined
> > > >symbol.
> > > >
> > > >For example, here is one executable I'm trying to add:
> > > >
> > > >ADD_EXECUTABLE(ExecTestingPowellCompilation
> > ExecTestingPowellCompilation.cpp
> > > >TestingPowellCompilation.cpp )
> > > >
> > > >However, I should also link VTKCommon with those files because
> > > >they use it. How do I do that?
> > > >
> > > >Thanks a lot,
> > > >Asad
> > > >
> > > >_______________________________________________
> > > >Cmake mailing list
> > > >Cmake at public.kitware.com
> > > >http://public.kitware.com/mailman/listinfo/cmake
> > >
> >
> > _______________________________________________
> > Cmake mailing list
> > Cmake at public.kitware.com
> > http://public.kitware.com/mailman/listinfo/cmake
> >
>
> _______________________________________________
> Cmake mailing list
> Cmake at public.kitware.com
> http://public.kitware.com/mailman/listinfo/cmake
>
>
>




More information about the CMake mailing list