Menu

#1502 [VIDEO] inline functions not generate into object file.

v3.6
closed-fixed
dqh
None
2021-12-30
2021-07-12
No

Hello,
after some time, I updated my sources from repository and I tried to build them with my projects made for Visual Studio. Unfortunately, during linking, these messages appear:

render1x2.obj : error LNK2001: unresolved external symbol _render_solid_line
render1x2.obj : error LNK2001: unresolved external symbol _render_source_line
render2x4.obj : error LNK2001: unresolved external symbol _render_solid_line_2x
render2x4.obj : error LNK2001: unresolved external symbol _render_source_line_2x

These 4 functions are implemented into vice\src\video\render-common.c and they are prefixed by "inline" keyword. As result, I verified that render-common.obj is empty and that's why they are not found when doing the link stage. I did myself a quick fix by removing those "inline" keyword from the functions, inside vice\src\video\render-common.c, and the build process completed successfully.
I do not clear to me the reason because they are declared in that way, since render-common.c is not included into any file but it is compiled separately.
However, if I understood correctly, it would be better to remove those "inline" keywords.

Sincerely.

Discussion

  • gpz

    gpz - 2021-07-12

    However, if I understood correctly, it would be better to remove those "inline" keywords.

    certainly not - we want those functions to be inline.

    I am not sure if putting those into a seperate compilation unit is the right thing to do - maybe they must be moved into the .h file, or the .c file included by the renderers

     
  • gpz

    gpz - 2021-07-12
    • assigned_to: dqh
     
  • dqh

    dqh - 2021-07-12
    • status: open --> pending-fixed
     
  • dqh

    dqh - 2021-07-12

    Should be fixed in r40344 - please test and let us know. (don't try to compile render-common.c anymore, it's it's now #included within render-common.h )

     
    • Greg King

      Greg King - 2021-07-13

      (Don't try to compile "render-common.c" anymore, it's now #included within "render-common.h".)

      That causes a recursive #include of "render-common.h".

      Here is a better fix:

      1. Move the inline function definitions into the header, itself.
      2. Delete "render-common.c".
      3. Declare those functions as static inline.
      4. Remove the unneeded #include "video.h".
       
      • dqh

        dqh - 2021-07-13

        "better" for what reason? Yes - i forgot to remove the #include but the standard ifdef header guard prevents recursion. It's c code, i prefer it to live in a .c file.

         
  • Frederic bezies

    Frederic bezies - 2021-07-13

    Could it be related to bug #1503?

     

    Last edit: Frederic bezies 2021-07-13
    • Carlo Bramini

      Carlo Bramini - 2021-07-13

      Yes, it seems to me that's the same thing.

       
  • Carlo Bramini

    Carlo Bramini - 2021-07-14

    This bug is fixed for me and it could be closed. Thanks.

     
  • dqh

    dqh - 2021-07-18
    • status: pending-fixed --> closed-fixed
     

Log in to post a comment.

MongoDB Logo MongoDB