-
Notifications
You must be signed in to change notification settings - Fork 213
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
cstdint #40
Comments
Hi Alan, I think I got it plain wrong. You had included boost/cstdint in the header files. My problem is due to the new Table.h, in which you forward declare TableValue to use it in a std::map and std::vector before actual definition. Does this code compile for you? To me, this should not compile, as you use a forward declaration and use it as such that in a std::vector. At line 65 in Table.h, you could use Cheers, |
First: this library should be compiled using the C++98 standard. There currently is no benefit to compiling it using the C++11 standard. Try compiling it using C++98 instead of C++11 and hopefully that error should go away. As far as I know compiling SimpleAmqpClient using the C++98 standard should not prevent you from using SimpleAmqpClient with programs that use the C++11 standard, assuming you use the same compiler and standard library. The typedef code on line 65 of Table.h doesn't require TableValue to be completely defined at the point. The TableValue type needs to be completely defined when its used in a way where it is allocated or a method is used* So if you use the Array object after including Table.h you should be ok to use it as the TableValue is defined later in the file. *Don't quote me on that. C++ is a very complicated standard, and the rule i believe is a bit more complicated than that, thats just a rule-of-thumb I use. |
Thanks for your quick answer! Actually you're right, no need to compile your code in c++11 mode. It's just I'm used to only that mode now, because my own code is c++11 only (not a fashion, it's been 1.5 year I need that). Furthermore it's the default with the latest clangs on 10.7/8. Thanks for your explanation, I think it relates to the 'c++ curiously recurring template pattern', but I'm surprised it can compile anyway. but watch out for c++11 mode with that TableValue (line 65 etc), because I don't think this part will compile, and again, it's now the default on osx (soon on debian I think). edit: I've just compiling it on debian with g++ 4.7 (c++98 mode): I have the undefined uint32_t errors. Cheers, |
Could you provide any documentation that C++11 mode is the default on either of these platforms/compilers? Could you post the errors you get on the debian platform? |
Just built SimpleAmqpClient on Ubuntu 12.10 (a Debian variant) with the default g++ (v4.7.2). The library compiles cleanly. I'll need some additional information to help track down the undefined errors you're seeing. |
Hi Alan, Right again :), there's no documentation of that behavior, I was misleaded by cedarbdd/cedar#47. Sorry for the noise. I was clearly wrong. The default is still c++98. I will post this evening (GMT+2) the errors I get on debian. Thanks for your help (and patience :)) |
Hi Alan, Here are my errors with debian gcc 4.7
Do you need anything else? Best regards, |
What version of rabbitmq-c are you using? |
0.0.1.hg216-1, the only one available on debian I think, that is without custom repo, of course. Is it too old? I don't yet see the relation with uint32_t, uint16_t, etc. |
That version of rabbitmq-c is ancient and will not work with the current version of SimpleAmqpClient. Unless you know of a more recent version of the package, you will need to download rabbitmq-c and build it from source: |
Great, works fine now. Thank you Alan. |
Alan,
With clang c++11, I had to manually add #include <boost/cstdint.hpp> in all cpp files from the src folder.
I added it just before #include <amqp.h>, else clang complains about size_t, uint16_t, etc undefined.
But then other errors appear:
Could you please update this? Thanks!
Romain
The text was updated successfully, but these errors were encountered: