- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
The following C file test_rotl.c
#include <stdint.h>
#include <string.h>
#if defined(__has_builtin)
# if __has_builtin(__builtin_rotateleft32)
# define NMH_rotl32 __builtin_rotateleft32 /* clang */
# endif
#endif
#if !defined(NMH_rotl32)
# if defined(_MSC_VER)
/* Note: although _rotl exists for minGW (GCC under windows), performance seems poor */
# define NMH_rotl32(x,r) _rotl(x,r)
# else
# define NMH_rotl32(x,r) (((x) << (r)) | ((x) >> (32 - (r))))
# endif
#endif
int main (void) {
int32_t number = 1;
printf("%d", NMH_rotl32(number, 16));
}
when compiled and linked by icc
icc test_rotl.c -o test_rotl.exe
yields the error message
Undefined symbols for architecture x86_64:
"___builtin_rotateleft32", referenced from:
_main in iccFqDwPl.o
ld: symbol(s) not found for architecture x86_64
whichI believe implies that the icc header files tell the preprocessor that ___builtin_rotateleft32 exists, but the linker cannot find the procedure in the libraries.
FWIW
icc --version
icc (ICC) 2021.2.0 20210228
Copyright (C) 1985-2021 Intel Corporation. All rights reserved.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
Thank you for posting in Intel Communities.
We've tried compiling the code with latest version of icc compiler(2021.4) at our end, and it's working fine.
We recommend that you compile the code with the latest version of icc compiler (2021.4).
Please do let us know if you still face any issues.
Thanks and Regards,
Ditipriya.
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
Thank you for posting in Intel Communities.
We've tried compiling the code with latest version of icc compiler(2021.4) at our end, and it's working fine.
We recommend that you compile the code with the latest version of icc compiler (2021.4).
Please do let us know if you still face any issues.
Thanks and Regards,
Ditipriya.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
Thanks for accepting our solution. If you need any additional information, please post a new question as this thread will no longer be monitored by Intel.
Thanks and Regards,
Ditipriya.

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page