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

flatbuffers.h does not found when compiling #31

Open
monhi opened this issue Jan 25, 2023 · 4 comments
Open

flatbuffers.h does not found when compiling #31

monhi opened this issue Jan 25, 2023 · 4 comments
Labels
bug Something isn't working

Comments

@monhi
Copy link

monhi commented Jan 25, 2023

🚨 First, please check:

Describe the bug
When I add include and lib to the project in windows and using Visual Studio 2013 to compile it I get an error which says it could not find "flatbuffers/flatbuffers.h"

Basic info (please complete the following information):

  • ObjectBox version: [e.g. 0.18.0-windows-x64, latest version?]
  • C or C++ version: [e.g. C++11, Visual Studio 2013]
  • Reproducibility: [always]
  • OS: [Windows 10]

To Reproduce
Steps to reproduce the behavior:
Just try to compile the code in a Visual C++ project.
Expected behavior
A clear and concise description of what you expected to happen.
Just I would like it to compile.
Code
If applicable, add code to help explain your problem.

  • Include affected entity code.
  • Please remove any unnecessary or confidential parts.
  • At best, link to or attach a project with a failing test.

Logs, stack traces
If applicable, add relevant logs, or a stack trace.

Additional context
Add any other context about the problem here.

  • Is there anything special about your code?
  • May transactions or multi-threading play a role?
  • Did you find any workarounds to prevent the issue?
@monhi monhi added the bug Something isn't working label Jan 25, 2023
@greenrobot
Copy link
Member

To help efficiently, may I ask you to provide additional information about your setup and the location of the compiler error you are getting? For future issues, please clean up the unused text from the issue template to make it more readable. Thanks!

@monhi
Copy link
Author

monhi commented Jan 25, 2023

Please download my analyzer application from following link and try to compile it with Visual Studio 2013 or 2015 or higher.
https://github.com/monhi/Online-Crypto-Analyzer
I just tried to add lib and include path to the project in Debug mode and add following file to the main file.
#include "./include/objectbox.hpp"
Then I try to compile the project and get for following line:

#ifndef OBX_DISABLE_FLATBUFFERS // FlatBuffers is required to put data; you can disable it until have the include file.
#include "flatbuffers/flatbuffers.h"
#endif

which says flatbuffers.h does not found.
I expect to see the above file in the include path.

to neglect the error I just comment out above include line and then try to compile the code and find other syntax errors.
But for now, Please let me know if it works without flatbuffers or not.
If we are supposed to add flatbuffers to make it run, isn't it better to add it to the project?

Best wishes,

@greenrobot
Copy link
Member

greenrobot commented Jan 25, 2023

OK, so if your setup also includes ObjectBox generator, you want to have Flatbuffers. If you want you can go with the version in the external/flatbuffers directory. You need to setup your compiler to use that directory for includes.

Btw, there is some existing documentation here: https://cpp.objectbox.io/installation#flatbuffers-optional

@monhi
Copy link
Author

monhi commented Jan 25, 2023

Let me test and inform you tomorrow

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants