Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

flann-1.8.4 Build on Windows VS2022 - Fails with platform toolset v143 - works with platform toolset v142 #518

Open
scudelari opened this issue Jul 16, 2024 · 1 comment

Comments

@scudelari
Copy link

Hello All,

I am having the following issue with building FLANN from source on windows.
1- I get the code and use CMAKE to generate the VSSolution. Note that I am disabling python, c and matlab bindings.
2- I am using Visual Studio 2022 - Platform toolset v143 C++ ISO 14.

I get the following compile error on the heap.h file:
heap.h(108,50): error C2143: syntax error: missing ',' before '<'
This is the faulting snippet:
struct CompareT : public std::binary_function<T,T,bool> { bool operator()(const T& t_1, const T& t_2) const { return t_2 < t_1; } };

NOW, if I change the platform toolset to v142, it works.

I strongly think this is a bug. I am not the best C++ programmer out there and I do not know the nuances on why the same code fails when using v143 instead of v142.

What can I do to fix the code in heap.h so that it will build in v143?

Thank you!

@scudelari
Copy link
Author

I actually found what seems to be a solution to the problem. I included the header "functional" to the heap.h file and it builds on v143.

#ifndef FLANN_HEAP_H_
#define FLANN_HEAP_H_

#include <algorithm>
#include <vector>
#include <functional>

namespace flann
{

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant