views:

43

answers:

1

I have an old C++ project and I'm having problem building it. For a certain file I receive the following kind of errors:

error: ‘atomic_t’ was not declared in this scope

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. I'm using SUSE Linux Enterprise Desktop 11 and gcc 4.3.2.

Could there be some package that needs to be installed, or an alternative header to be included for those identifiers?

A: 

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.

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

John Knoeller