Alexandre Oliva writes:
 > On Apr  5, 2000, F Labrosse <[EMAIL PROTECTED]> wrote:
 > 
 > > Is it possible to test for a library using $CXX instead of $CC?
 > 
 > This is an `autoconf', not `automake', question.  See the `Language
 > Choice' node in the autoconf manual.
 > 

Seen it.  Thanks.

No I have the following problem.  When I check for qt with:

    AC_CHECK_LIB(qt, main,
      AC_DEFINE(WITH_QT)
      CPPFLAGS="$CPPFLAGS -I$qtpath/include"
      LIBS="$LIBS -L$qtpath/lib -lqt",
      AC_MSG_ERROR([qt cannot be found in $qtpath]),
      -L$qtpath/lib)

The following program is generated:

#line 3201 "configure"
#include "confdefs.h"

int main() {
main()
; return 0; }

This works just fine with g++, but CC (under Solaris) complains:

"configure", line 3205: Error: Cannot have a recursive call of main().

So I try to test for qt with a qt function: const char * qVersion ():

    AC_CHECK_LIB(qt, qVersion,
      AC_DEFINE(WITH_QT)
      CPPFLAGS="$CPPFLAGS -I$qtpath/include"
      LIBS="$LIBS -L$qtpath/lib -lqt",
      AC_MSG_ERROR([qt cannot be found in $qtpath]),
      -L$qtpath/lib)

Here is the generated program:

#line 3201 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error.  */
#ifdef __cplusplus
extern "C"
#endif
/* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply.  */
char qVersion();

int main() {
qVersion()
; return 0; }

Of course, this does not compile because of the prototype of qVersion().

What shall I do?

TIA,

Fred

P.S.  Is that OK to ask questions about autoconf on that list?

Reply via email to