View Issue Details [ Jump to Notes ] | [ Print ] | ||||||||
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. | ||||||||
Attached Files | |||||||||
Relationships | |||||||||||
|
Relationships |
Notes | |
(0039164) Brad King (manager) 2015-07-23 08:41 |
Use CheckSymbolExists instead. That allows one to include a header. |
(0039187) Alex Lamaison (reporter) 2015-07-29 16:01 |
Thanks. That worked :) |
(0040603) Robert Maynard (manager) 2016-03-07 09:12 |
Closing resolved issues that have not been updated in more than 4 months. |
Notes |
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 |
Issue History |
Copyright © 2000 - 2018 MantisBT Team |