I tried to do a search, but found nothing. Whenever I try to compile a shared object and a test binary that references it, I get this error:
[root@hypervisor test-files]# ./test ./test: symbol lookup error: ./test-files.so: undefined symbol: stat [root@hypervisor test-files]#
After playing with her, I found that if I feed -Oto gcc at compile time, stat () will start working as expected. I was not able to find any signal on the Internet about why -O everything fixes the problem with the undefined character (or is it just masking the error and not fixing it?).
-O
In all likelihood, optimization caused the removal of unreachable code, completely eliminating the need for a character.
test-files.so, , C, ld . , , test-files.so , . , test, .
test-files.so
ld
test
, stat, dlopen().
stat
dlopen()
Source: https://habr.com/ru/post/1678294/More articles:How to get around the "Java heap heap" during the JAR assembly on travis-ci.org? - javaLogstash multiple inputs to multiple outputs - logstashПеремещение в другую систему сборки Linux, получение ошибки: undefined symbol: stat - cToolBar ControlTemplates, Missing Overflow Elements, and Orientation ToolBarTray - c #overriding the standard Eq definition for a specific template - haskellPandas join / merge / concat two DataFrames and merge rows of the same key / index - pythonCSS animation div with absolute positioning from left to 0 to right 0 - cssMongoose async / await find then edit and save? - node.jsNegation fill: currentColor - cssI want to change the background color of an HTML document by pressing enter - javascriptAll Articles