'Already defined' linking error Problem with multiple .cu files

There must be a really obvious solution to this, but I’m not sure what it is. I’m using Jared’s build rule, and I can’t get a very simple project to compile. I have two .cu files.

mainfile.cu

#include <subfile.cu>

int main(int argv, char** argc)

{

	return 0;

}

subfile.cu

#ifndef SUBFILE_CU_H

#define SUBFILE_CU_H

#include <stdio.h>

void dummy()

{

	printf("this is a dummy");

}

#endif

This compiles fine, but when it goes to link it says that dummy is already defined in mainfile.obj. I know I’ve laid out multiple .cu files like this before, but I was editing some of the examples in the SDK. I haven’t used Jared’s build rule before. Anyone know what’s going on here?

thanks,

skiz

is subfile.cu excluded from build?
if not, it should be AFAIK

Ahhh … That fixed it. Thanks a lot!

-skiz