MantisBT - CMake |
View Issue Details |
|
ID | Project | Category | View Status | Date Submitted | Last Update |
0015659 | CMake | CMake | public | 2015-07-22 17:34 | 2016-03-07 09:12 |
|
Reporter | Alex Lamaison | |
Assigned To | | |
Priority | normal | Severity | minor | Reproducibility | always |
Status | closed | Resolution | no change required | |
Platform | Windows | OS | | OS Version | |
Product Version | CMake 3.1.3 | |
Target Version | | Fixed in Version | | |
|
Summary | 0015659: Visual Studio 2015: check_function_exists doesn't work for stdio functions |
Description | check_function_exists worked with previous versions of VS and correctly detected the absence of presence of stdio functions like the printf/scanf families, but with VS2015, those functions are always 'not found'
With Visual Studio 2015, those functions are now defined *inline* in stdio.h. This means that CheckFunctionExists.c, which doesn't included stdio.h, can't find any definition of the function to link with. Previously this would have linked with the symbol in the CRT. |
Steps To Reproduce | Add check_function_exists(snprintf) to a project.
Configure with VS2015 generator.
It should say 'Looking for snprintf - found'.
Instead it says 'Looking for snprintf - not found'. |
Additional Information | A workaround is to add legacy_stdio_definitions.lib to CMAKE_REQUIRED_LIBRARIES. However, that is not ideal because it requires knowing that library is available and required in the first place. That defeats the object of feature detection.
More info here: https://msdn.microsoft.com/en-us/library/bb531344.aspx [^] |
Tags | No tags attached. |
Relationships | has duplicate | 0015671 | closed | | cmake does not find _vsnprintf | has duplicate | 0015772 | closed | | snprintf on msvc14 compiler |
|
Attached Files | |
|
Issue History |
Date Modified | Username | Field | Change |
2015-07-22 17:34 | Alex Lamaison | New Issue | |
2015-07-23 08:41 | Brad King | Note Added: 0039164 | |
2015-07-29 16:01 | Alex Lamaison | Note Added: 0039187 | |
2015-07-30 08:47 | Brad King | Status | new => resolved |
2015-07-30 08:47 | Brad King | Resolution | open => no change required |
2015-07-30 08:58 | Brad King | Relationship added | has duplicate 0015671 |
2015-10-07 11:02 | Gregor Jasny | Relationship added | has duplicate 0015772 |
2016-03-07 09:12 | Robert Maynard | Note Added: 0040603 | |
2016-03-07 09:12 | Robert Maynard | Status | resolved => closed |