Closed neo1949 closed 4 years ago
I don't never tried to use visual studio for this. I suggest you type make
on the commandline, that should work. Another thing you may check, is if your gcc is recent enough, I know it works with gcc 8 and gcc 9.
Hi @nlitsme, thanks for your remind. I have already used the make
command to build the project yesterday. It returned the same error as building with vs code. According to remind, it turned out to be my gcc version on ubuntu 14 is too old:
gcc
version on my ubuntu:
$ gcc --version
gcc (Ubuntu 5.5.0-12ubuntu1~16.04) 5.5.0 20171010
Copyright (C) 2015 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.
Refer to install gcc-9 on Ubuntu 18.04? to install gcc-9
and g++-9
:
$ sudo apt-get install software-properties-common
$ sudo add-apt-repository ppa:jonathonf/gcc-9.0
$ sudo apt-get update
$ sudo apt-get install gcc-9
$ sudo apt-get install g++-9
Refer to How do I use the latest GCC on Ubuntu? to make gcc-9
as default gcc
:
$ sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-5 1 --slave /usr/bin/g++ g++ /usr/bin/g++-5
update-alternatives: using /usr/bin/gcc-5 to provide /usr/bin/gcc (gcc) in auto mode
$ sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-9 2 --slave /usr/bin/g++ g++ /usr/bin/g++-9
update-alternatives: using /usr/bin/gcc-9 to provide /usr/bin/gcc (gcc) in auto mode
$ gcc --version
gcc (Ubuntu 9.3.0-10ubuntu2~16.04) 9.3.0
Copyright (C) 2019 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.
After setting gcc-9
as the default version, the project was built successfully with make
:
$ make
g++ -g -Wall -c -O3 -I itslib -D_UNIX -D_NO_RAPI -I /usr/local/include -I . -std=c++17 -MD ext2rd.cpp -o ext2rd.o
......
g++ -g -Wall -L/usr/local/lib -std=c++17 ext2dump.o stringutils.o -o ext2dump
Last but not least, thanks for your help!
Hi, I cloned the repo and try to build the project in linux visual studio code 1.47.1
I use the
Code Runner
plugin the compile this project, but get errors ‘size’ is not a member of ‘std’ and ‘empty’ is not a member of ‘std’:I have little knowledge about c++, could you give me some advice on how to fix the errors?