View Issue Details Jump to Notes ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0015772CMakeCMakepublic2015-10-07 09:102016-03-07 09:12
ReporterGarcia Sylvain 
Assigned To 
PrioritynormalSeverityminorReproducibilityalways
StatusclosedResolutionduplicate 
PlatformPCOSWindows7OS Version
Product VersionCMake 3.3.2 
Target VersionFixed in Version 
Summary0015772: snprintf on msvc14 compiler
DescriptionThe CheckFunctionExits module does not detect the new msvc14's snprintf function.
Steps To ReproduceRun 'cmake -G"Visual Studio 14 2015" .' on the attached CMakeLists.txt
TagsNo tags attached.
Attached Filestxt file icon CMakeLists.txt [^] (353 bytes) 2015-10-07 09:10 [Show Content]

 Relationships
duplicate of 0015659closed Visual Studio 2015: check_function_exists doesn't work for stdio functions 

  Notes
(0039526)
Nils Gladitz (developer)
2015-10-07 09:22

CheckFunctionExists checks if the symbol exists at link time.
I think vs2015 defines snprinf inline and hence does not export any such symbol to be found at link time.

Try using CheckSymbolExists instead.
(0039527)
Garcia Sylvain (reporter)
2015-10-07 09:52

Ty for answer, neverthless CheckSymbolExists does not work.
I have just been able to detect it using CheckSharedFunctionExists:

CHECK_SHARED_FUNCTION_EXISTS(snprintf "stdio.h" kernel32 "" HAVE_SNPRINTF)

with the module CheckSharedFunctionExists from https://github.com/matpow2/openal-soft-chowdren/blob/master/cmake/CheckSharedFunctionExists.cmake [^]
(0039528)
Nils Gladitz (developer)
2015-10-07 10:05

CheckSymbolExists works for me:

--------------------------------------
cmake_minimum_required(VERSION 3.3)
include(CheckSymbolExists)
check_symbol_exists(snprintf stdio.h HAVE_SNPRINTF)
message("[${HAVE_SNPRINTF}]")
message("[${CMAKE_CXX_COMPILER_VERSION}]")
--------------------------------------
...
[1]
[19.0.23026.0]
...
--------------------------------------

Maybe you still had results cached from a previous run?
(0039529)
Garcia Sylvain (reporter)
2015-10-07 10:10

Ok, my bad. It works !
Thank you and sorry for disruption.
(0040604)
Robert Maynard (manager)
2016-03-07 09:12

Closing resolved issues that have not been updated in more than 4 months.

 Issue History
Date Modified Username Field Change
2015-10-07 09:10 Garcia Sylvain New Issue
2015-10-07 09:10 Garcia Sylvain File Added: CMakeLists.txt
2015-10-07 09:22 Nils Gladitz Note Added: 0039526
2015-10-07 09:52 Garcia Sylvain Note Added: 0039527
2015-10-07 10:05 Nils Gladitz Note Added: 0039528
2015-10-07 10:10 Garcia Sylvain Note Added: 0039529
2015-10-07 11:02 Gregor Jasny Relationship added duplicate of 0015659
2015-10-07 11:03 Gregor Jasny Status new => resolved
2015-10-07 11:03 Gregor Jasny Resolution open => duplicate
2015-10-07 11:03 Gregor Jasny Assigned To => Gregor Jasny
2015-10-07 11:03 Gregor Jasny Assigned To Gregor Jasny =>
2016-03-07 09:12 Robert Maynard Note Added: 0040604
2016-03-07 09:12 Robert Maynard Status resolved => closed


Copyright © 2000 - 2018 MantisBT Team