<br><div class="gmail_quote">2009/3/23 Stephen Collyer <span dir="ltr">&lt;<a href="mailto:scollyer@netspinner.co.uk">scollyer@netspinner.co.uk</a>&gt;</span><br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
I&#39;m trying to build a fully static exe on Opensuse 11.1 against a static build of Qt 4.5, and<br>I&#39;m trying to link against a static QMySQL plugin.<br><br>I&#39;m getting a link error when I do so, and I suspect it&#39;s because I&#39;m not telling LINK_LIBRARIES how to link against the static plugin<br>

</blockquote></div><br>OK, I&#39;ve more-or-less sorted this out. I have added the following:<br><br>IF (NOT &quot;${BUILD_SHARED_LIBS}&quot;)<br>    SET(SQL_LIB_DIRS &quot;${QT_LIBRARY_DIR}/../plugins/sqldrivers&quot; &quot;/usr/lib/mysql&quot;)<br>
    SET(MYSQL_LIBS qsqlmysql mysqlclient)<br>ENDIF (NOT &quot;${BUILD_SHARED_LIBS}&quot;)<br><br>LINK_DIRECTORIES(${QT_LIBRARY_DIR} &quot;../plugins&quot; ${SQL_LIB_DIRS})<br><br>and have changed the exe linking as follows:<br>
<br>SET(PM_SRCS protocol_manager.cpp)<br>ADD_EXECUTABLE(protocol_manager_exe ${PM_SRCS})<br>TARGET_LINK_LIBRARIES(protocol_manager_exe ProtocolManager ClientCertificate Server HTTP IPCListener Comms Exceptions Support ${MYSQL_LIBS} ${QT_LIBRARIES})<br>
<br>However, I&#39;m not entirely happy as:<br><br>a) I&#39;ve hardcoded the relative path ../plugins/sqldrivers in the SQL_LIB_DIRS<br>b) I&#39;ve got an explicity reference to /usr/lib as well<br><br>Can anyone suggest how I can make this a bit more platform independent ?<br>
<br>Steve Collyer<br>