Undefined symbol for external device function

Hi all,

consider this test code, which works fine:

__device__ void foo () {}
__global__ void bar() {
   foo();
}

When moving the implementation of foo into a different file, the compilation (using -c) fails:

extern __device__ void foo();
__global__ void bar() {
   foo();
}

The error message is ptxas fatal : Unresolved extern function '_Z3foov'.
The error does not occur if I change the global keyword to device.
In an old thread, I read the suggestion that you need to use extern "C", but this just changes the missing symbol from _Z3foov to foo.
Do I have misunderstanding about how device and global functions work together, or is this a bug?

Regards,
Christian