Cant compile, getting undefined reference even though including lib.

Cant compile, getting undefined reference even though including lib.

Portrait de cptanpanic

I am trying to compile a simple program that consists of 2 objects and a library. I compiled the library with icc, and it doesn't complain that it doesn't exist but the methods I am using show up as undefined references. Any help would be greatly appreciated.
Thanks,
Brian

icc -g -c -o do_delta.o do_delta.cpp
icc -g -c -o PerfTest.o PerfTest.cpp
icc -L. -lperfctr_icc2 do_delta.o PerfTest.o -o do_delta
PerfTest.o(.text+0x11a5): In function `RunTest':
/home/panic/devo/perfTest/PerfTest.cpp:102: undefined reference to `vperfctr_read_tsc(vperfctr const*)'
PerfTest.o(.text+0x11d5):/home/panic/devo/perfTest/PerfTest.cpp:104: undefined reference to `vperfctr_read_tsc(vperfctr const*)'
PerfTest.o(.text+0x12b9):/home/panic/devo/perfTest/PerfTest.cpp:110: undefined reference to `vperfctr_read_ctrs(vperfctr const*, perfctr_sum_ctrs*)'
PerfTest.o(.text+0x12db):/home/panic/devo/perfTest/PerfTest.cpp:112: undefined reference to `vperfctr_read_ctrs(vperfctr const*, perfctr_sum_ctrs*)'
PerfTest.o(.text+0x136d): In function `Initialize':
/home/panic/devo/perfTest/PerfTest.cpp:69: undefined reference to `vperfctr_open()'
PerfTest.o(.text+0x13bb):/home/panic/devo/perfTest/PerfTest.cpp:74: undefined reference to `vperfctr_info(vperfctr const*, perfctr_info*)'
PerfTest.o(.text+0x1407):/home/panic/devo/perfTest/PerfTest.cpp:79: undefined reference to `perfctr_info_print(perfctr_info const*)'
PerfTest.o(.text+0x149e): In function `Enable':
/home/panic/devo/perfTest/PerfTest.cpp:138: undefined reference to `vperfctr_control(vperfctr const*, vperfctr_control*)'

2 posts / 0 nouveau(x)
Dernière contribution
Reportez-vous à notre Notice d'optimisation pour plus d'informations sur les choix et l'optimisation des performances dans les produits logiciels Intel.
Portrait de cptanpanic

I have been trying things, and it has to do with the library being C and the program is in C++. I am using extern "C" but I am seeing if I can find what is wrong.

Connectez-vous pour laisser un commentaire.