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

Undefined symbol EOF #2755

Closed
1 of 5 tasks
cxxman opened this issue May 3, 2021 · 10 comments · Fixed by #2756
Closed
1 of 5 tasks

Undefined symbol EOF #2755

cxxman opened this issue May 3, 2021 · 10 comments · Fixed by #2756
Assignees
Labels
kind: bug release item: 🔨 further change solution: proposed fix a fix for the issue has been proposed and waits for confirmation

Comments

@cxxman
Copy link

cxxman commented May 3, 2021

What is the issue you have?

I am getting compilation error like "Undefined symbol EOF" with gcc9 on Ubuntu 18.04

Please describe the steps to reproduce the issue.

Include single header file json.hpp and try to compile code that uses it.

Can you provide a small but working code example?

What is the expected behavior?

I can see EOF still used in the one place in the single header. Did not check multiple headers.
After replacing with std::char_traits<char>::eof() it has started to work.
Please incorporate this small change.

And what is the actual behavior instead?

Which compiler and operating system are you using?

  • Compiler: ___
  • Operating system: ___

Which version of the library did you use?

  • latest release version 3.9.1
  • other release - please state the version: ___
  • the develop branch

If you experience a compilation error: can you compile and run the unit tests?

  • yes
  • no - please copy/paste the error message below
@nlohmann
Copy link
Owner

nlohmann commented May 4, 2021

I can't reproduce the issue - we use several compilers include GCC9 on Ubuntu in our CI. Indeed there is one occurrence of EOF, but we also include the required header <cstdio>. That said - I have no idea why this is a compilation error on your side. Can you compile the unit tests?

That aside, I will create a PR that replaces this occurrence.

@nlohmann nlohmann added the solution: proposed fix a fix for the issue has been proposed and waits for confirmation label May 4, 2021
@nlohmann nlohmann self-assigned this May 4, 2021
@nlohmann nlohmann added this to the Release 3.9.2 milestone May 4, 2021
@cxxman
Copy link
Author

cxxman commented May 4, 2021

thanks! btw, when 3.9.2 can be expected?

@nlohmann
Copy link
Owner

nlohmann commented May 4, 2021

When it's done ;)

Seriously, I have no idea...

@cxxman
Copy link
Author

cxxman commented May 4, 2021

Then why not release it now? It is better to release less things but a bit more often, then release a lot but never...

@nlohmann
Copy link
Owner

nlohmann commented May 4, 2021

Because it’s not ready yet. This is a side project - there are no deadlines here.

@apirogov
Copy link

I have this issue now with the latest version, there are two places where the EOF macro is used.

@nlohmann
Copy link
Owner

@apirogov Right, I thought it was fixed, but it seems #4179 re-introduced the issue. Which compiler do you use that does not support EOF?

@apirogov
Copy link

apirogov commented Dec 10, 2024

Well, I'm compiling with GCC, but we're using clang-tidy (LLVM 18) to check the code as part of the workflow, and it complains about the "undefined symbol". I guess it's not about supporting the symbol, but that clang(-tidy) is more pedantic (which is good, actually). I patched the release version of json.hpp (replacing EOF with std::char_traits<char>::eof(), as suggested above), and the problem went away for us.

@nlohmann
Copy link
Owner

Thanks. I'll create a PR for this as well.

@nlohmann
Copy link
Owner

@apirogov PTAL at #4532

nlohmann added a commit that referenced this issue Dec 10, 2024
* 📝 update customers

* ♻️ replace EOF with char_traits #2755
slowriot pushed a commit to slowriot/json that referenced this issue Jan 10, 2025
* 📝 update customers

* ♻️ replace EOF with char_traits nlohmann#2755
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind: bug release item: 🔨 further change solution: proposed fix a fix for the issue has been proposed and waits for confirmation
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants