开发者

namespace over a #include header file question

开发者 https://www.devze.com 2023-03-23 07:29 出处:网络
I porting code from a windows machine to a Mac.I am using OS X 10.6 with Xco开发者_StackOverflow中文版de 3.2.5

I porting code from a windows machine to a Mac. I am using OS X 10.6 with Xco开发者_StackOverflow中文版de 3.2.5

I have a header file called api.h which has the following code:

namespace ocip {
    #include "onan/ocip/ocip.h"
}

ocip.h includes #include stdint.h

which has the following typedef:

 typedef unsigned int         uint32_t;

Now back to api.h I have class with following in it:

ocip::uint32_t m_nMode;

The compiler tells me that uint32_t in namespace 'ocip' does not name a type.

Any ideas what I am doing wrong?


I don't know if this will help, but a type of "uint32_t" may already be declared. There is already a typedef of the same name if you are including "stdint". This could be causing a problem with redefining it in opic.h.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号