definition of dllimport function not allowed

前端 未结 2 2003
面向向阳花
面向向阳花 2021-01-19 05:14

While compiling a C code, I\'m getting the following error:

c:\\users\\kbarman\\documents\\mser\\vlfeat-0.9.13-try\\mser\\stringop.c(71): error C2491: \'vl_s         


        
2条回答
  •  渐次进展
    2021-01-19 05:38

    As documentation states, dllimport function are not allowed to have a body right there.

    [...] functions can be declared as dllimports but not defined as dllimports.

    // function definition
    void __declspec(dllimport) funcB() {}   // C2491
    
    // function declaration
    void __declspec(dllimport) funcB();   // OK
    

提交回复
热议问题