Skip to content

building fails on windows with mingw-w64 #1679

@agriggio

Description

@agriggio

Hi,
Building on windows with mingw-w64 (using g++ version 10.2) currently fails because the function _strtof_l (used in src/utils/NumberUtils.h) is missing. Here is a possible patch to fix the issue.

--- a/src/utils/NumberUtils.h	2022-06-05 20:59:43.000000000 +0200
+++ b/src/utils/NumberUtils.h	2022-08-23 16:36:11.549309921 +0200
@@ -99,7 +99,12 @@
 
     float
 #ifdef _WIN32
+# ifdef __MINGW32__
+    // mingw doesn't have _strtof_l
+    tempval = static_cast<float>(_strtod_l(first, &endptr, loc.local));
+# else
     tempval = _strtof_l(first, &endptr, loc.local);
+# endif
 #elif __APPLE__
     // On OSX, strtod_l is for some reason drastically faster than strtof_l.
     tempval = static_cast<float>(::strtod_l(first, &endptr, loc.local));

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions