CUDA linker error: undefined reference to main
I'm trying to compile a CUDA program in linux and I get the following linker error:

/usr/lib/gcc/x86_64-redhat-linux/4.4.4/../../../../lib64/crt1.o: In function `_start':
(.text+0x20): undefined reference to `main'
collect2: ld returned 1 exit status

This is my Makefile:

    mtrand.o : mtrand/mtrand.cpp
        nvcc -I"./mtrand" -O2 -c mtrand/mtrand.cpp

    CUDAMCMLrng.o : CUDAMCMLrng.cu
        nvcc --use_fast_math -O2 -c CUDAMCMLrng.cu

    kernel.o : CUDAMCMLrng.o kernel.cu
        nvcc --use_fast_math -O2 -c kernel.cu

    main.o : mtrand.o CUDAMCMLrng.o kernel.o main.cu
        nvcc --use_fast_math -O2 -Xcompiler "-fopenmp -Wall" -c main.cu

    lab : main.o mtrand.o CUDAMCMLrng.o kernel.o
        nvcc -lgomp -o lab main.o mtrand.o CUDAMCMLrng.o kernel.o


The main function is in the main.cu file but for some reason the linker is not seeing it.
Could anyone please tell me what am I doing wrong?

Thanks!
CUDA linker error: undefined reference to main
===

I'm trying to compile a CUDA program in linux and I get the following linker error:

/usr/lib/gcc/x86_64-redhat-linux/4.4.4/../../../../lib64/crt1.o: In function `_start':
(.text+0x20): undefined reference to `main'
collect2: ld returned 1 exit status

This is my Makefile:

    mtrand.o : mtrand/mtrand.cpp
        nvcc -I"./mtrand" -O2 -c mtrand/mtrand.cpp

    CUDAMCMLrng.o : CUDAMCMLrng.cu
        nvcc --use_fast_math -O2 -c CUDAMCMLrng.cu

    kernel.o : CUDAMCMLrng.o kernel.cu
        nvcc --use_fast_math -O2 -c kernel.cu

    main.o : mtrand.o CUDAMCMLrng.o kernel.o main.cu
        nvcc --use_fast_math -O2 -Xcompiler "-fopenmp -Wall" -c main.cu

    lab : main.o mtrand.o CUDAMCMLrng.o kernel.o
        nvcc -lgomp -o lab main.o mtrand.o CUDAMCMLrng.o kernel.o


The main function is in the main.cu file but for some reason the linker is not seeing it.
Could anyone please tell me what am I doing wrong?

Thanks!