Skip to content

GitLab

  • Menu
Projects Groups Snippets
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • CMake CMake
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 3,818
    • Issues 3,818
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 8
    • Merge requests 8
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Releases
  • Packages & Registries
    • Packages & Registries
    • Container Registry
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • External wiki
    • External wiki
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • CMake
  • CMakeCMake
  • Issues
  • #19764
Closed
Open
Created Sep 28, 2019 by Royi@Royi

Cmake 3.15.3 with GCC Compiler - Linking Libraries with `lib` as Their Postfix in Windows

I'm using CMake 3.15.3 on Windows. I use MinGW Make Generator.

I wrote the following:

link_directories(${CMAKE_SOURCE_DIR}/Lib/)
...SomeCode...
target_link_libraries(MyExeName libSomeLib001.lib libSomeLib002.lib)

Pay attention that those library names starts with lib.

Now, when I tried to build I saw error which says the linker couldn't find -lSomeLib001 and -lSomeLib002.
Namely, something removed the lib from the naming. If I want to the linklibs.rsp of the target I could see the lib is indeed missing. If I manually added lib in linklibs.rsp the build went fine.

So, I guess this behavior makes sense under POSIX system but bot under Windows.

To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information
Assignee
Assign to
Time tracking