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

Where is sys/param.h file? #2940

Closed
AjeyaGupta opened this issue Apr 5, 2017 · 5 comments
Closed

Where is sys/param.h file? #2940

AjeyaGupta opened this issue Apr 5, 2017 · 5 comments

Comments

@AjeyaGupta
Copy link

I am using GreenHills compiler to compile the .pb.h, .pb.c and other .cc files. When I first compiled, it showed me an error saying "Fatal Error #5, cannot enter common.h". I had to change the directory of common.h in addressbook.pb.h file in its #include statement. By doing this, I got rid of this error and was able to enter in common.h file. I did similar thing to port.h which is in common.h file. However, in port.h, its now showing me error on line 62, saying "cannot enter sys/param.h". I thought of changing the path for this part of the code, but I am not able to fine this particular file i.e. param.h in any directory. Hence, I am not able to proceed further.

Any help regarding this "sys/paramh.h" will be appreciated.

Thank You

@acozzette
Copy link
Member

The sys/param.h header is just a system header like stdio.h. On my system its full path is /usr/include/sys/param.h. What OS are you using?

@AjeyaGupta
Copy link
Author

Thanks for your reply Adam. I am using Windows OS and GreenHills compiler

@acozzette
Copy link
Member

Ok, I think what's going on is that we have some #ifdefs that try to avoid pulling in that header when building for Windows: https://github.com/google/protobuf/blob/69bfde22b6eb9effd84f7d554b565285e62c0824/src/google/protobuf/stubs/port.h#L50
https://github.com/google/protobuf/blob/69bfde22b6eb9effd84f7d554b565285e62c0824/src/google/protobuf/io/coded_stream.h#L116
But perhaps because you're using the GreenHills compiler, the _WIN32 and _MSC_VER macros we check for are not defined even though you're actually building on Windows. So to get around this, you could either try to figure out a way of tweaking the #ifdefs so that they work for the GreenHills compiler, or else just locally edit the source code so that you can get your build working.

@AjeyaGupta
Copy link
Author

Yes, that's what I did today in the morning. I somehow tweaked the source code (specifically the ifdef part and _WIN32 part) and got rid of the errors. But, it looks like I am getting a complete set of new errors. Starting with "# not expected here: GOOGLE_PROTOBUF_PLATFORM_ERROR" in platform_macros.h. This along with 100 other errors.. :-(

@MoHussein89
Copy link

I know it is old but how did you manage to solve the "# not expected here: GOOGLE_PROTOBUF_PLATFORM_ERROR" in platform_macros.h
Thanks

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

4 participants