简体   繁体   中英

Errors in building C++ project in CentOS 6.x 64 bit OS

I am facing some errors in building C++ project in 64 bit CentOS 6.x. The project is been build successfully in 32 bit CentOS 6.x. Though there are some threads about these types of errors, I need more clarification. The errors are-

/usr/include/sys/types.h:198: error: conflicting declaration ‘typedef long int int64_t’
./Headers/PALsystypes.h:22: error: ‘int64_t’ has a previous declaration as ‘typedef long  long int int64_t’
/usr/include/sys/types.h:204: error: conflicting declaration ‘typedef long unsigned int u_int64_t’
./Headers/PALsystypes.h:23: error: ‘u_int64_t’ has a previous declaration as ‘typedef long long unsigned int u_int64_t’

And there are more errors like below-

d5-x86_64.o md5-x86_64.s
md5-x86_64.s: Assembler messages:
md5-x86_64.s:41: Error: 0xd76aa478 out range of signed 32bit displacement
md5-x86_64.s:50: Error: 0xe8c7b756 out range of signed 32bit displacement
md5-x86_64.s:68: Error: 0xc1bdceee out range of signed 32bit displacement
md5-x86_64.s:77: Error: 0xf57c0faf out range of signed 32bit displacement
md5-x86_64.s:95: Error: 0xa8304613 out range of signed 32bit displacement
md5-x86_64.s:104: Error: 0xfd469501 out range of signed 32bit displacement
md5-x86_64.s:122: Error: 0x8b44f7af out range of signed 32bit displacement
md5-x86_64.s:131: Error: 0xffff5bb1 out range of signed 32bit displacement

Please give me any feedback to this post.

typedef int foo;
typedef float foo;

See, there's the minimal example and this has nothing to do with 32 or 64 bits. The problem is that some header file declares symbols than another already declared and does so in an incompatible way. I'd blame PALsystypes, which has no business declaring in particular int64_t, which should come from the system's stdint.h.

Concerning the assembler warnings, consider using unsigned integers, both the variables and the constants (0x123u is unsigned).

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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