Re: [CMake] regarding linking functionality and overloading in cmake
Aaron, I think you were right, I moved the definitions to before all the subdirectories and the linking problem disappeared! thanks again for your suggestion Leila From: aaron.mead...@thomsonreuters.com Sent: Thu, 6/23/2011 2:52pm To: Leila Baghdadi ; cmake@cmake.org Subject: RE: [CMake] regarding linking functionality and overloading in cmake Oh, sorry.. I missunderstood about the line 76. =D Ok, looking at your CMakeLists.txt, I see the ADD_SUBDIRECTORY(libctsim). I’m assuming there is a CMakeLists.txt in there which does the ADD_LIBRARY. The ADD_SUBDIRECTORY() calls are before you’re doing a bunch of ADD_DEFINITIONS(). The definitions you are setting up below are not going to apply to those subdirectories. Is it possible that the signature of the function is different in the library than in the opt_ctsim executable because of these definitions? On windows, I would suggest using ‘dumpbin.exe /LinkerMember’ to see the mangled signature of the functions in the library and compare them to the expected signature printed in the linker error for the executable (here’s a description I wrote about it: http://stackoverflow.com/questions/261377/lnk2001-error-when-compiling-apps-referencing-stlport-5-1-4-with-vc-2008/687185#687185 ) I’m not sure what the equivolent process would be for gcc if that is what you are using. Looks like it might be the programs ‘nm’ and ‘objdump’. You might try moving your ADD_SUBDIRECTORY() calls to right above ADD_EXECUTABLE and see if that allows the linking to work correctly. Aaron C. Meadows From: Leila Baghdadi [mailto:baghd...@phenogenomics.ca] Sent: Thursday, June 23, 2011 1:33 PM To: Meadows, Aaron C.; cmake@cmake.org Subject: RE: [CMake] regarding linking functionality and overloading in cmake yep that's how its defined. (note, this is not my code, it is backprojection code free for download at ctsim.org) typedef double kfloat64; typedef kfloat64** const ImageFileArrayConst; the code has diversions between 32 and 64 bit, anyways, that's how it is defined. Leila From: aaron.mead...@thomsonreuters.com Sent: Thu, 6/23/2011 2:09pm To: Leila Baghdadi ; cmake@cmake.org Subject: RE: [CMake] regarding linking functionality and overloading in cmake Unless “ImageFileArrayConst” is a typedef for “double **”, there is not an ImageFile::statistics() function which takes a double** as the first parameter. (Line 288 and 296 have the two versions of ImageFile::statistics()) If you look in views.cpp at the function ImageFileView::OnProperties() function where it is calling the ImageFile::statistics() function, what is the type of the first parameter? Do you have an extra & on the front of a double* variable there? Aaron C. Meadows From: Leila Baghdadi [mailto:baghd...@phenogenomics.ca] Sent: Thursday, June 23, 2011 12:56 PM To: Meadows, Aaron C.; cmake@cmake.org Subject: RE: [CMake] regarding linking functionality and overloading in cmake Hello I have attached the CMakeLists.txt file (note, I commented the source in question line 76) and I get the following error, If I leave line 76 in, I get a clean build Linking CXX executable opt_ctsim CMakeFiles/opt_ctsim.dir/src/views.cpp.o: In function `ImageFileView::OnProperties(wxCommandEvent&)': views.cpp:(.text+0x1bfd9): undefined reference to `ImageFile::statistics(double**, double&, double&, double&, double&, double&, double&) const' views.cpp:(.text+0x1c57a): undefined reference to `ImageFile::statistics(double**, double&, double&, double&, double&, double&, double&) const' collect2: ld returned 1 exit status I am also attaching the source imagefile.cpp located in libctsim subdirectory. thanks From: aaron.mead...@thomsonreuters.com Sent: Thu, 6/23/2011 11:29am To: Leila Baghdadi ; cmake@cmake.org Subject: RE: [CMake] regarding linking functionality and overloading in cmake This sounds like poorly formed c++, not a CMake issue. Can you include your CMakeLists.txt, a copy of the error, and possibly a simple example which shows the problem? Aaron C. Meadows From: cmake-boun...@cmake.org [mailto:cmake-boun...@cmake.org] On Behalf Of Leila Baghdadi Sent: Wednesday, June 22, 2011 3:57 PM To: cmake@cmake.org Subject: [CMake] regarding linking functionality and overloading in cmake hi everyone, I have been trying to use cmake to build ctsim(need to add my own code to it later) and finally managed to do it however I have difficulty understanding why my puny solution works! I have 3 different directories (a,b,c) in ctsim , so I set up cmake files in each one and built liba.so and so on, now I am trying to build the executable cstim by linking to the above three libraries and I kept getting an error, regarding an overloading function in directory a, I thought that using TARGET_LINK_LIBRARIES(target a b c) would address that but instead I had to add the source code with the overloading
[CMake] wx definitions
Hi everyone. I am using Modules/FindwxWidgets.cmake on basis of cmake wiki recommendation to use wx windows, I think I have everything except the definitions MSG("WXWIDGETS_DEFINITIONS=${WXWIDGETS_DEFINITIONS}") prints _FILE_OFFSET_BITS=64_LARGE_FILES__WXGTK__ which does not include spaces and if I place it in definitions for cmake ADD_DEFINITIONS(-D${WXWIDGETS_DEFINITIONS}) I get errors, any thoughts thanks Leila ___ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Follow this link to subscribe/unsubscribe: http://www.cmake.org/mailman/listinfo/cmake
Re: [CMake] regarding linking functionality and overloading in cmake
yes, I think for some reasons it has difficulty linking with the function (correct set of parameters), i.e, it has difficulty figuring out which one of the functions to use, Leila From: aaron.mead...@thomsonreuters.com Sent: Thu, 6/23/2011 3:01pm To: Leila Baghdadi ; cmake@cmake.org Subject: RE: [CMake] regarding linking functionality and overloading in cmake Hope it helps. I’m not completely clear on what you are talking about with the overloading. Are you saying you have the same function defined in multiple static libraries? Aaron C. Meadows From: Leila Baghdadi [mailto:baghd...@phenogenomics.ca] Sent: Thursday, June 23, 2011 1:55 PM To: Meadows, Aaron C.; cmake@cmake.org Subject: RE: [CMake] regarding linking functionality and overloading in cmake Thanks very much aaron for your suggestions, I will do some further investigation and report if I find something, I was just kind of wondering if there was something about libraries and overloading that I was not aware of, Leila From: aaron.mead...@thomsonreuters.com Sent: Thu, 6/23/2011 2:52pm To: Leila Baghdadi ; cmake@cmake.org Subject: RE: [CMake] regarding linking functionality and overloading in cmake Oh, sorry.. I missunderstood about the line 76. =D Ok, looking at your CMakeLists.txt, I see the ADD_SUBDIRECTORY(libctsim). I’m assuming there is a CMakeLists.txt in there which does the ADD_LIBRARY. The ADD_SUBDIRECTORY() calls are before you’re doing a bunch of ADD_DEFINITIONS(). The definitions you are setting up below are not going to apply to those subdirectories. Is it possible that the signature of the function is different in the library than in the opt_ctsim executable because of these definitions? On windows, I would suggest using ‘dumpbin.exe /LinkerMember’ to see the mangled signature of the functions in the library and compare them to the expected signature printed in the linker error for the executable (here’s a description I wrote about it: http://stackoverflow.com/questions/261377/lnk2001-error-when-compiling-apps-referencing-stlport-5-1-4-with-vc-2008/687185#687185 ) I’m not sure what the equivolent process would be for gcc if that is what you are using. Looks like it might be the programs ‘nm’ and ‘objdump’. You might try moving your ADD_SUBDIRECTORY() calls to right above ADD_EXECUTABLE and see if that allows the linking to work correctly. Aaron C. Meadows From: Leila Baghdadi [mailto:baghd...@phenogenomics.ca] Sent: Thursday, June 23, 2011 1:33 PM To: Meadows, Aaron C.; cmake@cmake.org Subject: RE: [CMake] regarding linking functionality and overloading in cmake yep that's how its defined. (note, this is not my code, it is backprojection code free for download at ctsim.org) typedef double kfloat64; typedef kfloat64** const ImageFileArrayConst; the code has diversions between 32 and 64 bit, anyways, that's how it is defined. Leila From: aaron.mead...@thomsonreuters.com Sent: Thu, 6/23/2011 2:09pm To: Leila Baghdadi ; cmake@cmake.org Subject: RE: [CMake] regarding linking functionality and overloading in cmake Unless “ImageFileArrayConst” is a typedef for “double **”, there is not an ImageFile::statistics() function which takes a double** as the first parameter. (Line 288 and 296 have the two versions of ImageFile::statistics()) If you look in views.cpp at the function ImageFileView::OnProperties() function where it is calling the ImageFile::statistics() function, what is the type of the first parameter? Do you have an extra & on the front of a double* variable there? Aaron C. Meadows From: Leila Baghdadi [mailto:baghd...@phenogenomics.ca] Sent: Thursday, June 23, 2011 12:56 PM To: Meadows, Aaron C.; cmake@cmake.org Subject: RE: [CMake] regarding linking functionality and overloading in cmake Hello I have attached the CMakeLists.txt file (note, I commented the source in question line 76) and I get the following error, If I leave line 76 in, I get a clean build Linking CXX executable opt_ctsim CMakeFiles/opt_ctsim.dir/src/views.cpp.o: In function `ImageFileView::OnProperties(wxCommandEvent&)': views.cpp:(.text+0x1bfd9): undefined reference to `ImageFile::statistics(double**, double&, double&, double&, double&, double&, double&) const' views.cpp:(.text+0x1c57a): undefined reference to `ImageFile::statistics(double**, double&, double&, double&, double&, double&, double&) const' collect2: ld returned 1 exit status I am also attaching the source imagefile.cpp located in libctsim subdirectory. thanks From: aaron.mead...@thomsonreuters.com Sent: Thu, 6/23/2011 11:29am To: Leila Baghdadi ; cmake@cmake.org Subject: RE: [CMake] regarding linking functionality and overloading in cmake This sounds like poorly formed c++, not a CMake issue. Can you include your CMakeLists.txt, a copy of the error, and possibly a simple example which shows the problem? Aaron C. Meadows From: cmak
Re: [CMake] regarding linking functionality and overloading in cmake
Thanks very much aaron for your suggestions, I will do some further investigation and report if I find something, I was just kind of wondering if there was something about libraries and overloading that I was not aware of, Leila From: aaron.mead...@thomsonreuters.com Sent: Thu, 6/23/2011 2:52pm To: Leila Baghdadi ; cmake@cmake.org Subject: RE: [CMake] regarding linking functionality and overloading in cmake Oh, sorry.. I missunderstood about the line 76. =D Ok, looking at your CMakeLists.txt, I see the ADD_SUBDIRECTORY(libctsim). I’m assuming there is a CMakeLists.txt in there which does the ADD_LIBRARY. The ADD_SUBDIRECTORY() calls are before you’re doing a bunch of ADD_DEFINITIONS(). The definitions you are setting up below are not going to apply to those subdirectories. Is it possible that the signature of the function is different in the library than in the opt_ctsim executable because of these definitions? On windows, I would suggest using ‘dumpbin.exe /LinkerMember’ to see the mangled signature of the functions in the library and compare them to the expected signature printed in the linker error for the executable (here’s a description I wrote about it: http://stackoverflow.com/questions/261377/lnk2001-error-when-compiling-apps-referencing-stlport-5-1-4-with-vc-2008/687185#687185 ) I’m not sure what the equivolent process would be for gcc if that is what you are using. Looks like it might be the programs ‘nm’ and ‘objdump’. You might try moving your ADD_SUBDIRECTORY() calls to right above ADD_EXECUTABLE and see if that allows the linking to work correctly. Aaron C. Meadows From: Leila Baghdadi [mailto:baghd...@phenogenomics.ca] Sent: Thursday, June 23, 2011 1:33 PM To: Meadows, Aaron C.; cmake@cmake.org Subject: RE: [CMake] regarding linking functionality and overloading in cmake yep that's how its defined. (note, this is not my code, it is backprojection code free for download at ctsim.org) typedef double kfloat64; typedef kfloat64** const ImageFileArrayConst; the code has diversions between 32 and 64 bit, anyways, that's how it is defined. Leila From: aaron.mead...@thomsonreuters.com Sent: Thu, 6/23/2011 2:09pm To: Leila Baghdadi ; cmake@cmake.org Subject: RE: [CMake] regarding linking functionality and overloading in cmake Unless “ImageFileArrayConst” is a typedef for “double **”, there is not an ImageFile::statistics() function which takes a double** as the first parameter. (Line 288 and 296 have the two versions of ImageFile::statistics()) If you look in views.cpp at the function ImageFileView::OnProperties() function where it is calling the ImageFile::statistics() function, what is the type of the first parameter? Do you have an extra & on the front of a double* variable there? Aaron C. Meadows From: Leila Baghdadi [mailto:baghd...@phenogenomics.ca] Sent: Thursday, June 23, 2011 12:56 PM To: Meadows, Aaron C.; cmake@cmake.org Subject: RE: [CMake] regarding linking functionality and overloading in cmake Hello I have attached the CMakeLists.txt file (note, I commented the source in question line 76) and I get the following error, If I leave line 76 in, I get a clean build Linking CXX executable opt_ctsim CMakeFiles/opt_ctsim.dir/src/views.cpp.o: In function `ImageFileView::OnProperties(wxCommandEvent&)': views.cpp:(.text+0x1bfd9): undefined reference to `ImageFile::statistics(double**, double&, double&, double&, double&, double&, double&) const' views.cpp:(.text+0x1c57a): undefined reference to `ImageFile::statistics(double**, double&, double&, double&, double&, double&, double&) const' collect2: ld returned 1 exit status I am also attaching the source imagefile.cpp located in libctsim subdirectory. thanks From: aaron.mead...@thomsonreuters.com Sent: Thu, 6/23/2011 11:29am To: Leila Baghdadi ; cmake@cmake.org Subject: RE: [CMake] regarding linking functionality and overloading in cmake This sounds like poorly formed c++, not a CMake issue. Can you include your CMakeLists.txt, a copy of the error, and possibly a simple example which shows the problem? Aaron C. Meadows From: cmake-boun...@cmake.org [mailto:cmake-boun...@cmake.org] On Behalf Of Leila Baghdadi Sent: Wednesday, June 22, 2011 3:57 PM To: cmake@cmake.org Subject: [CMake] regarding linking functionality and overloading in cmake hi everyone, I have been trying to use cmake to build ctsim(need to add my own code to it later) and finally managed to do it however I have difficulty understanding why my puny solution works! I have 3 different directories (a,b,c) in ctsim , so I set up cmake files in each one and built liba.so and so on, now I am trying to build the executable cstim by linking to the above three libraries and I kept getting an error, regarding an overloading function in directory a, I thought that using TARGET_LINK_LIBRARIES(target a b c) would address
Re: [CMake] regarding linking functionality and overloading in cmake
yep that's how its defined. (note, this is not my code, it is backprojection code free for download at ctsim.org) typedef double kfloat64; typedef kfloat64** const ImageFileArrayConst; the code has diversions between 32 and 64 bit, anyways, that's how it is defined. Leila From: aaron.mead...@thomsonreuters.com Sent: Thu, 6/23/2011 2:09pm To: Leila Baghdadi ; cmake@cmake.org Subject: RE: [CMake] regarding linking functionality and overloading in cmake Unless “ImageFileArrayConst” is a typedef for “double **”, there is not an ImageFile::statistics() function which takes a double** as the first parameter. (Line 288 and 296 have the two versions of ImageFile::statistics()) If you look in views.cpp at the function ImageFileView::OnProperties() function where it is calling the ImageFile::statistics() function, what is the type of the first parameter? Do you have an extra & on the front of a double* variable there? Aaron C. Meadows From: Leila Baghdadi [mailto:baghd...@phenogenomics.ca] Sent: Thursday, June 23, 2011 12:56 PM To: Meadows, Aaron C.; cmake@cmake.org Subject: RE: [CMake] regarding linking functionality and overloading in cmake Hello I have attached the CMakeLists.txt file (note, I commented the source in question line 76) and I get the following error, If I leave line 76 in, I get a clean build Linking CXX executable opt_ctsim CMakeFiles/opt_ctsim.dir/src/views.cpp.o: In function `ImageFileView::OnProperties(wxCommandEvent&)': views.cpp:(.text+0x1bfd9): undefined reference to `ImageFile::statistics(double**, double&, double&, double&, double&, double&, double&) const' views.cpp:(.text+0x1c57a): undefined reference to `ImageFile::statistics(double**, double&, double&, double&, double&, double&, double&) const' collect2: ld returned 1 exit status I am also attaching the source imagefile.cpp located in libctsim subdirectory. thanks From: aaron.mead...@thomsonreuters.com Sent: Thu, 6/23/2011 11:29am To: Leila Baghdadi ; cmake@cmake.org Subject: RE: [CMake] regarding linking functionality and overloading in cmake This sounds like poorly formed c++, not a CMake issue. Can you include your CMakeLists.txt, a copy of the error, and possibly a simple example which shows the problem? Aaron C. Meadows From: cmake-boun...@cmake.org [mailto:cmake-boun...@cmake.org] On Behalf Of Leila Baghdadi Sent: Wednesday, June 22, 2011 3:57 PM To: cmake@cmake.org Subject: [CMake] regarding linking functionality and overloading in cmake hi everyone, I have been trying to use cmake to build ctsim(need to add my own code to it later) and finally managed to do it however I have difficulty understanding why my puny solution works! I have 3 different directories (a,b,c) in ctsim , so I set up cmake files in each one and built liba.so and so on, now I am trying to build the executable cstim by linking to the above three libraries and I kept getting an error, regarding an overloading function in directory a, I thought that using TARGET_LINK_LIBRARIES(target a b c) would address that but instead I had to add the source code with the overloading function from directory a into the list of source codes for the ctsim executable, does that make sense? any thought thanks Leila ___ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Follow this link to subscribe/unsubscribe: http://www.cmake.org/mailman/listinfo/cmake
[CMake] regarding linking functionality and overloading in cmake
hi everyone, I have been trying to use cmake to build ctsim(need to add my own code to it later) and finally managed to do it however I have difficulty understanding why my puny solution works! I have 3 different directories (a,b,c) in ctsim , so I set up cmake files in each one and built liba.so and so on, now I am trying to build the executable cstim by linking to the above three libraries and I kept getting an error, regarding an overloading function in directory a, I thought that using TARGET_LINK_LIBRARIES(target a b c) would address that but instead I had to add the source code with the overloading function from directory a into the list of source codes for the ctsim executable, does that make sense? any thought thanks Leila ___ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Follow this link to subscribe/unsubscribe: http://www.cmake.org/mailman/listinfo/cmake
[CMake] include header files from external library
Hi guys, I am wondering if someone can give me a quick hint here. I am trying to link an external library (openmesh.org) to itk so I can use their mesh subdivision algorithm on my meshes. I have downloaded and built openmesh successfully and I have tried to create the correct cmake files. however, I seem to be having difficulty with header files. The header files are all scattered in various directories within openmesh. I have managed to get cmake to locate the main header MeshIO.h However all the other include files in MeshIo.h are included with full directory structure i.e, include "OpenMesh/balh/balh/something.h" how do I tell cmake to place the root openmesh directory before the above. I hope I am not making this too complicated. thanks for your time Leila ___ CMake mailing list CMake@cmake.org http://www.cmake.org/mailman/listinfo/cmake