- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
I'm trying to have two-stage compilation where I create static library first and link it afterwards.
// main.cpp
void foo();
int main() {
foo();
}
// foo.cpp
#include <iostream>
void foo() {
std::cout << "Hi foo!" << std::endl;
}
Compilation:
$ icpx -fast -c -o foo.o foo.cpp
$ xiar rcs libfoo.a foo.o
xiar: executing 'ar'
$ icpx -fast main.cpp -L. -lfoo
/usr/bin/ld: skipping incompatible ./libfoo.a when searching for -lfoo
/usr/bin/ld: cannot find -lfoo
clang++: error: linker command failed with exit code 1 (use -v to see invocation)
Seems like it fails to parse static library format when IPO is enabled. When IPO is disabled, everything is fine. Also, classic ICC compiler works fine.
However, when using direct linkage with object file, everything seems to work fine.
Can you please clarify how to fix that? I'm using CentOS 7.
Thanks in advance.
Link Copied
- « Previous
-
- 1
- 2
- Next »
21 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
We are going to close this thread. If you require additional assistance from Intel, please start a new thread. Any further interaction in this thread will be considered community only.
Thanks,
Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- « Previous
-
- 1
- 2
- Next »