View Full Version : Linux vs Windows 3rd party libraries

7th August 2010, 07:52
I have developed a Qt application in Linux and am trying to port it to Windows. The application used several third party libraries and I am currently searching for Windows versions, or Windows equivalents. My question is this. How do I link to 3rd party libraries in Windows? In Linux it was pretty straightforward. I went to the Ubuntu software center or Synaptic Package Manager, and got the development files for whatever I needed, like LAME or QJson. The package came with a shared object (.so) file in the /usr/lib directory, as well as a .h file in the /usr/include directory. You added the .so file to the Libs section of the Qt project file, and did a #include to the .h file in whatever module you needed it. How does this work in Windows? Do I need a .h file and a dll, or just a dll, as if I were programming in VB or C# ? If it is just a dll, how do I access the classes and procedures inside? Sorry if I come off sounding like an imbecile, but considering how straightforward this is in Linux, Windows is kind of obtuse. Any help you can give would be most appreciated.

7th August 2010, 09:29
Libraries that do not come with header files are not meant to be used as a public programming api (in other words: they are not meant for you to be used).

However, Microsoft has a tool that creates a header file for a lib file. I can't remember the name, but surely msdn will give you tons of information.
The qt activex module contains information on this tool too when creating header files for Office objects.

Libraries should ALWAYS be installed in a folder known by the PATH environment variable. On linux, usually /usr/lib on windows c:\window\system... I think.
The same with header files.

If not, you will need to tell qmake or whatever you use to find them. Then it's probably a good idea to include them in your project folder.

7th August 2010, 21:04
Thanks. Is there an equivalent to /usr/include in Windows where Qt automatically looks for header files?

8th August 2010, 04:01
Look in the Path variable in the MyComputer->Properties->Advanced->Envir.Variables (bottom of the window) ->System (or User) variables and Path variable.
Path is global - system wide - (or in Logged User space variable, depending where it is declared) for path lookup. Here add path to i.e. c:\mingw32\bin or any other lib\inlcude that You want to use.
Better is to use pro file and use include directive. And no there is nothing like /use/include on the windows (well maybe %SystemRoot%/System32 and it's dll's ), and %SystemRoot% is always checked so You can CTRL+C/V to the c:\Windows ( <- joke).

9th August 2010, 01:23
Thanks for everything. Now I just need to find Windows versions, or Windows equivalents, to the following libraries. libkCcmpactdisc,libkcddb,libcdio_cdda,libcdio_para noia,libmp3lame,libvorbisenc, and libFLAC++. It's basically a cd ripper component for a jukebox program. Works great in Linux, but the Windows conversion is proving tricky. There don't seem to be Windows development libraries for these, like there are for Linux, so I may need to compile from source.