Cuda error: function has already been defined in another .cu.obj file

后端 未结 3 2126
眼角桃花
眼角桃花 2021-01-14 10:15

I am trying to compile a cuda project that someone sent me. Though the compile stage passes, the link stage is failing. Below is an example of the error:

Err         


        
3条回答
  •  粉色の甜心
    2021-01-14 10:58

    Had the same problem with a number of files, and was confused because the multiple definition problems usually are handled by guarding ala.

    # ifndef Function_name_Guard
    #define Function_name
    your code
    #endef % Function_name_Guard
    

    What worked was to instead omit the .cu files, and only keep the main file.

提交回复
热议问题