<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<meta name="Generator" content="Microsoft Exchange Server">
<!-- converted from rtf -->
<style><!-- .EmailQuote { margin-left: 1pt; padding-left: 4pt; border-left: #800000 2px solid; } --></style>
</head>
<body>
<font face="Arial, sans-serif" size="2">
<div>Hi</div>
<div><font face="Times New Roman, serif" size="2"> </font></div>
<div>My C++ code consists of an executable and several shared libraries<font face="MS Mincho, monospace">.</font></div>
<div><font face="MS Mincho, monospace"> </font></div>
<div>With my CMake build files, I find that the executable fails to load the shared libraries ( the dlopen() call results in error ‘undefined symbol…’ ).</div>
<div><font face="Times New Roman, serif" size="2"> </font></div>
<div>The software works fine under our production build system that uses manually coded makefiles.</div>
<div><font face="Times New Roman, serif" size="2"> </font></div>
<div>I notice that the production system linker command invokes –fpic, while CMake uses –fPIC. I am wondering if that is the reason.</div>
<div> </div>
<div>I set the compile flags with:</div>
<div><font face="Times New Roman, serif" size="2"> </font></div>
<div>set( CMAKE_CXX_FLAGS_RELEASE "-O3 -DNDEBUG -Wall -m64" )</div>
<div><font face="Times New Roman, serif" size="2"> </font></div>
<div>How can I replace –fPIC with –fpic in CMake please?</div>
<div style="margin-top: 5pt; margin-bottom: 5pt; ">Best regards </div>
<div style="margin-top: 5pt; margin-bottom: 5pt; ">David </div>
<div><font face="Times New Roman, serif" size="2"> </font></div>
<div><font face="Times New Roman, serif" size="2"> </font></div>
<div><font face="Times New Roman, serif" size="2"> </font></div>
</font>
</body>
</html>