scan-build: fails to link project

I have a C++ project with cmake as build-system. When I try to compile it with

‘scan-build make’

it fails with ‘ld returned 1 exit status’. But it works when I use

‘scan-build --use-cc=g++ make’

What might be causing that scan-build can not determine the right compiler/linker?

How can I fix it?

Kind regards,

Kai Harries

Hi, Kai. I haven't tried it, but scan-build usually wants you to use it to invoke your build system generator as well. So:

scan-build cmake
scan-build make

That may not be the issue here, though. What platform are you using? Does your project contain C++ files?


Hi Jordan,

you are right. I have prepended the call to cmake by scan-build as you recommended and now it is working as expected.

Many thanks,