【发布时间】:2013-10-02 16:28:15
【问题描述】:
我在同一个目录下有3个文件:
hellomake.cu
#include<hellofunc.h>
int main(){
myPrintHelloMake();
return 0;
}
hellofunc.c
#include<stdio.h>
#include<stdlib.h>
void myPrintHelloMake(void){
printf("Hello dummy!\n");
return;
}
hellofunc.h
void myPrintHelloMake(void)
生成文件
CC=/usr/local/cuda-5.5/bin/nvcc
CFLAGS=-I.
hellomake: hellomake.cu hellofunc.c
$(CC) -o hellomake hellomake.cu hellofunc.c -I.
但是当我通过终端运行时,它会打印出来:
/usr/local/cuda-5.5/bin/nvcc -o hellomake hellomake.cu hellofunc.c -I.
/tmp/tmpxft_000013bf_00000000-14_hellomake.o:在函数main':
tmpxft_000013bf_00000000-3_hellomake.cudafe1.cpp:(.text+0x5): undefined reference tomyPrintHelloMake()'
collect2: ld 返回 1 个退出状态
make: * [hellomake] 错误 1
可能是什么问题?
【问题讨论】: