Calling external functions from QT
-
Hi guys,
I developed a whole new library to do some calculations on Eclipse. Now I need to call these functions inside Qt. I added the path to PATH variable at .pro file, but when I try to compile, I get "no such file or directory" error. Any idea on how to solve this?
-
Hi ArchGabe.
Did you add LIBS += "/path/to/lib" to .pro file?
Regards. -
Yes, I did...
-
test.hpp: no such file or directory
-
Well, to do this, I'm doing..
- Add LIBS += to .pro file.
- Add .h of library to my project.
- Copy library to app folder.
Hope it's util.
Regards.
-
Actually, there is no .lib file. All I want is to import the header file, which has all the functions definitions...
-
You should use:
- INCLUDEPAT += path/to/include
In the .pro file.
-
Now I am getting multiple definition error...
-
You should include all the includes necessaries. More information would be confortable...
-
I did...
.
On Eclipse, I created a .hpp file like this:@
#ifndef FUNCTION__HPP__
#define FUNCTION__HPP__int foo() {return 2;}
#endif
@Then, I added the following path to my QT project .pro file:
@
INCLUDEPATH += /path_to_hpp_file
@My mainwindow.h
@
#include "function.hpp"
@and on my mainwindow.cpp also (wich doensn't change anything):
@
#include "function.hpp"
@Now I am getting "multiple definition" error... And I don't know why...
-
It's the method already defined in other part of your code?
-
No...