简体   繁体   English

asm / atomic.h编译错误

[英]asm/atomic.h compile error

I have an old C++ project and I'm having problem building it. 我有一个旧的C ++项目,在构建它时遇到了问题。 For a certain file I receive the following kind of errors: 对于某些文件,我会收到以下类型的错误:

error: 'atomic_t' was not declared in this scope 错误:在此范围内未声明“ atomic_t”

And others for other identifiers like atomic_read, atomic_inc, etc. The file has an include for asm/atomic.h, but I cannot find the header file on my system. 其他用于其他标识符,例如atomic_read,atomic_inc等。该文件包含asm / atomic.h的包含文件,但我无法在系统上找到头文件。 I'm using SUSE Linux Enterprise Desktop 11 and gcc 4.3.2. 我正在使用SUSE Linux Enterprise Desktop 11和gcc 4.3.2。

Could there be some package that needs to be installed, or an alternative header to be included for those identifiers? 是否需要安装某些软件包,或为这些标识符包含替代标头?

These are meant to be kernel headers, not really for applications to use. 这些仅是内核头文件,并非真正供应用程序使用。 They are the prototypes for some atomic test and set, increment, decrement etc that are implemented in assembler. 它们是一些原子测试和设置,递增,递减等的原型,这些原型在汇编器中实现。

so even if you find the header files, you will still need the .o from the asm or the .asm sources. 因此,即使找到了头文件,仍然需要来自asm或.asm源的.o。

These are not the files you are looking for, but they are very likely to be the same or similar. 这些不是您要查找的文件,但是它们很可能相同或相似。

http://github.com/github/linux-2.6/blob/3067e02f8f3ae2f3f02ba76400d03b8bcb4942b0/arch/sh/include/asm/atomic.h http://github.com/apache/stdcxx/blob/7b51a66e3db202b7d317c74a5666aaeef7b4ebd0/src/atomic.asm http://github.com/github/linux-2.6/blob/3067e02f8f3ae2f3f02ba76400d03b8bcb4942b0/arch/sh/include/asm/atomic.h http://github.com/apache/stdcxx/blob/7b51a66e3db202b7d317c74a5666aaeef7b4

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM