Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fCWT in C++ #39

Open
Arpit-1996 opened this issue Jun 23, 2023 · 7 comments
Open

fCWT in C++ #39

Arpit-1996 opened this issue Jun 23, 2023 · 7 comments

Comments

@Arpit-1996
Copy link

This error comes when we run C++ code of fCWT.
Screenshot 2023-06-23 001013

@felixdollack
Copy link
Contributor

@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/

@fastlib
Copy link
Owner

fastlib commented Jul 6, 2023

@Arpit-1996, is your question/issue answered/solved? If yes, than this issue can be closed.

@stellarpower
Copy link

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.

@arpitomar
Copy link

Screenshot 1
Screenshot 2
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
Screenshot 3
If I run C++ code in any folder this error happens.
What should I do?

@felixdollack
Copy link
Contributor

@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 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
Copy link
Author

I include fcwt.h file in main.cpp and fcwt.cpp file but error remains same.

Screenshot 2023-09-15 173650
111

2023-09-15 173746
Then how to remove error?

@stellarpower
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants