However, it gets a bit cumbersome when your application grows to the point where it consists of multiple source files. Linking C executable gen_utility.exeĬMakeFiles\gen_utility.dir/objects.a(main.c.obj): In function `show_stripe_pattern':Ĭ:/Users/User/CLionProjects/gen_utility/main.c:33: undefined reference to `HPDF_Page_SetRGBStroke'Ĭ:/Users/User/CLionProjects/gen_utility/main.c:34: undefined reference to `HPDF_Page_SetLineWidth'Ĭ:/Users/User/CLionProjects/gen_utility/main.c:35: undefined reference to `HPDF_Page_MoveTo'Ĭ:/Users/User/CLionProjects/gen_utility/main.c:36: undefined reference to `HPDF_Page_TextWidth'īut I'm confused because Cmake seems to find the library:Ĭ:\Program Files\JetBrains\CLion 2018.2.3\bin\cmake\win\bin\cmake. Build the application and link the shared library with a Makefile Directly calling GCC from the terminal, to build an application and link a shared library, works fine. "C:\Program Files\JetBrains\CLion 2018.2.3\bin\cmake\win\bin\cmake.exe" -build C:\Users\User\CLionProjects\gen_utility\cmake-build-debug -target all -j 2 On Unix-like platforms, CMake variable CMAKEDLLIBS is populated to link with targetlinklibraries(). Here is my CMakeLists.txt: cmake_minimum_required(VERSION 3.10) link two static libraries to a shared library - Code - CMake Discourse link two static libraries to a shared library Code os:windows NePutin94 (Dmitry) September 22, 2021, 9:19am 1 The structure of my project: -ROOT -CmakeLists.txt -imgui -CmakeLists.txt -core -CmakeLists.txt -imguiglfw -CmakeLists. Comment below or reach us via email at or via Twitter at VisualC. We would love to see what you contribute to our repo and are active on reviews and collaboration. The trouble is that even though Cmake finds my external library, it fails to link it with target_link_libraries. Download the CMake Tools extension for Visual Studio Code and let us know what you think. I have a small C project in Clion I have running fine in Linux that I'm trying to get running in Windows (Msys2)
0 Comments
Leave a Reply. |