At 12:43 +0000 8/13/03, Miguel Cardenas wrote:
Hello list

For some strange reason `mysql_config --...` does not work. If try something
like

gcc -o progname `mysql_config --cflags` progname.c `mysql_config --libs`

(NOTE: "/usr/local/mysql/bin" is in the PATH var, mysql_config works when
invoked)

the compiler does not find the header files and the libraries... if I execute
the command by hand and paste the output to the gcc/g++ command line it
works, but not with the quotes `mysql...`

In a Makefile, I use these definitions:


# Use these if you have mysql_config
MYSQL_CONFIG = mysql_config
INCLUDES = ${shell $(MYSQL_CONFIG) --cflags}
LIBS = ${shell $(MYSQL_CONFIG) --libs}
EMBLIBS = ${shell $(MYSQL_CONFIG) --libmysqld-libs}

Then I refer to $(INCLUDES), $(LIBS), and $(EMBLIBS) as necessary.

${shell...} requires GNU make, I believe.


I can't run by hand mysql_config and paste the output to the gcc statement since it will be invoked from a Makefile, and don't want to paste the output directly into the Makefile since linked libs could vary from one version of mysql to another... what can I do? generated Makefile should work with any linux system without changes

I need to have a distribution Makefile working for ANY possible version of
mysql and mysql_config `quoted` does not give the compiler the right
parameters (don't know why).

Is there some way to let the system (linux x86) find the libraries (.a)
*without moving* them to a standard lib path? /etc/ld.so.conf does not work
since libraries are static, not shared...

Am using qmake (Qt) to generate the Makefile and need to make something like

-------------------------------------
TEMPLATE = app
TARGET = myapp

SOURCES = app.cpp
HEADERS = app.h

INCLUDEPATH += `mysql_config --cflags`

CONFIG += qt thread warn_on release
LIBS += `mysql_config --libs` lpthread -ldl -lvoodoo2
-------------------------------------

I've created a library that manages all mysql stuff I need, so can't use mysql
stuff included with Qt 'cos should change all my sources from my applications
already working... necesarily have to use my lib and generate the right
makefiles with qmake...

HELP!!!


-- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe: http://lists.mysql.com/[EMAIL PROTECTED]


--
Paul DuBois, Senior Technical Writer
Madison, Wisconsin, USA
MySQL AB, www.mysql.com

Are you MySQL certified? http://www.mysql.com/certification/


-- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe: http://lists.mysql.com/[EMAIL PROTECTED]



Reply via email to