- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello,
I am trying to use a VTune API (ittnotify.h) in C++ code. When I try to compile and link files with single command it works correctly. But when performing separate compilation and linking I get following error:
test.cpp:6: undefined reference to `__itt_pause_ptr__3_0' test.cpp:6: undefined reference to `__itt_pause_ptr__3_0' test.cpp:7: undefined reference to `__itt_resume_ptr__3_0' test.cpp:7: undefined reference to `__itt_resume_ptr__3_0'
Solution 1
icpc -Wall -c test.cpp -g -I/data/development/intel/vtune_amplifier_xe_2015/include -o test.o icpc -g -I/data/development/intel/vtune_amplifier_xe_2015/include /data/development/intel/vtune_amplifier_xe_2015/lib64/libittnotify.a -lpthread test.o -o test
Solution 2:
icpc -g test.cpp -I/data/development/intel/vtune_amplifier_xe_2015/include /data/development/intel/vtune_amplifier_xe_2015/lib64/libittnotify.a -lpthread -o test
test.cpp
#include "stdio.h" #include "ittnotify.h" int main(int argc, char* argv[]) { __itt_pause(); __itt_resume(); return 1; }
For my reasons I cannot use single command version in solution 2. Can you please help me fix steps in solution 1?
System: SLES 11 SP3, Intel Parallel Studio 2015 Pro Update 1
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I already found what was wrong. On line 2 in solution 1 test.o has to be before linker flags. In that case it is linked correctly.
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I already found what was wrong. On line 2 in solution 1 test.o has to be before linker flags. In that case it is linked correctly.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks!!
This helped a lot!
I was stuck on this for eternity!

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