question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Backslash convertion in cmake link flags

See original GitHub issue

As reported in https://github.com/conan-io/conan/issues/813 by @SSE4

With the glew package:

19>LINK : fatal error LNK1104: cannot open file '\NODEFAULTLIB:LIBCMTD \NODEFAULTLIB:LIBCMT.obj'

digging down suggests that it’s most likely from glew package which defines:

                if self.settings.compiler.runtime != "MT":
                    self.cpp_info.exelinkflags.append('/NODEFAULTLIB:LIBCMTD')
                    self.cpp_info.exelinkflags.append('/NODEFAULTLIB:LIBCMT')

and somehow slash got converted into backslash somewhere. inspecting conanbuildinfo.cmake I can see just the following:

set(CONAN_EXE_LINKER_FLAGS_GLEW "/NODEFAULTLIB:LIBCMTD /NODEFAULTLIB:LIBCMT")

if anyone will encounter the same issue - I’ve applied workaround to the glew receipt to use dash rather slash, so it is:

               if self.settings.compiler.runtime != "MT":
                    self.cpp_info.exelinkflags.append('-NODEFAULTLIB:LIBCMTD')
                    self.cpp_info.exelinkflags.append('-NODEFAULTLIB:LIBCMT')

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:6 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
SSE4commented, Feb 7, 2017

@memsharded hi, yeah, I have changes besides -DNODEFAULTLIB. lemme check with conan 0.19.1 and original glew repo, I will reply afterwards.

0reactions
memshardedcommented, Feb 28, 2017

Ok, great, thanks for telling. Then I am labeling as fixed and closing the issue, please re-open if this happens again.

Read more comments on GitHub >

github_iconTop Results From Across the Web

CMake 3.20.0 cannot handle backslashes in CFLAGS
Code in CMake should be converting externally-retrieved paths into forward slashes before processing them further. Please git bisect to find the ...
Read more >
cmake-generator-expressions(7)
For example, slashes are converted to backslashes in Windows shells and drive letters ... This expression may be used to specify compile options,...
Read more >
cmake_path — CMake 3.25.1 Documentation
Converts a cmake-style <input> path into a native path with platform-specific slashes ( \ on Windows hosts and / elsewhere). The input can...
Read more >
[cmake-developers] generator expression for path slash ...
[cmake-developers] generator expression for path slash conversion · Previous message: [cmake-developers] Add command line options for deprecation message control ...
Read more >
[cmake-developers] generator expression for path slash ...
I would suggest that I add another output flag to > cmOutputConverter like SHELL_NO_ESCAPE then. If this flag is passed to > ConvertToOutputFormat()...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found