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

GCC < 9 incompatibility #17

Closed
tieugene opened this issue May 12, 2021 · 6 comments
Closed

GCC < 9 incompatibility #17

tieugene opened this issue May 12, 2021 · 6 comments

Comments

@tieugene
Copy link

Readme.md:

To build the library, GCC 7.3 or later version is required.

Build for CentOS8 (gcc 8.3.1):

g++ -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -std=c++17 -pthread -fPIC -fsigned-char -o tkrzw_build_util tkrzw_build_util.o -Wl,-z,relro  -Wl,-z,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld -L. -L/usr/lib64 -Wl,-rpath-link,.:/usr/local/lib:.:/usr/local/lib: -Wl,--as-needed -L. -L/usr/lib64 -ltkrzw -lstdc++ -lrt -lpthread -lm -lc 
./libtkrzw.so: undefined reference to `std::filesystem::__cxx11::path::_M_split_cmpts()'
./libtkrzw.so: undefined reference to `std::filesystem::resize_file(std::filesystem::__cxx11::path const&, unsigned long)'
collect2: error: ld returned 1 exit status
make: *** [Makefile:662: tkrzw_build_util] Error 1

(full log)

@estraier
Copy link
Owner

estraier commented May 12, 2021 via email

@tieugene
Copy link
Author

I worked around this for CentOS8 enabling GCC10 instead of 8.3 normally used.
But the sentence "GCC 7.3 or later" is not actual.

@estraier
Copy link
Owner

I committed a change to remove dependency on std::filesystem.

@tieugene
Copy link
Author

I committed a change to remove dependency on std::filesystem.

May be this is too strict solution.
'filesystem' is very usual thing and filesystem::path is highly recommended instead of char * for file/folder names.
I solved this problem in CentOS8 and seems nobody else interesting in.
Just note in Readme.md "GCC 7.3 9.0 or later" (or something like "C++17 less or more compatible compiler")

@estraier
Copy link
Owner

In Tkrzw, only the truncating function used std::filesystem feature. Other operations related to path and the file system are implemented as utilities in tkrzw_file_util.h. Considering portability on systems including Windows and other Unix-like systems than Linux/Mac, the current policy is practical. I agree that the path object is smarter than char*, though.

@tieugene
Copy link
Author

0.9.16 @ RH8 (GCC 8.3.1) ok

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