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 error with boost 1.81 with boost::filesystem::ofstream deprecation #610

Open
mtasaka opened this issue Mar 9, 2023 · 0 comments · May be fixed by #611
Open

Build error with boost 1.81 with boost::filesystem::ofstream deprecation #610

mtasaka opened this issue Mar 9, 2023 · 0 comments · May be fixed by #611

Comments

@mtasaka
Copy link

mtasaka commented Mar 9, 2023

boost 1.79 deprecated boost/filesystem/string_file.hpp and with boost 1.81 boost::filesystem::ofstream or so is no longer available.

With boost 1.81, compiling luxcorerender 2.6 generates the following errors:

/builddir/build/BUILD/LuxCore-luxcorerender_v2.6/src/luxrays/utils/ocl.cpp:306:44: error: 'ofstream' is not a member of 'boost::filesystem'; did you mean 'std::ofstream'?
  306 |                         boost::filesystem::ofstream file(boost::filesystem::path(fileName),
      |                                            ^~~~~~~~
In file included from /usr/include/c++/13/ios:40,
                 from /usr/include/c++/13/ostream:40,
                 from /usr/include/c++/13/iostream:41,
                 from /builddir/build/BUILD/LuxCore-luxcorerender_v2.6/src/luxrays/utils/ocl.cpp:21:
/usr/include/c++/13/iosfwd:167:41: note: 'std::ofstream' declared here
  167 |   typedef basic_ofstream<char>          ofstream;
      |                                         ^~~~~~~~
/builddir/build/BUILD/LuxCore-luxcorerender_v2.6/src/luxrays/utils/ocl.cpp:313:25: error: 'file' was not declared in this scope
  313 |                         file.write((char *)&hashBin, sizeof(int));
      |                         ^~~~
/builddir/build/BUILD/LuxCore-luxcorerender_v2.6/src/luxrays/utils/ocl.cpp:340:44: error: 'ifstream' is not a member of 'boost::filesystem'; did you mean 'std::ifstream'?
  340 |                         boost::filesystem::ifstream file(boost::filesystem::path(fileName),
      |                                            ^~~~~~~~
/usr/include/c++/13/iosfwd:164:41: note: 'std::ifstream' declared here
  164 |   typedef basic_ifstream<char>          ifstream;
      |                                         ^~~~~~~~
/builddir/build/BUILD/LuxCore-luxcorerender_v2.6/src/luxrays/utils/ocl.cpp:345:25: error: 'file' was not declared in this scope
  345 |                         file.read((char *)&hashBin, sizeof(int));
      |                         ^~~~
make[2]: *** [src/luxrays/CMakeFiles/luxrays.dir/build.make:965: src/luxrays/CMakeFiles/luxrays.dir/utils/ocl.cpp.o] Error 1
/builddir/build/BUILD/LuxCore-luxcorerender_v2.6/src/luxrays/utils/cuda.cpp:177:44: error: 'ofstream' is not a member of 'boost::filesystem'; did you mean 'std::ofstream'?
  177 |                         boost::filesystem::ofstream file(boost::filesystem::path(fileName),
      |                                            ^~~~~~~~
In file included from /usr/include/c++/13/ios:40,
                 from /usr/include/c++/13/ostream:40,
                 from /usr/include/c++/13/iostream:41,
                 from /builddir/build/BUILD/LuxCore-luxcorerender_v2.6/src/luxrays/utils/cuda.cpp:21:
/usr/include/c++/13/iosfwd:167:41: note: 'std::ofstream' declared here
  167 |   typedef basic_ofstream<char>          ofstream;
      |                                         ^~~~~~~~
[ 71%] Generating ../../generated/pyluxcoretools/utils/loghandler.py
cd /builddir/build/BUILD/LuxCore-luxcorerender_v2.6/redhat-linux-build/src/pyluxcoretools && /usr/bin/cmake -E copy /builddir/build/BUILD/LuxCore-luxcorerender_v2.6/src/pyluxcoretools/pyluxcoretools/utils/loghandler.py /builddir/build/BUILD/LuxCore-luxcorerender_v2.6/redhat-linux-build/generated/pyluxcoretools/utils/loghandler.py
/builddir/build/BUILD/LuxCore-luxcorerender_v2.6/src/luxrays/utils/cuda.cpp:184:25: error: 'file' was not declared in this scope
  184 |                         file.write((char *)&hashBin, sizeof(int));
      |                         ^~~~
/builddir/build/BUILD/LuxCore-luxcorerender_v2.6/src/luxrays/utils/cuda.cpp:209:44: error: 'ifstream' is not a member of 'boost::filesystem'; did you mean 'std::ifstream'?
  209 |                         boost::filesystem::ifstream file(boost::filesystem::path(fileName),
      |                                            ^~~~~~~~
/usr/include/c++/13/iosfwd:164:41: note: 'std::ifstream' declared here
  164 |   typedef basic_ifstream<char>          ifstream;
      |                                         ^~~~~~~~
/builddir/build/BUILD/LuxCore-luxcorerender_v2.6/src/luxrays/utils/cuda.cpp:214:25: error: 'file' was not declared in this scope
  214 |                         file.read((char *)&hashBin, sizeof(int));
      |                         ^~~~
mtasaka added a commit to mtasaka/LuxCore that referenced this issue Mar 9, 2023
https://www.boost.org/users/history/version_1_79_0.html

boost 1.79 deprecated boost/filesystem/string_file.hpp and
with boost 1.81 boost::filesystem::ofstream or so is no longer
available.

Replace these with boost::nowide in boost/nowide/fstream.hpp .

Fixes LuxCoreRender#610 .
@mtasaka mtasaka linked a pull request Mar 9, 2023 that will close this issue
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

Successfully merging a pull request may close this issue.

1 participant