cmake - show command line for a test

Peter Kümmel syntheticpp at gmx.net
Sun Feb 12 20:54:55 CET 2006


Christian Ehrlicher wrote:

> for example getaddrinfo isn't found - don't know why. Simply look into
> CMakeErro.log and you'll see that some functions aren't found which
> normally are available on windows.
> 
> Christian

Yes, I also had this problem, there is a linker error.

The test code looks like this:

char getaddrinfo();

int main(int ac, char*av[])
{
  getaddrinfo();
  if(ac > 1000)
    {
    return *av[0];
    }
  return 0;
}


This works for C-linkage (as I understand it), where the correct declaration
is not required, just the name of the function.

But with the ms libraries this does not work, always
the linker can't  find the complete (with parameters) function, you
will see this when you test above program with the correct library.

The work around is to test for a prototype and then set the HAVE macro.

But the better way is to find a solution which solves the linker error,
if possible.

Peter









More information about the Kde-buildsystem mailing list