phabrics / nme

Next-generation Machine Emulator: This is the OFFICIAL repo for the new tme and will be updated here.
http://phabrics.com
Other
9 stars 1 forks source link

inline causes undefined symbol #4

Closed phabrics closed 1 year ago

phabrics commented 1 year ago

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

phabrics commented 1 year ago

This is a duplicated of OSDN Ticket #47963. Copied here for posterity as OSDN seems to be dying.