简体   繁体   中英

Invalid MEX-file due to undefined symbol

I am trying to build MEX modules, but I am having runtime issues with undefined symbols. Here is the output

Invalid MEX-file '/home/glperez/issm/trunk-jpl/lib/TriMesh.mexa64':
/home/glperez/issm/trunk-jpl/lib/libISSMCore.so: undefined symbol: _ZN14ToolkitOptions14toolkitoptionsE

Error in triangle (line 40)
[elements,x,y,segments,segmentmarkers]=TriMesh(domainname,riftname,area);

Error in test101 (line 1)
md=triangle(model(),'../Exp/Square.exp',50000.);

Checking the symbols in 'libISSMCore.so' confirms the undefined symbol

$ nm ./lib/libISSMCore.so | grep 'toolkit'
U _ZN14ToolkitOptions14toolkitoptionsE

However, the symbol appears in 'TriMesh.mexa64':

$ nm ./lib/TriMesh.mexa64 | grep 'toolkit'
00000000002391b8 b _ZN14ToolkitOptions14toolkitoptionsE

As I understand it, the lowercase 'b' means that the symbol is in the uninitialized section and that it is local versus global.

Is the problem here have to do with the symbol being local, uninitialized or something else?

As I understand it, the lowercase 'b' means that the symbol is in the uninitialized section and that it is local

The symbol is local, and is in zero-initialized (aka BSS) section.

Yes, the problem is that it is local, ie no accessible outside of the TriMesh.mexa64 library.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM