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

Compile on Ubuntu 20.04 LTS (g++ 9.4) error #453

Open
sg opened this issue Jan 26, 2024 · 2 comments
Open

Compile on Ubuntu 20.04 LTS (g++ 9.4) error #453

sg opened this issue Jan 26, 2024 · 2 comments

Comments

@sg
Copy link

sg commented Jan 26, 2024

When compiling be20_api it appears to be setting '-std=' twice on the command line; the first specifying c++17 and the second specifying c++11:

depbase=`echo be20_api/abstract_image_reader.o | sed 's|[^/]*$|.deps/&|;s|\.o$||'`;\
g++ -std=c++17 -DHAVE_CONFIG_H -I. -I..  -pthread -std=c++11  -I../src/be20_api -I../src/be20_api/utfcpp/source -DUTC_OFFSET=+0000 -I/usr/local/include   -MD -O2 -O3 -Wall -Wcast-align -Wdisabled-optimization -Weffc++ -Wfloat-equal -Wmissing-noreturn -Wmultichar -Woverloaded-virtual -Wpointer-arith -Wredundant-decls -Wshadow -Wsign-promo -Wwrite-strings -fPIC -g  -MT be20_api/abstract_image_reader.o -MD -MP -MF $depbase.Tpo -c -o be20_api/abstract_image_reader.o be20_api/abstract_image_reader.cpp &&\
mv -f $depbase.Tpo $depbase.Po
In file included from be20_api/abstract_image_reader.cpp:1:
be20_api/abstract_image_reader.h:13:18: error: ‘filesystem’ in namespace ‘std’ does not name a type
   13 |     virtual std::filesystem::path image_fname() const = 0;
      |                  ^~~~~~~~~~
make[2]: *** [Makefile:1520: be20_api/abstract_image_reader.o] Error 1
make[2]: Leaving directory '/root/bulk_extractor-2.1.0/src'
make[1]: *** [Makefile:525: all-recursive] Error 1
make[1]: Leaving directory '/root/bulk_extractor-2.1.0'
make: *** [Makefile:465: all] Error 2

root:~/bulk_extractor-2.1.0# g++ --version
g++ (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0

It must be going with c++11 because the 'std.filesystem' is valid in c++17.

I went into the Makefile in src and changed this line to reflect c++17 instead of c++11 and the compile worked after that:

src/Makefile:AM_CPPFLAGS = -pthread -std=c++11  -I$(top_srcdir)/src/be20_api -I$(top_srcdir)/src/be20_api/utfcpp/source
@simsong
Copy link
Owner

simsong commented Jan 26, 2024

Thanks. I'll check it out and try to figure out where the c++11 is coming from.

@simsong
Copy link
Owner

simsong commented Jan 27, 2024

Hi. Can you try b1e500f?

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

2 participants