Artelnics / opennn

OpenNN - Open Neural Networks Library
http://www.opennn.net
GNU Lesser General Public License v3.0
1.12k stars 354 forks source link

error: reference to 'ofstream' is ambiguous #267

Closed yurivict closed 1 year ago

yurivict commented 1 year ago

Build fails:

on_algorithm.cpp
/usr/ports/misc/opennn/work/opennn-6.0.2/opennn/optimization_algorithm.cpp:534:5: error: reference to 'ofstream' is ambiguous
    ofstream file;
    ^
/usr/include/c++/v1/iosfwd:178:38: note: candidate found by name lookup is 'std::ofstream'
typedef basic_ofstream<char>         ofstream;
                                     ^
/usr/ports/misc/opennn/work/opennn-6.0.2/opennn/filesystem.h:1247:30: note: candidate found by name lookup is 'ghc::filesystem::ofstream'
typedef basic_ofstream<char> ofstream;
                             ^
/usr/ports/misc/opennn/work/opennn-6.0.2/opennn/optimization_algorithm.cpp:535:5: error: use of undeclared identifier 'file'; did you mean 'fill'?
    file.open(file_name);
    ^~~~
    fill
/usr/include/c++/v1/__algorithm/fill.h:43:1: note: 'fill' declared here
fill(_ForwardIterator __first, _ForwardIterator __last, const _Tp& __value_)
^
/usr/ports/misc/opennn/work/opennn-6.0.2/opennn/optimization_algorithm.cpp:535:5: error: reference to overloaded function could not be resolved; did you mean to call it?
    file.open(file_name);
    ^~~~
/usr/include/c++/v1/__algorithm/fill.h:43:1: note: possible target for call
fill(_ForwardIterator __first, _ForwardIterator __last, const _Tp& __value_)
^
/usr/ports/misc/opennn/work/opennn-6.0.2/opennn/optimization_algorithm.cpp:537:8: error: use of undeclared identifier 'file'; did you mean 'fill'?
    if(file)
       ^~~~
       fill
/usr/include/c++/v1/__algorithm/fill.h:43:1: note: 'fill' declared here
fill(_ForwardIterator __first, _ForwardIterator __last, const _Tp& __value_)
^
/usr/ports/misc/opennn/work/opennn-6.0.2/opennn/optimization_algorithm.cpp:537:8: error: reference to overloaded function could not be resolved; did you mean to call it?
    if(file)
       ^~~~
/usr/include/c++/v1/__algorithm/fill.h:43:1: note: possible target for call
fill(_ForwardIterator __first, _ForwardIterator __last, const _Tp& __value_)
^
/usr/ports/misc/opennn/work/opennn-6.0.2/opennn/optimization_algorithm.cpp:541:13: error: use of undeclared identifier 'file'; did you mean 'fill'?
            file << final_results(i,0) << "; " << final_results(i,1) << "\n";
            ^~~~
            fill
/usr/include/c++/v1/__algorithm/fill.h:43:1: note: 'fill' declared here
fill(_ForwardIterator __first, _ForwardIterator __last, const _Tp& __value_)
^

Version: 6.0.2 clang-14 FreeBSD 13.1

davidge807 commented 1 year ago

Hi @yurivict

This issue was solved some commits ago in dev branch, will be added to master branch in the following release.

Thanks for your comment and interest in OpenNN!