Ubuntu on Windows 10
PiSaucer opened this issue · comments
I try to compile and get this error:
make -j
make -C scripts json2bson
g++ -O3 -c -std=c++17 -Wall -I../src/include json2bson.cpp -o json2bson.default.o
json2bson.cpp:1:10: fatal error: boost/filesystem.hpp: No such file or directory
#include <boost/filesystem.hpp>
^~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
Makefile:23: recipe for target 'json2bson.default.o' failed
make[2]: *** [json2bson.default.o] Error 1
Makefile:55: recipe for target 'src/colors.bson' failed
make[1]: *** [src/colors.bson] Error 2
Makefile:50: recipe for target 'all' failed
make: *** [all] Error 2
Is there a compiled version or did I miss a step? I updated windows, ubuntu, and gcc. Can someone please help me?
Did you modify the code ? The error refers to a line that does not exist in the project, as mcmap
does not use boost. Try:
git reset --hard
make realClean && make -j
Please also include the output of uname -a
and g++ --version
. If you did modify the code because of a filesystem header error, please try the latest commit, as it fixed a bug that may cause this.
uname - a
Linux DESK 4.4.0-19041-Microsoft #488-Microsoft Mon Sep 01 13:43:00 PST 2020 x86_64 x86_64 x86_64 GNU/Linux
g++ --version
g++ (Ubuntu 7.5.0-3ubuntu1~18.04) 7.5.0
Copyright (C) 2017 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
when I did
git reset --hard
make realClean && make -j
this happens
make realClean && make -j
find src -name *o -exec rm {} \;
make -C scripts clean
make[1]: Entering directory '/mnt/c/Users/pisaucer/mcmap/mcmap/scripts'
find . -name '*o' -exec rm -fr {} \;
make[1]: Leaving directory '/mnt/c/Users/pisaucer/mcmap/mcmap/scripts'
rm -fr mcmap output.png src/colors.bson
make -C scripts realClean
make[1]: Entering directory '/mnt/c/Users/pisaucer/mcmap/mcmap/scripts'
find . -name '*o' -exec rm -fr {} \;
git clean -fdx
make[1]: Leaving directory '/mnt/c/Users/pisaucer/mcmap/mcmap/scripts'
make -C scripts json2bson
g++ -O3 -c -std=c++17 -Wall -I../src/include json2bson.cpp -o json2bson.default.o
g++ -O3 -c -std=c++17 -Wall -I../src/include ../src/include/fmt/format.cpp -o ../src/include/fmt/format.default.o
json2bson.cpp:1:10: fatal error: filesystem: No such file or directory
#include <filesystem>
^~~~~~~~~~~~
compilation terminated.
Makefile:23: recipe for target 'json2bson.default.o' failed
make[2]: *** [json2bson.default.o] Error 1
make[2]: *** Waiting for unfinished jobs....
Makefile:55: recipe for target 'src/colors.bson' failed
make[1]: *** [src/colors.bson] Error 2
Makefile:50: recipe for target 'all' failed
make: *** [all] Error [2]([url](url))
I haven't modified any of the code. I was just to make it complied first before doing so.
Okay the issue is your g++
version. Unfortunately I used recent compilers and did not realize how much it would break for older ones. Try installing the g++-8
, g++-9
or g++-10
package.
Once installed, please check the version of the default g++
by running g++ --version
. If the major version number is inferior to 8, specify the g++
to use when making using CXX=g++-<version>
.
For example, if you installed g++-8
, run:
make realClean
CXX=g++-8 make -j
You must see the same g++
being used in the compile commands:
jb@DESKTOP:~/mcmap$ CXX=g++-8 make -j
make -C scripts json2bson
g++-8 -O3 -c -std=c++17 -Wall -I../src/include json2bson.cpp -o json2bson.default.o
^^^^^
thank you, I didn't realize I had to type out g++-8.
As a general rule, you should not; but as your default g++
is not compatible, you have to force the one to use by writing it out. Hope you like it !