Compile a C library with Visual Studio 2010

后端 未结 1 1405
隐瞒了意图╮
隐瞒了意图╮ 2020-12-19 19:52

I got here a C library written by someone else, with a very nice way to compile it on a Mac and generate a ruby wrapper.

I am on Windows, and I need to generate a wr

相关标签:
1条回答
  • 2020-12-19 20:30

    In the version of the C language that's supported by Visual Studio 2010, there is no word inline. Only C++ has inline. I don't think inline became a part of C until the very latest version of the C standard (C11), which nobody supports yet.

    Instead, you should use the word __inline, which means the same thing. The underscores imply that this is an "extension," something that's not part of standard C.

    Alternatively, you could put #define inline __inline at the start of each file, or in a .h header file which is #included at the beginning. That would automatically translate the word inline to __inline each time it appears.

    (It's likely that the person who wrote that code was using a different compiler, one which chose to add inline without the underscores. It's still an "extension" because it's not part of Standard C.)

    0 讨论(0)
提交回复
热议问题