What can cause undefined symbols?
Chris Mahoney (1684) 2100 posts |
I’m trying to build a third-party module, which includes a C library and calls into some other libraries. I’m getting an “undefined symbols” error from Link and I’m not sure why. A simplified example:
Obviously unixlibzm is “known good” and definitely contains getpid. TCPIPLibs: is definitely defined correctly (if I misspell it then I get a different “file not found”-type of error). What could cause Link to not “see” symbols that definitely exist? I realise that this is a bit of a tricky question without seeing the actual “thirdpartylibzm” so if I we don’t get anywhere then I’ll try to make one of those “minimal code to replicate failure” thingies (that I can’t remember the proper name for!) Note that other modules build successfully, so it seems to be something specific to this one. If I try to build an Absolute instead of a Module then I get the same problem. And now I have to go to a five-hour meeting… wish me luck! |
Ron (2686) 63 posts |
Providing the code for getpid IS defined in the library and not just declared, Try swapping the order of the libraries around so it can see getpid earlier on. HTH |
Chris Mahoney (1684) 2100 posts |
I think I tried that, but I’m happy to give it another go.
Which, it turns out, isn’t for another hour! In case you’re wondering why I’m posting from a meeting :) |
Chris Mahoney (1684) 2100 posts |
I didn’t have any luck doing it the “proper” way, but I hacked my way around the problem by linking thirdpartylib.oz.* instead of thirdpartylibzm. It seems that Link just didn’t like something about the library (possibly the sheer number of files inside it; 361). |