任务单 #47963

inline causes undefined symbol

开放日期: 2023-04-28 23:50 最后更新: 2023-05-02 14:44

报告人:
属主:
(无)
类型:
状态:
关闭
组件:
(无)
里程碑:
(无)
优先:
5 - Medium
严重性:
5 - Medium
处理结果:
文件:

Details

https://stackoverflow.com/questions/16245521/c99-inline-function-in-c-file/16245669#16245669

inline is only a hint such that the compiler doesn't complain about doubly defined symbols. It doesn't guarantee that a function is inlined, nor actually that a symbol is generated, if it is needed. To force the generation of a symbol you'd have to add a sort of instantiation after the inline definition:

int func(int i);

In this case you get:

tmesh> /opt/tme/bin/tmesh: symbol lookup error: /opt/tme/lib/tme/tme_host_gtk.so.0: undefined symbol: _tme_scanline_pad

To fix this change gtk-display.c to include the function prototype after the inline from gtk-display.h

/* includes: */
#include "gtk-display.h"
unsigned int _tme_scanline_pad(int bpl);
#include <stdlib.h>

任务单历史 (3/5 Histories)

2023-04-28 23:50 Updated by: ambie
  • New Ticket "inline causes undefined symbol" created
2023-04-30 08:24 Updated by: phabrics
评论

That would be a problem. It must have been an artifact of factoring out the common display code into display.c. I will just instantiate it in display.c since it is shared by all of the graphical front-end hosts (gtk, sdl, vnc). The common code among them should all be in display.c.

2023-05-01 03:23 Updated by: ambie
评论

The update to the AUR PKGBUILD resolved this issue for me.

2023-05-01 06:44 Updated by: phabrics
评论

That's great! I wasn't sure it would work as I couldn't reproduce it. The link you provided indicated that it should and the gcc doc seemed to concur. I will close this ticket after it is checked in to repo.

(Edited, 2023-05-01 06:47 Updated by: phabrics)
2023-05-02 14:44 Updated by: phabrics
  • 状态 Update from 开启 to 关闭

Attachment File List

No attachments

编辑

You are not logged in. I you are not logged in, your comment will be treated as an anonymous post. » 登录名