<div dir="ltr"><div><div>Thanks! I found the problem: I needed to add CMAKE_DL_LIBS to another static library that the main exe was linking to.<br></div>Now this link error is gone.<br><br><div><div><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Mar 1, 2016 at 9:55 AM, J. Caleb Wherry <span dir="ltr"><<a href="mailto:calebwherry@gmail.com" target="_blank">calebwherry@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div>That link looks fine to me. You might want to verify that the CMAKE_DL_LIBS variable actually contains what it should on your system (or a least contains what it should right before using it). </div><div><br></div><div>You could explicitly add the "-dl" to that link statement and see if that works. That's what that variable should contain anyways on Linux boxes. </div><div><br></div><div>-Caleb</div><div><br></div>(Pasting off list response below)<div><br></div><div><span class=""><div><div style="min-height:506px"><div style="min-height:506px"><div dir="ltr"><div dir="ltr"><div><div><div><font size="2"><span style="background-color:rgba(255,255,255,0)">Thanks, Caleb. Are you saying that I need to add "-ldl" link lib in addition to ${CMAKE_DL_LIBS} ?<br><br><br>My CMake file is here: <br><br><a href="https://github.com/GrokImageCompression/opendcp/blob/master/cli/CMakeLists.txt" target="_blank">https://github.com/GrokImageCompression/opendcp/blob/master/cli/CMakeLists.txt</a><br><br></span></font></div><font size="2"><span style="background-color:rgba(255,255,255,0)">and the lines for the exe that is not linking are found here:<br><br>TARGET_LINK_LIBRARIES(opendcp_j2k ${CMAKE_DL_LIBS} ${OPENDCP_LIB} )<br><br><br></span></font></div><font size="2"><span style="background-color:rgba(255,255,255,0)">This is an open source proj, by the way. I can send you a few short lines about how to build on Ubuntu, if you are interested.<br><br></span></font></div><font size="2"><span style="background-color:rgba(255,255,255,0)">Thanks very much for your help.</span></font><div style="clear:both"></div></div></div></div></div></div><div style="clear:both"></div><div><div style="min-height:58px"><div style="min-height:58px"><div dir="ltr"><font color="#000000" size="2"><span style="background-color:rgba(255,255,255,0)"><br><br></span></font><div style="clear:both"></div></div></div></div></div><div style="clear:both"></div><div><div style="min-height:0px"><div style="min-height:0px"><div dir="ltr"><div style="clear:both"></div></div></div></div></div><div style="clear:both"></div><div><div style="min-height:80px"><div style="min-height:80px"><div dir="ltr"><font color="#000000" size="2"><span style="background-color:rgba(255,255,255,0)">Aaron</span></font></div></div></div></div><br></span><span class="">On Tuesday, March 1, 2016, Aaron Boxer <<a href="mailto:boxerab@gmail.com" target="_blank">boxerab@gmail.com</a>> wrote:<br></span><div><div class="h5"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Mar 1, 2016 at 9:06 AM, Aaron Boxer <span dir="ltr"><<a>boxerab@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div><div>Hello!<br></div>I have a CMAKE project that creates an executable that links with a static lib<br></div><div>from a second CMAKE project. The static lib requires the dlopen and dlclose<br></div><div>symbols.<br><br></div><div>So, when I link the first project, I add ${CMAKE_DL_LIBS} to the CMake file.<br><br></div><div>However, I still get an error about "undefined reference to symbol "dlclose...."<br></div></div></blockquote><div><br></div><div>The error states: "missing DSO from command line"<br><br></div><div>Also, the second CMAKE project also contains executables that link with the static<br></div><div>library, and they link with no problem.<br><br><br></div><div> <br></div></div><br></div></div>
</blockquote></div></div></div><br><div class="HOEnZb"><div class="h5"><br>-- <br>Sent from my iPhone 4s<br>
</div></div></blockquote></div><br></div></div></div></div></div>