How to add a external library on Windows
-
wrote on 30 Dec 2011, 20:31 last edited by
I try to add a external library modifying the .pro file with the following code:
@
win*{
LIBS += -L/C:/CornerStone/include -lMultiWidgets -lFluffy
CONFIG += console
}
@but without success.
[EDIT: code formatting, Volker]
-
wrote on 30 Dec 2011, 20:48 last edited by
-L/C:/CornerStone/include is not a valid search path for additional libraries directories. You should write -LC:/CornerStone/include (without first slash). Are MultiWidgets.lib and Fluffy.lib in that directory ?
-
wrote on 30 Dec 2011, 20:54 last edited by
MultiWidgets and Fluffy are folders with a lot of .hpp files.
-
wrote on 30 Dec 2011, 22:17 last edited by
If you want to add an include directory you will have to use INCLUDEPATH.
If you want to add binary libraries or import libraries you will have to use LIBS. -
wrote on 30 Dec 2011, 23:21 last edited by
INCLUDEPATH is for the includes, LIBS get the libraries.
@
INCLUDEPATH += C:/CornerStone/includeLIBS += -LC:/CornerStone/lib
LIBS += -lMultiWidgets -lFluffy
@It's unlikely that the include directory contains the libs.
The directory C:/CornerStone/lib must contain MultiWidgets.lib and Fluff.lib. If not, search for the directories that contain those and add them to the LIBS variable.
And as cincirin already mentioned, leave out the leading slash of the paths.
-
wrote on 3 Jan 2012, 16:55 last edited by
I found de lib folder with Multiwidgets.lib. But the thing is that the files that i need are hpp type, not libs type. And this are in the include folder.
So, how can i add the include folder, that contains the .hpp files that i need? -
wrote on 3 Jan 2012, 17:40 last edited by
[quote author="Steban" date="1325609743"]So, how can i add the include folder, that contains the .hpp files that i need?[/quote]
[quote author="Lukas Geyer" date="1325283449"]If you want to add an include directory you will have to use INCLUDEPATH.[/quote]
-
wrote on 4 Jan 2012, 15:22 last edited by
You will most probably need the .hpp files and the .lib files. Without the first, your compilation fails, without the latter the linking fails.
Some hints and a complete example have been given, you're supposed to adapt them to your needs.
1/8