简体   繁体   中英

library not found. Trying to compile a program including Lapack (C++)

I might be violating all posting rules about duplication, but really I'm desperate looking for information two days in a row and I found nothing useful for this simple but aweful problem.

I just want to compilate a code c.cpp with the command

g++ -c -std=c++11 -llapack -lblas program.cpp -o program.o

I sincerely don't know if I have to write in the code #include lapack, #include "lapack", #include lapack.a, #include liblapack.a... The situation is that I have a liblapack.a linked file located at usr/lib.

Where is the problem? I have tried all possible combinations...

It's the first time I use libraries who are not the classical stdio.h, cmath, etc.

Thank you very much :)

Just edited: I realized that the words between "<" and the corresponding closing "more than" disappear.

In program.cpp you do need to #include the relevant header files. Only way to know what those are is to know what the code uses. I imagine when you try to compile you get some error messages telling you what names are undefined.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM