Open Arpit-1996 opened 1 year ago
@Arpit-199 you need to build the fCWT library or include the source files.
Your custom code in cwt.cpp
is not enough.
In your code you include fcwt.h
somewhere at the beginning of the file right?
Then you need to tell the compiler to include this file and also add the implementation in fcwt.cpp
.
You maybe have to adjust the path to the files but something like the following should work:
g++ cwt.cpp src/fcwt/fcwt.cpp -I src/fcwt/
@Arpit-1996, is your question/issue answered/solved? If yes, than this issue can be closed.
It's a linker error, not compiler, so you need to add the library with -l
(the addition of headers above won't solve it because it's already compiled). Better than manualy adding flags would be to use CMake to build.
I run this command in the command terminal and we make CMake files. I do not understand where I save the C++ Example and run this code If I run C++ code in any folder this error happens. What should I do?
@arpitomar you are not telling the compiler where to find fcwt.h
@Arpit-199 you need to build the fCWT library or include the source files. Your custom code in
cwt.cpp
is not enough. In your code you includefcwt.h
somewhere at the beginning of the file right? Then you need to tell the compiler to include this file and also add the implementation infcwt.cpp
.You maybe have to adjust the path to the files but something like the following should work:
g++ cwt.cpp src/fcwt/fcwt.cpp -I src/fcwt/
I include fcwt.h file in main.cpp and fcwt.cpp file but error remains same.
Then how to remove error?
It is a linker error you are seeing. You need to tell g++ where the library was installed to (-L can be used for this), and then link against it with -lfCWT
. As it stands, you aren't linking against the library you built earlier, so the error is saying that the functions decalred in the header don't have implementations in your code, and can't be found elsewhere.
This error comes when we run C++ code of fCWT.