- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi!
Why the following program fails to compile with the option -ffreestanding? (Without -ffreestanding there is no errors.)
//test.cpp
#include <climits>
int main() {
char buf[MB_LEN_MAX];
return 0;
}
Command: icpc test.cpp -ffreestanding -o test.exe
Output:
error: identifier "MB_LEN_MAX" is undefined
- Tags:
- CC++
- Development Tools
- Intel® C++ Compiler
- Intel® Parallel Studio XE
- Intel® System Studio
- Optimization
- Parallel Computing
- Vectorization
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Seems like a compiler issue. I will report it to the compiler team.
Can you #include"/usr/include/limits.h" as a workaround?
Thanks,
Viet
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I've reported this case CMPLRLIBS-2739
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Viet Hoang (Intel) wrote:Can you #include"/usr/include/limits.h" as a workaround?
Hi, Viet!
No, I'm not sure that we can do it. But we may refrain from using the option -ffreestanding.
Our goal is to drop the dependency on libirc.so. The icpc optimizes some code and places the calls to __intel_fast_memcpy (as well as some other __intel_fast_-functions) in our library, which in turn bring us the unacceptable dependency on libirc.so.
So we just need to find a way to drop the dependency on the libirc.so (and we can not link in the static version of libirc library as well). Could you please provide us with any solution?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
You can try -fno-builtin to see if it helps; but to avoid dependency on Intel shared libs, you would need to link in statically (-static-intel)

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