How to set Python libraries in .pro file of Qt - pyqt

can anyone tell me which libraries will be added in the following line:
"LIBS += -L$(PYLIB) -lutil -lpython2.6"
After reading some online articles and tutorials, it seems util.lib and python2.6.lib should be added in python library, but I did not find these two libraries anywhere. Any help is appreciated. Thanks.

the -L option adds directories to be searched for -l statements.
So resolve PYLIB, which should stand atop of the Makefile. Then you might find the libraries.
But if you have problems with linking, because the libraries are not to be found, there might be a problem with the package you downloaded or something. :)
I would help more, but the question lacks some contextual information.

Related

Linux Kernel configs official documentation

When compiling a linux kernel, one of the first step is to generate the .config file which in my case I'm getting from the currently installed kernel. So it generates this files with a lot of KEY=VALUES like:
CONFIG_64BIT=y
CONFIG_X86_64=y
CONFIG_X86=y
CONFIG_INSTRUCTION_DECODER=y
CONFIG_OUTPUT_FORMAT="elf64-x86-64"
CONFIG_ARCH_DEFCONFIG="arch/x86/configs/x86_64_defconfig"
CONFIG_STACKTRACE_SUPPORT=y
# etc...
I can just copy/paste one of those keys in google and I'll probably find (in some random site) a detailed explanation for what it is used for. So my question is, is there an official place where I can rely to know about those configs? I searched on kernel.org/doc and didn't found so I decided to ask here. Thanks in advance.
The documentation can be access through the make menuconfig, each entry is documented (a paragraph describes the option).
But you can only see the options that are available to your architecture, and also if you disable a feature it may hide some related option.
If you want to see all options, the best thing it is to open the Kconfig files.
You can go here: https://github.com/torvalds/linux/ and search for Kconfig files (There are at this moment 1021 Kconfig files)
But clearly if you do not know where to search, for example if you are looking for CONFIG_INSTRUCTION_DECODER, from the kernel source tree run: grep INSTRUCTION_DECODER $(find -name Kconfig)
But INSTRUCTION_DECODER is not really a good example since there is no associated help section with that option...

What is LD_RUNPATH?

A couple of answers mention the LD_RUNPATH environment variable:
use RPATH but not RUNPATH?
How to blacklist a shared library to avoid it being fetched by the loader?
but I couldn't find any description or official reference, including in the ld(1) and ld.so(8) Linux man pages. It seems that the goal is to have a lower precedence than LD_LIBRARY_PATH, particularly useful under Solaris, where LD_LIBRARY_PATH overrides everything.
A search on Google shows some discussions involving LD_RUNPATH, but nothing concrete. A search on Wikipedia is also unsuccessful. I also did some compilation/run tests with shared libraries under GNU/Linux and Solaris, but couldn't notice any effect.
So, what is this environment variable? Is there any official documentation?
There is no LD_RUNPATH. Most likely this is a typo of LD_RUN_PATH or DT_RUNPATH.
Regarding DT_RUNPATH, TechBlog says:
The DT_RUNPATH value is set with the linker options -rpath (or
LD_RUN_PATH) and the –enable-new-dtags.
Sorry, did not fully understand (or read enough :) ), in the ld(1) manual you have the answer:
LD_RUN_PATH is used to initialise the run path if the -rpath option is not used.
You may find interresting informations on GNU GCC pages or on Linux documentation project.
See:
http://tldp.org/HOWTO/Program-Library-HOWTO/shared-libraries.html

Compiling Libpng in Windows 7 or getting a hold of Libpng12.dll (and understanding how to link .DLL in VS)

I've been using Libpng15 in Windows 7, but I've been getting errors in relation to the
Unresolved External _png_set_longjmp_fn error when I compile my code. I followed the directions in the aforementioned link, and while it DID compile without any errors, I wound up with a message saying that I needed libpng12.dll to continue.
So, I did some Googling for libpng12.dll...nothing came up but generic "find x.dll" websites which appeared to be scams.
I've tried reading the INSTALL docs for the libpng source code on their website, and all that I see is instructions on how to do it via Unix based systems. I tried to do this in Cygwin with no luck, so I'm kind of stuck on how to compile this library.
All in all, I'm willing to do either the compilation or just using the .dll, though the problem is that I can't find a working .dll for version 12.
Another thing I tried was downloading binaries from here, which claimed to be "libpng12 for windows". I then copied the files into my VC compiler directory, which overrode libpng15, I think. Still, when I link against it statically and run my program in VC, it says that I require the .DLL file. The libpng12.dll file was in fact a .dll.a file instead. I honestly am not sure to link these (I tried linking it statically by typing "libpng12.dll.a" in the Linker Input setting through VS).
If I can go the .dll route for libpng12, how do I do this? Where is the file? How do I link it in VS?
Any help would be appreciated, as it seems there really isn't a whole lot of information on this. Either that, or I'm just not looking properly.
Look in the "projects" directory of the libpng distribution, and use one of the visual projects.
As mentioned above Look in the "projects" directory of the libpng distribution
Then make the adjustments outlined here
https://stackoverflow.com/a/38547948/293792
Which I note here for simplicities sake
(as stated there) adding two lib values to
Config -> Linker -> Input -> Additional Dependencies
these values are ucrt.lib;vcruntime.lib
Ensuring the build type is /MD
Allowed me to build these older versions, and fix that error on Windows 10 VS2015.
This link seems to have an installer for 1.2 for you:
http://gnuwin32.sourceforge.net/packages/libpng.htm
it's 32 bit. Not sure if that makes a difference for you.

How can I find out the dependencies and build rule used to build something in scons

I don't want to use scons --n, I want to see how something was built, not how it would be built now.
I presume its possible to use .sconsdblite somehow.
Has anyone done this?
The SCons man pages explains the --tree command line options that can be used to display the targets' dependency info.
The most basic way to use it is as follows:
# scons --tree=all
There are several different tree options explained therein, depending on your situation.
Additionally there are several --debug options available.
This might help do what you mention in your comments: --debug=explain
Print an explanation of precisely why scons is deciding to (re-)build
any targets. (Note: this does not print anything for targets that are
not rebuilt.)

How to get a configure script to look for a library

I'm trying to write a configure.ac file such that the resulting configure script searches for a library directory containing a given static library e.g. libsomething.a. How can I do this? At the moment I have it check just one location with:
AC_CHECK_FILE([/usr/local/lib/libsomething.a],[AC_SUBST(libsomething,"-L/usr/local/lib -lsomething")],[AC_SUBST(libcfitsio,'')])
But I want it to try and find it automatically. And if the library isn't in one of the default locations, I'd like configure to say that the library wasn't found and that a custom location can be specified with --use-something=path as is usually done. So I also need to then check if --use-something=path is provided. I'm pretty new at creating configure files, and the M4 documentation isn't very easy to follow, so would appreciate any help.
Thanks!
It's not the job of configure to search where libraries are installed. it should only make sure they are available to the linker. If the user installed them in a different location, he knows how to call ./configure CPPFLAGS=-I/the/location/include LDFLAGS=-L/the/location/lib so that the tools will find the library (this is explained in the --help output of configure and in the standard INSTALL file).
Also --with-package and --enable-package macros are not supposed to be used to specify paths, contrary to what many third-party macros will do. The GNU Coding Standards explicitly prohibit this usage:
Do not use a --with option to
specify the file name to use to find
certain files. That is outside the scope
of what --with options are for.
CPPFLAGS and LDFLAGS are already here to address the problem, so why redevelop and maintain another mechanism?
The best way to figure this out is to look at other autoconf macros that do something similar. Autoconf macros are an amalgam of Bourne shell script and M4 code, so they can literally solve any computable problem.
Here's a link to a macro I wrote for MySQL++ that does this: mysql++.m4.

Resources