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,801
    • Issues 3,801
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 15
    • Merge requests 15
  • 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
  • #23068

Closed
Open
Created Jan 02, 2022 by Jean-Michaël Celerier@jcelerierContributor

find_library(stdc++fs) does not seem to work

I have the following:

 find /usr -name '*stdc*'
/usr/lib/gcc/x86_64-redhat-linux/10/32/libstdc++.a
/usr/lib/gcc/x86_64-redhat-linux/10/32/libstdc++.so
/usr/lib/gcc/x86_64-redhat-linux/10/32/libstdc++fs.a
/usr/lib/gcc/x86_64-redhat-linux/10/libstdc++fs.a
/usr/lib/gcc/x86_64-redhat-linux/10/libstdc++.so
/usr/lib64/libstdc++.so.6
/usr/lib64/libstdc++.so.6.0.28

Yet:

find_library(STDCPPFS_LIBRARY NAMES stdc++fs)

tells me "not found". What can I do ? I cannot hardcode paths as I want that code to work on any Linux distro. I cannot just do a blanket add of target_link_libraries(stdc++fs) because more recent distros / toolchains / ... don't have it, which causes link errors.

Edited Jan 02, 2022 by Jean-Michaël Celerier
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information
Assignee
Assign to
Time tracking