Thanks for your reply Mr Scott, but my project worked well on Linux and i am sure the path is right. This question has been asked long before, as below: On Sat, Jul 24, 2010 at 11:00 PM, John Drescher <drescherjm at gmail.com> wrote: >>> I know that target_link_libraries can be used to link a .lib , >>> >>> but how to link a .dll into the project? >>> >>> >> You do not link against a .dll in windows ever. >> > When you create a .dll there is also a small import lib associated > with the dll. You link with that and when the application starts it > searches the path for each dll it needs. > > John
And the error was not dll lib was not found but .lib(static lib) was not found. As i knew so far, i think this error is related to windows platform. Scott Aron Bloom-2 wrote > When I am building DLLs I tend to use an "install step" as part of my > cmake process. Then I make sure the builds' install area is in the path > of the application. > > The issue may be your EXE cant find the DLL in its path. > > Scott > > -----Original Message----- > From: CMake [mailto: > cmake-bounces@ > ] On Behalf Of Chaos Zhang > Sent: Sunday, April 24, 2016 8:14 PM > To: > cmake@ > Subject: [CMake] Need a example to use dll in vs > > Hi all, > > I faced a problem when i migrate a project from Linux to windows for the > visual stdio seem can not use dll directly. I look through a number of > material and known i seem should use IMPORTED in add_library(...), but i > can not find a practical example about how to use it. Could you please > give me one or some? BTW the dll lib seem could be used in Mingw makefile > on windows. > > Thanks, > Chao Zhang > > > > -- > View this message in context: > http://cmake.3232098.n2.nabble.com/Need-a-example-to-use-dll-in-vs-tp7593331.html > Sent from the CMake mailing list archive at Nabble.com. > -- > > 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 > -- > > 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 -- View this message in context: http://cmake.3232098.n2.nabble.com/Need-a-example-to-use-dll-in-vs-tp7593331p7593333.html Sent from the CMake mailing list archive at Nabble.com. -- 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