Re: [CMake] works when I build using XCode, but not with CMake makefile
Thanks. I checked the link (it is a softlink) and the target of the link exists with a file size of 4.2 Mb. Aaron On Fri, Sep 9, 2016 at 4:36 PM,wrote: > > > - On Sep 7, 2016, at 12:52 PM, Cotton Candy < > cottoncandyco...@gmail.com> wrote: > > Here is the output from otool -L on skedmo-solver that you requested: > > skedmo-solver: > libmysqlclient.18.dylib (compatibility version 18.0.0, current version > 18.0.0) > /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current > version 1197.1.1) > /usr/lib/libz.1.dylib (compatibility version 1.0.0, current version > 1.2.5) > /usr/lib/libc++.1.dylib (compatibility version 1.0.0, current version > 120.0.0) > > on /usr/lib/libmysqlclient.18.dylib I get an error > aaron-schurgers-computer-3:lib schurger$ otool -L libmysqlclient.18.dylib > error: /Applications/Xcode.app/Contents/Developer/Toolchains/ > XcodeDefault.xctoolchain/usr/bin/otool: can't open file: > libmysqlclient.18.dylib (No such file or directory) > > even though the file libmysqlclient.18.dylib is clearly there when I do ls > > Try doing "ls -l" > Perhaps its a softlink to a file which doesn't exist. > > Clint > -- Powered by www.kitware.com Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Kitware offers various services to support the CMake community. For more information on each offering, please visit: CMake Support: http://cmake.org/cmake/help/support.html CMake Consulting: http://cmake.org/cmake/help/consulting.html CMake Training Courses: http://cmake.org/cmake/help/training.html Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Follow this link to subscribe/unsubscribe: http://public.kitware.com/mailman/listinfo/cmake
Re: [CMake] works when I build using XCode, but not with CMake makefile
- On Sep 7, 2016, at 12:52 PM, Cotton Candywrote: > Here is the output from otool -L on skedmo-solver that you requested: > skedmo-solver: > libmysqlclient.18.dylib (compatibility version 18.0.0, current version 18.0.0) > /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version > 1197.1.1) > /usr/lib/libz.1.dylib (compatibility version 1.0.0, current version 1.2.5) > /usr/lib/libc++.1.dylib (compatibility version 1.0.0, current version 120.0.0) > on /usr/lib/libmysqlclient.18.dylib I get an error > aaron-schurgers-computer-3:lib schurger$ otool -L libmysqlclient.18.dylib > error: > /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/otool: > can't open file: libmysqlclient.18.dylib (No such file or directory) > even though the file libmysqlclient.18.dylib is clearly there when I do ls Try doing "ls -l" Perhaps its a softlink to a file which doesn't exist. Clint -- Powered by www.kitware.com Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Kitware offers various services to support the CMake community. For more information on each offering, please visit: CMake Support: http://cmake.org/cmake/help/support.html CMake Consulting: http://cmake.org/cmake/help/consulting.html CMake Training Courses: http://cmake.org/cmake/help/training.html Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Follow this link to subscribe/unsubscribe: http://public.kitware.com/mailman/listinfo/cmake
Re: [CMake] works when I build using XCode, but not with CMake makefile
Here is the output from otool -L on skedmo-solver that you requested: skedmo-solver: libmysqlclient.18.dylib (compatibility version 18.0.0, current version 18.0.0) /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1197.1.1) /usr/lib/libz.1.dylib (compatibility version 1.0.0, current version 1.2.5) /usr/lib/libc++.1.dylib (compatibility version 1.0.0, current version 120.0.0) on /usr/lib/libmysqlclient.18.dylib I get an error aaron-schurgers-computer-3:lib schurger$ otool -L libmysqlclient.18.dylib error: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/otool: can't open file: libmysqlclient.18.dylib (No such file or directory) even though the file libmysqlclient.18.dylib is clearly there when I do ls However, when I try it on /usr/lib/libmysqlclient.dylib it works: aaron-schurgers-computer-3:lib schurger$ otool -L libmysqlclient.dylib libmysqlclient.dylib: libmysqlclient.18.dylib (compatibility version 18.0.0, current version 18.0.0) /usr/lib/libc++.1.dylib (compatibility version 1.0.0, current version 65.1.0) /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 169.3.0) There is no libmysqlclient.18.dylib in /Applications/MAMP/Library/lib. Thanks, Aaron On Wed, Sep 7, 2016 at 2:52 PM,wrote: > It may help to include the output of "otool -L" on skedmo-solver, > /usr/lib/libmysqlclient.18.dylib and /Applications/MAMP/Library/ > lib/libmysqlclient.18.dylib. > And it may also help to see if there is a difference in the otool output > in the Xcode vs makefile scenario. > > Also, it may help to check the output of "otool -l skedmo-solver" for both > the Xcode and makefile scenario. > > Clint > > - On Sep 7, 2016, at 5:18 AM, Cotton Candy > wrote: > > Hi Peter, > I attach my CMakeLists.txt file as well as the FindMySQL.cmake finder that > I used, in case these help. > > I still get the same error when I run the executable: > dyld: Library not loaded: libmysqlclient.18.dylib > Referenced from: /Users/schurger/tmp/test_CMake2/./skedmo-solver > Reason: image not found > Trace/BPT trap: 5 > > This library (libmysqlclient.18.dylib) is in /usr/lib on my machine. > > Thanks for all your help. > Aaron > > On Wed, Sep 7, 2016 at 9:36 AM, Peter Steinbach > wrote: > >> Hi Mr Candy (I am still getting a heck out of cottoncandycoder, sorry :D ) >> >> 1) the way you do it, is not really the way cmake should be used AFAIK. >> > In my CMakeLists.txt file I included: >> > set( CMAKE_CXX_FLAGS "-L/Applications/MAMP/Library/lib -lmysqlclient >> > -lpthread -lz" ) >> > set( CMAKE_EXE_LINKER_FLAGS "-lmysqlclient -lpthread -lm -lz" ) >> >> change this to: >> #I assume you have something like this somewhere >> add_executable(my_exe_name SOURCES my_exe_name.???) >> #here comes the "magic" >> link_directories(/Applications/MAMP/Library/lib) >> target_link_libraries(mysqlclient pthread m z) >> >> In theory, if all those dependencies are available at cmake-invocation, >> this should emit compiler calls that produce your binary and link >> mysqlclient into it (by default with using RPATH, see the docs on this: >> https://cmake.org/cmake/help/v3.0/prop_tgt/MACOSX_RPATH. >> html#prop_tgt:MACOSX_RPATH >> ). Depending on whether you wanna distribute your binary and cannot be >> sure if (at build time) pthreads etc are available, there are cmake find >> modules for pthreads and libz (FindThreads, FindZLIB) which you can use. >> libm should come with the libc of the system AFAIK. >> >> I also just checked but up to cmake 3.5, there is no MYSQL Find module. >> Which is kinda sad as there is a FindPostgreSQL module. :( If there would >> be, you could use it in a (hopefully) platform independent way and not >> bother with finding the right paths to libmysqlclient. >> >> 2) The compiler flags you posted do not explain, why Xcode apparently >> sets the rpath inside the binary and your cmake script doesn't (haven't >> seen the full CMakeLists.txt of your project yet). >> >> I hope the above gets you going. >> >> @cmake developers: it would be nice to have more obvious pointers to >> cmake example projects like an example SDK or so. If there is, please let >> me know. I only found this: >> http://www.vtk.org/Wiki/CMake/Examples#Finding_Packages >> but that's tied to vtk. >> >> Best, >> peter >> >> On 09/06/2016 08:12 PM, Cotton Candy wrote: >> > Peter, >> > In XCode I have this list of "settings" that includes >> > "Other Linker Flags" that I have set to "-lmysqlclient -lpthread -lm >> -lz" >> > and >> > "Other C++ Flags" that I have set to "-L/Applications/MAMP/Library/lib >> > -lmysqlclient -lpthread -lz" >> > >> > Maybe these explain why things work when I build with XCode, but not >> with >> > CMake. >> > >> > >> > but when I run the make it always says it is ignoring these (e.g. >> "warning: >> > argument unused during compilation:
Re: [CMake] works when I build using XCode, but not with CMake makefile
It may help to include the output of "otool -L" on skedmo-solver, /usr/lib/libmysqlclient.18.dylib and /Applications/MAMP/Library/lib/libmysqlclient.18.dylib. And it may also help to see if there is a difference in the otool output in the Xcode vs makefile scenario. Also, it may help to check the output of "otool -l skedmo-solver" for both the Xcode and makefile scenario. Clint - On Sep 7, 2016, at 5:18 AM, Cotton Candywrote: > Hi Peter, > I attach my CMakeLists.txt file as well as the FindMySQL.cmake finder that I > used, in case these help. > I still get the same error when I run the executable: > dyld: Library not loaded: libmysqlclient.18.dylib > Referenced from: /Users/schurger/tmp/test_CMake2/./skedmo-solver > Reason: image not found > Trace/BPT trap: 5 > This library (libmysqlclient.18.dylib) is in /usr/lib on my machine. > Thanks for all your help. > Aaron > On Wed, Sep 7, 2016 at 9:36 AM, Peter Steinbach < steinb...@scionics.de > > wrote: >> Hi Mr Candy (I am still getting a heck out of cottoncandycoder, sorry :D ) >> 1) the way you do it, is not really the way cmake should be used AFAIK. >> > In my CMakeLists.txt file I included: >> > set( CMAKE_CXX_FLAGS "-L/Applications/MAMP/Library/lib -lmysqlclient >> > -lpthread -lz" ) >> > set( CMAKE_EXE_LINKER_FLAGS "-lmysqlclient -lpthread -lm -lz" ) >> change this to: >> #I assume you have something like this somewhere >> add_executable(my_exe_name SOURCES my_exe_name.???) >> #here comes the "magic" >> link_directories(/Applications/MAMP/Library/lib) >> target_link_libraries(mysqlclient pthread m z) >> In theory, if all those dependencies are available at cmake-invocation, this >> should emit compiler calls that produce your binary and link mysqlclient into >> it (by default with using RPATH, see the docs on this: >> https://cmake.org/cmake/help/v3.0/prop_tgt/MACOSX_RPATH.html#prop_tgt:MACOSX_RPATH >> ). Depending on whether you wanna distribute your binary and cannot be sure >> if >> (at build time) pthreads etc are available, there are cmake find modules for >> pthreads and libz (FindThreads, FindZLIB) which you can use. libm should come >> with the libc of the system AFAIK. >> I also just checked but up to cmake 3.5, there is no MYSQL Find module. >> Which is >> kinda sad as there is a FindPostgreSQL module. :( If there would be, you >> could >> use it in a (hopefully) platform independent way and not bother with finding >> the right paths to libmysqlclient. >> 2) The compiler flags you posted do not explain, why Xcode apparently sets >> the >> rpath inside the binary and your cmake script doesn't (haven't seen the full >> CMakeLists.txt of your project yet). >> I hope the above gets you going. >> @cmake developers: it would be nice to have more obvious pointers to cmake >> example projects like an example SDK or so. If there is, please let me know. >> I >> only found this: >> http://www.vtk.org/Wiki/CMake/Examples#Finding_Packages >> but that's tied to vtk. >> Best, >> peter >> On 09/06/2016 08:12 PM, Cotton Candy wrote: >> > Peter, >> > In XCode I have this list of "settings" that includes >> > "Other Linker Flags" that I have set to "-lmysqlclient -lpthread -lm -lz" >> > and >> > "Other C++ Flags" that I have set to "-L/Applications/MAMP/Library/lib >> > -lmysqlclient -lpthread -lz" >> > Maybe these explain why things work when I build with XCode, but not with >> > CMake. >> > but when I run the make it always says it is ignoring these (e.g. "warning: >> > argument unused during compilation: '-L/Applications/MAMP/Library/lib'"). >> > Thanks again for you help. >> > Aaron >> > On Tue, Sep 6, 2016 at 2:20 PM, Peter Steinbach < steinb...@scionics.de > >> > wrote: >> >> Aaron, >> >> it's about the way that you compile your binary and link libmysqlclient >> >> into it. I guess (@all: please correct me if I am wrong) as I don't know >> >> how you use cmake to build your libraries/binaries, that you don't set the >> >> rpath of libmysqlclient inside your binary. Doing so will ensure that the >> >> absolute path of libmysqlclient is stored into your binary, so that the >> >> runtime environment can pick it up and use (keeping fingers crossed that >> >> the path is still valid). The alternative to doing so, is linking against >> >> the static version of libmysqlclient (which comes at a cost on another >> >> front as well). >> >> Best, >> >> P > -- > Powered by www.kitware.com > Please keep messages on-topic and check the CMake FAQ at: > http://www.cmake.org/Wiki/CMake_FAQ > Kitware offers various services to support the CMake community. For more > information on each offering, please visit: > CMake Support: http://cmake.org/cmake/help/support.html > CMake Consulting: http://cmake.org/cmake/help/consulting.html > CMake Training Courses: http://cmake.org/cmake/help/training.html > Visit other Kitware open-source projects at >
Re: [CMake] works when I build using XCode, but not with CMake makefile
Hi Peter, I attach my CMakeLists.txt file as well as the FindMySQL.cmake finder that I used, in case these help. I still get the same error when I run the executable: dyld: Library not loaded: libmysqlclient.18.dylib Referenced from: /Users/schurger/tmp/test_CMake2/./skedmo-solver Reason: image not found Trace/BPT trap: 5 This library (libmysqlclient.18.dylib) is in /usr/lib on my machine. Thanks for all your help. Aaron On Wed, Sep 7, 2016 at 9:36 AM, Peter Steinbachwrote: > Hi Mr Candy (I am still getting a heck out of cottoncandycoder, sorry :D ) > > 1) the way you do it, is not really the way cmake should be used AFAIK. > > In my CMakeLists.txt file I included: > > set( CMAKE_CXX_FLAGS "-L/Applications/MAMP/Library/lib -lmysqlclient > > -lpthread -lz" ) > > set( CMAKE_EXE_LINKER_FLAGS "-lmysqlclient -lpthread -lm -lz" ) > > change this to: > #I assume you have something like this somewhere > add_executable(my_exe_name SOURCES my_exe_name.???) > #here comes the "magic" > link_directories(/Applications/MAMP/Library/lib) > target_link_libraries(mysqlclient pthread m z) > > In theory, if all those dependencies are available at cmake-invocation, > this should emit compiler calls that produce your binary and link > mysqlclient into it (by default with using RPATH, see the docs on this: > https://cmake.org/cmake/help/v3.0/prop_tgt/MACOSX_RPATH. > html#prop_tgt:MACOSX_RPATH > ). Depending on whether you wanna distribute your binary and cannot be > sure if (at build time) pthreads etc are available, there are cmake find > modules for pthreads and libz (FindThreads, FindZLIB) which you can use. > libm should come with the libc of the system AFAIK. > > I also just checked but up to cmake 3.5, there is no MYSQL Find module. > Which is kinda sad as there is a FindPostgreSQL module. :( If there would > be, you could use it in a (hopefully) platform independent way and not > bother with finding the right paths to libmysqlclient. > > 2) The compiler flags you posted do not explain, why Xcode apparently sets > the rpath inside the binary and your cmake script doesn't (haven't seen the > full CMakeLists.txt of your project yet). > > I hope the above gets you going. > > @cmake developers: it would be nice to have more obvious pointers to cmake > example projects like an example SDK or so. If there is, please let me > know. I only found this: > http://www.vtk.org/Wiki/CMake/Examples#Finding_Packages > but that's tied to vtk. > > Best, > peter > > On 09/06/2016 08:12 PM, Cotton Candy wrote: > > Peter, > > In XCode I have this list of "settings" that includes > > "Other Linker Flags" that I have set to "-lmysqlclient -lpthread -lm -lz" > > and > > "Other C++ Flags" that I have set to "-L/Applications/MAMP/Library/lib > > -lmysqlclient -lpthread -lz" > > > > Maybe these explain why things work when I build with XCode, but not with > > CMake. > > > > > > but when I run the make it always says it is ignoring these (e.g. > "warning: > > argument unused during compilation: '-L/Applications/MAMP/Library/ > lib'"). > > > > Thanks again for you help. > > Aaron > > > > > > > > > > > > On Tue, Sep 6, 2016 at 2:20 PM, Peter Steinbach > > wrote: > > > >> Aaron, > >> > >> it's about the way that you compile your binary and link libmysqlclient > >> into it. I guess (@all: please correct me if I am wrong) as I don't know > >> how you use cmake to build your libraries/binaries, that you don't set > the > >> rpath of libmysqlclient inside your binary. Doing so will ensure that > the > >> absolute path of libmysqlclient is stored into your binary, so that the > >> runtime environment can pick it up and use (keeping fingers crossed that > >> the path is still valid). The alternative to doing so, is linking > against > >> the static version of libmysqlclient (which comes at a cost on another > >> front as well). > >> > >> Best, > >> P > >> > > > cmake_minimum_required(VERSION 3.5) project(skedmo_solver_lean) #set(CMAKE_VERBOSE_MAKEFILE ON) set(CMAKE_BUILD_TYPE Debug) set(SOURCE_FILES cgi_input.cpp cgi_input.h main.cpp main.h solver.cpp solver.h stack.cpp stack.h supporting.cpp supporting.h) set(skedmo_INCLUDE_DIRS /usr/local/eigen /usr/local/boost_1_56_0 /usr/local/connector-c/include /usr/local/connector-c/lib /usr/local/lib /usr/local/connector-c) include_directories(${skedmo_INCLUDE_DIRS}) set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "/Users/schurger/Dropbox/Skedmo/skedmo-solver-lean/cmake/") find_package(MySQL) add_executable(skedmo-solver ${SOURCE_FILES}) link_directories(/Applications/MAMP/Library/lib /usr/lib) target_link_libraries(skedmo-solver mysqlclient pthread m z) target_link_libraries(skedmo-solver ${MYSQL_LIBRARY}) FindMySQL.cmake Description: Binary data -- Powered by www.kitware.com Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Kitware
Re: [CMake] works when I build using XCode, but not with CMake makefile
Hi Mr Candy (I am still getting a heck out of cottoncandycoder, sorry :D ) 1) the way you do it, is not really the way cmake should be used AFAIK. > In my CMakeLists.txt file I included: > set( CMAKE_CXX_FLAGS "-L/Applications/MAMP/Library/lib -lmysqlclient > -lpthread -lz" ) > set( CMAKE_EXE_LINKER_FLAGS "-lmysqlclient -lpthread -lm -lz" ) change this to: #I assume you have something like this somewhere add_executable(my_exe_name SOURCES my_exe_name.???) #here comes the "magic" link_directories(/Applications/MAMP/Library/lib) target_link_libraries(mysqlclient pthread m z) In theory, if all those dependencies are available at cmake-invocation, this should emit compiler calls that produce your binary and link mysqlclient into it (by default with using RPATH, see the docs on this: https://cmake.org/cmake/help/v3.0/prop_tgt/MACOSX_RPATH.html#prop_tgt:MACOSX_RPATH ). Depending on whether you wanna distribute your binary and cannot be sure if (at build time) pthreads etc are available, there are cmake find modules for pthreads and libz (FindThreads, FindZLIB) which you can use. libm should come with the libc of the system AFAIK. I also just checked but up to cmake 3.5, there is no MYSQL Find module. Which is kinda sad as there is a FindPostgreSQL module. :( If there would be, you could use it in a (hopefully) platform independent way and not bother with finding the right paths to libmysqlclient. 2) The compiler flags you posted do not explain, why Xcode apparently sets the rpath inside the binary and your cmake script doesn't (haven't seen the full CMakeLists.txt of your project yet). I hope the above gets you going. @cmake developers: it would be nice to have more obvious pointers to cmake example projects like an example SDK or so. If there is, please let me know. I only found this: http://www.vtk.org/Wiki/CMake/Examples#Finding_Packages but that's tied to vtk. Best, peter On 09/06/2016 08:12 PM, Cotton Candy wrote: > Peter, > In XCode I have this list of "settings" that includes > "Other Linker Flags" that I have set to "-lmysqlclient -lpthread -lm -lz" > and > "Other C++ Flags" that I have set to "-L/Applications/MAMP/Library/lib > -lmysqlclient -lpthread -lz" > > Maybe these explain why things work when I build with XCode, but not with > CMake. > > > but when I run the make it always says it is ignoring these (e.g. "warning: > argument unused during compilation: '-L/Applications/MAMP/Library/lib'"). > > Thanks again for you help. > Aaron > > > > > > On Tue, Sep 6, 2016 at 2:20 PM, Peter Steinbach> wrote: > >> Aaron, >> >> it's about the way that you compile your binary and link libmysqlclient >> into it. I guess (@all: please correct me if I am wrong) as I don't know >> how you use cmake to build your libraries/binaries, that you don't set the >> rpath of libmysqlclient inside your binary. Doing so will ensure that the >> absolute path of libmysqlclient is stored into your binary, so that the >> runtime environment can pick it up and use (keeping fingers crossed that >> the path is still valid). The alternative to doing so, is linking against >> the static version of libmysqlclient (which comes at a cost on another >> front as well). >> >> Best, >> P >> > -- Powered by www.kitware.com Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Kitware offers various services to support the CMake community. For more information on each offering, please visit: CMake Support: http://cmake.org/cmake/help/support.html CMake Consulting: http://cmake.org/cmake/help/consulting.html CMake Training Courses: http://cmake.org/cmake/help/training.html Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Follow this link to subscribe/unsubscribe: http://public.kitware.com/mailman/listinfo/cmake
Re: [CMake] works when I build using XCode, but not with CMake makefile
Peter, In XCode I have this list of "settings" that includes "Other Linker Flags" that I have set to "-lmysqlclient -lpthread -lm -lz" and "Other C++ Flags" that I have set to "-L/Applications/MAMP/Library/lib -lmysqlclient -lpthread -lz" Maybe these explain why things work when I build with XCode, but not with CMake. In my CMakeLists.txt file I included: set( CMAKE_CXX_FLAGS "-L/Applications/MAMP/Library/lib -lmysqlclient -lpthread -lz" ) set( CMAKE_EXE_LINKER_FLAGS "-lmysqlclient -lpthread -lm -lz" ) but when I run the make it always says it is ignoring these (e.g. "warning: argument unused during compilation: '-L/Applications/MAMP/Library/lib'"). Thanks again for you help. Aaron On Tue, Sep 6, 2016 at 2:20 PM, Peter Steinbachwrote: > Aaron, > > it's about the way that you compile your binary and link libmysqlclient > into it. I guess (@all: please correct me if I am wrong) as I don't know > how you use cmake to build your libraries/binaries, that you don't set the > rpath of libmysqlclient inside your binary. Doing so will ensure that the > absolute path of libmysqlclient is stored into your binary, so that the > runtime environment can pick it up and use (keeping fingers crossed that > the path is still valid). The alternative to doing so, is linking against > the static version of libmysqlclient (which comes at a cost on another > front as well). > > Best, > P > -- Powered by www.kitware.com Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Kitware offers various services to support the CMake community. For more information on each offering, please visit: CMake Support: http://cmake.org/cmake/help/support.html CMake Consulting: http://cmake.org/cmake/help/consulting.html CMake Training Courses: http://cmake.org/cmake/help/training.html Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Follow this link to subscribe/unsubscribe: http://public.kitware.com/mailman/listinfo/cmake
Re: [CMake] works when I build using XCode, but not with CMake makefile
Aaron, it's about the way that you compile your binary and link libmysqlclient into it. I guess (@all: please correct me if I am wrong) as I don't know how you use cmake to build your libraries/binaries, that you don't set the rpath of libmysqlclient inside your binary. Doing so will ensure that the absolute path of libmysqlclient is stored into your binary, so that the runtime environment can pick it up and use (keeping fingers crossed that the path is still valid). The alternative to doing so, is linking against the static version of libmysqlclient (which comes at a cost on another front as well). Best, P -- Powered by www.kitware.com Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Kitware offers various services to support the CMake community. For more information on each offering, please visit: CMake Support: http://cmake.org/cmake/help/support.html CMake Consulting: http://cmake.org/cmake/help/consulting.html CMake Training Courses: http://cmake.org/cmake/help/training.html Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Follow this link to subscribe/unsubscribe: http://public.kitware.com/mailman/listinfo/cmake
Re: [CMake] works when I build using XCode, but not with CMake makefile
Hi Mr. Cotton ;), is the location of libmysqlclient* available through DYLD_LIBRARY_PATH at runtime of your code? Best, P On 09/06/2016 10:56 AM, Cotton Candy wrote: Hi, I have a project that I originally coded up using XCode. It builds and runs just fine using XCode. Now I have tried to set up the same project using CMake to generate a makefile. The project builds 100% without any errors using 'make', but the resulting code doesn't work. I get error: dyld: Library not loaded: libmysqlclient.18.dylib Referenced from: /Users/schurger/tmp/test_CMake2/./skedmo-solver Reason: image not found Trace/BPT trap: 5 Any idea how it could build OK without any errors if there was a missing library? Thanks! Aaron -- Powered by www.kitware.com Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Kitware offers various services to support the CMake community. For more information on each offering, please visit: CMake Support: http://cmake.org/cmake/help/support.html CMake Consulting: http://cmake.org/cmake/help/consulting.html CMake Training Courses: http://cmake.org/cmake/help/training.html Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Follow this link to subscribe/unsubscribe: http://public.kitware.com/mailman/listinfo/cmake