Is it possible to make a static library (.lib) with inline function?

Asked

Viewed 31 times

0

Uso Visual Studio 2019 Community. I asked on the forum and received no answers.

I want to know if it is possible (if yes, how) in VC++ to declare (no body) a function or methods in a class in a ". h", to define in the ". cpp" and compile to ". lib" so that you have control of function properties, including inline and forceinline.

This is aimed at the benefits of advancing the body compilation with . lib, possibility of doing includes in ". cpp" without doing in ". h" not to appear in Intellisense and encapsulate internal compilation details and other things without the limitations. I found no means neither tening nor researching.

Can anyone answer me?

  • Note: I know that the most recommended is simply the default, let the compiler optimize as you want, but I want to know if I can use these features with this freedom.

  • My guess is that no, functions and inline methods belong to . h, the compiler treats almost like a macro. Doing this with binary code from an already compiled function is much harder, as this binary code assumes that it is "alone" within the stack frame and may be doing some optimization witchcraft.

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.