<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">Unfortunately, the error reporting isn't very good when LLVM tries to load a library (inside the JIT) and fails.<div class=""><br class=""></div><div class="">This is probably worth reporting as a bug. I'm not sure offhand and actually investigating this currently requires digging in to what is actually happening under the covers between the Swift importer and the LLVM JIT.</div><div class=""><br class=""></div><div class=""> - Daniel</div><div class=""><br class=""></div><div class=""><div><blockquote type="cite" class=""><div class="">On May 25, 2016, at 12:38 PM, bhargav gurlanka via swift-build-dev <<a href="mailto:swift-build-dev@swift.org" class="">swift-build-dev@swift.org</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div dir="ltr" class=""><div class="">Hi,</div><div class=""><br class=""></div><div class="">I have a swift package with following layout:</div><div class=""><div class=""><font face="monospace, monospace" class="">.</font></div><div class=""><font face="monospace, monospace" class="">├── Package.swift</font></div><div class=""><font face="monospace, monospace" class="">├── Sources</font></div><div class=""><font face="monospace, monospace" class="">│ ├── BarCModule</font></div><div class=""><font face="monospace, monospace" class="">│ │ ├── Bar.c</font></div><div class=""><font face="monospace, monospace" class="">│ │ └── include</font></div><div class=""><font face="monospace, monospace" class="">│ │ └── Bar.h</font></div><div class=""><font face="monospace, monospace" class="">│ └── MyApp</font></div><div class=""><font face="monospace, monospace" class="">│ └── main.swift</font></div><div class=""><font face="monospace, monospace" class="">└── Tests</font></div></div><div class=""><font face="monospace, monospace" class=""><br class=""></font></div><div class=""><div class="">After running <font face="monospace, monospace" class="">swift build</font>, I can see <font face="monospace, monospace" class="">libBarCModule.so</font> under <font face="monospace, monospace" class="">.build/debug</font>. How can I use this library in REPL?</div><div class=""><br class=""></div><div class="">I've tried:</div><div class=""><br class=""></div><div class=""><font face="monospace, monospace" class="">$ swift -I.build/debug -L.build/debug -lBarCModule<br class=""></font></div><div class=""><font face="monospace, monospace" class="">$ LD_LIBRARY_PATH=.build/debug swift -I.build/debug -L.build/debug -lBarCModule</font><br class=""></div><div class=""><br class=""></div><div class="">But in both cases, I couldn't call a function defined inside my C Module.</div><div class=""><div class=""><font face="monospace, monospace" class=""><br class=""></font></div><div class=""><font face="monospace, monospace" class="">1> import BarCModule</font></div><div class=""><font face="monospace, monospace" class="">2> say_hi</font></div><div class=""><font face="monospace, monospace" class="">error: Couldn't lookup symbols:</font></div><div class=""><font face="monospace, monospace" class=""> _say_hi</font></div></div><div class=""><br class=""></div><div class=""><br class=""></div><div class=""><br class=""></div><div class=""><br class=""></div><div class="">Regards,</div><div class="">Bhargav Gurlanka</div><div class=""></div></div></div>
_______________________________________________<br class="">swift-build-dev mailing list<br class=""><a href="mailto:swift-build-dev@swift.org" class="">swift-build-dev@swift.org</a><br class="">https://lists.swift.org/mailman/listinfo/swift-build-dev<br class=""></div></blockquote></div><br class=""></div></body></html>