#83 Inappropriate gcc argument order in configure script

v1.0_(example)
closed
nobody
5
2014-10-24
2013-08-14
dvo
No

When running ./configure on Linux, I got the following error:


gcc -lQtGui -lQtCore -lssl -lcrypto -lltdl -DQT_SHARED -I/usr/include/qt4 -I/usr/include/qt4/QtGui -I/usr/include/qt4/QtCore -Wall -ggdb -O2 conftest.cpp -o conftest
/tmp/cc4M6W2C.o: In function main': /home/david/sys/software/xca-0.9.3/conftest.cpp:21: undefined reference toqVersion()'
/home/david/sys/software/xca-0.9.3/conftest.cpp:21: undefined reference to SSLeay_version' /home/david/sys/software/xca-0.9.3/conftest.cpp:31: undefined reference toqVersion()'
/home/david/sys/software/xca-0.9.3/conftest.cpp:33: undefined reference to `SSLeay_version'
collect2: ld returned 1 exit status

This is because in the call of gcc, the libraries are given before the .cpp source. The problem goes away replacing


echo "${CC} $LDIRS $LIBS $CF $CFLAGS ${LDFLAGS} conftest.cpp -o conftest${SUFFIX}" >conftest.log
if ${CC} $LIBS $LDIRS $CF $CFLAGS ${LDFLAGS} conftest.cpp -o conftest${SUFFIX} >> conftest.log 2>&1; then

by


echo "${CC} $LDIRS $CF $CFLAGS ${LDFLAGS} conftest.cpp $LIBS -o conftest${SUFFIX}" >conftest.log
if ${CC} $LDIRS $CF $CFLAGS ${LDFLAGS} conftest.cpp $LIBS -o conftest${SUFFIX} >> conftest.log 2>&1; then

Discussion

  • Christian Hohnstaedt

    • status: open --> closed
     
  • Christian Hohnstaedt

    Fixed with xca 1.0.0

    commit 155d25a6f02ce40ff18698ae33f5dda42410530a
    Author: Christian Hohnstaedt chohnstaedt@innominate.com
    Date: Wed Nov 20 07:20:26 2013 +0100

    SF Bug #83 Inappropriate gcc argument order in configure script
    
    Change argument list as proposed by "dvo"
    
     

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks