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

Build failed: 'numeric_limits' is not a member of 'std' #690

Open
Catty2014 opened this issue Aug 6, 2022 · 2 comments
Open

Build failed: 'numeric_limits' is not a member of 'std' #690

Catty2014 opened this issue Aug 6, 2022 · 2 comments

Comments

@Catty2014
Copy link

platform: Arch Linux
gcc version 12.1.1 20220730 (GCC) 

When buildling package, gcc throws error:

In file included from src/cluster/bsas.cpp:10:
./include/pyclustering/cluster/bsas.hpp:92:44: error: 'numeric_limits' is not a member of 'std'
   92 |         double        m_distance    = std::numeric_limits<double>::max();   /**< Distance between the cluster and a specific point. */
      |                                            ^~~~~~~~~~~~~~
./include/pyclustering/cluster/bsas.hpp:92:59: error: expected primary-expression before 'double'
   92 |         double        m_distance    = std::numeric_limits<double>::max();   /**< Distance between the cluster and a specific point. */
      |                                                           ^~~~~~
make[1]: *** [ccore.mk:154: obj/ccore/64-bit/cluster/bsas.o] Error 1
make[1]: *** Waiting for unfinished jobs....
In file included from ./include/pyclustering/cluster/mbsas.hpp:12,
                 from src/cluster/mbsas.cpp:10:
./include/pyclustering/cluster/bsas.hpp:92:44: error: 'numeric_limits' is not a member of 'std'
   92 |         double        m_distance    = std::numeric_limits<double>::max();   /**< Distance between the cluster and a specific point. */
      |                                            ^~~~~~~~~~~~~~
./include/pyclustering/cluster/bsas.hpp:92:59: error: expected primary-expression before 'double'
   92 |         double        m_distance    = std::numeric_limits<double>::max();   /**< Distance between the cluster and a specific point. */
      |                                                           ^~~~~~
make[1]: *** [ccore.mk:154: obj/ccore/64-bit/cluster/mbsas.o] Error 1
src/cluster/agglomerative.cpp: In member function 'void pyclustering::clst::agglomerative::merge_by_average_link()':
src/cluster/agglomerative.cpp:89:44: error: 'numeric_limits' is not a member of 'std'
   89 |     double minimum_average_distance = std::numeric_limits<double>::max();
      |                                            ^~~~~~~~~~~~~~
src/cluster/agglomerative.cpp:89:59: error: expected primary-expression before 'double'
   89 |     double minimum_average_distance = std::numeric_limits<double>::max();
      |                                                           ^~~~~~
src/cluster/agglomerative.cpp: In member function 'void pyclustering::clst::agglomerative::merge_by_centroid_link()':
src/cluster/agglomerative.cpp:123:44: error: 'numeric_limits' is not a member of 'std'
  123 |     double minimum_average_distance = std::numeric_limits<double>::max();
      |                                            ^~~~~~~~~~~~~~
src/cluster/agglomerative.cpp:123:59: error: expected primary-expression before 'double'
  123 |     double minimum_average_distance = std::numeric_limits<double>::max();
      |                                                           ^~~~~~
src/cluster/agglomerative.cpp: In member function 'void pyclustering::clst::agglomerative::merge_by_complete_link()':
src/cluster/agglomerative.cpp:149:45: error: 'numeric_limits' is not a member of 'std'
  149 |     double minimum_complete_distance = std::numeric_limits<double>::max();
      |                                             ^~~~~~~~~~~~~~
src/cluster/agglomerative.cpp:149:60: error: expected primary-expression before 'double'
  149 |     double minimum_complete_distance = std::numeric_limits<double>::max();
      |                                                            ^~~~~~
src/cluster/agglomerative.cpp: In member function 'void pyclustering::clst::agglomerative::merge_by_signle_link()':
src/cluster/agglomerative.cpp:184:43: error: 'numeric_limits' is not a member of 'std'
  184 |     double minimum_single_distance = std::numeric_limits<double>::max();
      |                                           ^~~~~~~~~~~~~~
src/cluster/agglomerative.cpp:184:58: error: expected primary-expression before 'double'
  184 |     double minimum_single_distance = std::numeric_limits<double>::max();
      |                                                          ^~~~~~
src/cluster/agglomerative.cpp:193:54: error: 'numeric_limits' is not a member of 'std'
  193 |             double candidate_minimum_distance = std::numeric_limits<double>::max();
      |                                                      ^~~~~~~~~~~~~~
src/cluster/agglomerative.cpp:193:69: error: expected primary-expression before 'double'
  193 |             double candidate_minimum_distance = std::numeric_limits<double>::max();
      |                                                                     ^~~~~~
make[1]: *** [ccore.mk:154: obj/ccore/64-bit/cluster/agglomerative.o] Error 1
make[1]: Leaving directory '/tmp/makepkg/python-pyclustering-git/src/pyclustering/ccore'
make: *** [makefile:53: ccore_64bit] Error 2
@etasnadi
Copy link

Add #include <limits> for the corresponding sources.

Or switch to gcc-9.

gl-yziquel added a commit to gl-yziquel/pyclustering that referenced this issue Jan 8, 2024
@gl-yziquel
Copy link

Proposed a PR for this: #699

"This works on my computer".

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

3 participants