<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40"><head><meta http-equiv=Content-Type content="text/html; charset=utf-8"><meta name=Generator content="Microsoft Word 12 (filtered medium)"><!--[if !mso]><style>v\:* {behavior:url(#default#VML);}
o\:* {behavior:url(#default#VML);}
w\:* {behavior:url(#default#VML);}
.shape {behavior:url(#default#VML);}
</style><![endif]--><style><!--
/* Font Definitions */
@font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
        {font-family:Tahoma;
        panose-1:2 11 6 4 3 5 4 4 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Times New Roman","serif";}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:purple;
        text-decoration:underline;}
span.EmailStyle17
        {mso-style-type:personal;
        font-family:"Calibri","sans-serif";
        color:#1F497D;}
span.EmailStyle18
        {mso-style-type:personal;
        font-family:"Calibri","sans-serif";
        color:#1F497D;}
span.EmailStyle19
        {mso-style-type:personal-reply;
        font-family:"Calibri","sans-serif";
        color:#1F497D;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-size:10.0pt;}
@page WordSection1
        {size:8.5in 11.0in;
        margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
        {page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]--></head><body lang=EN-US link=blue vlink=purple><div class=WordSection1><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>Oh, sorry.. I missunderstood about the line 76. =D<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'><o:p> </o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>Ok, looking at your CMakeLists.txt, I see the ADD_SUBDIRECTORY(libctsim). I’m assuming there is a CMakeLists.txt in there which does the ADD_LIBRARY. The ADD_SUBDIRECTORY() calls are before you’re doing a bunch of ADD_DEFINITIONS(). The definitions you are setting up below are not going to apply to those subdirectories. Is it possible that the signature of the function is different in the library than in the opt_ctsim executable because of these definitions?<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'><o:p> </o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>On windows, I would suggest using ‘dumpbin.exe /LinkerMember’ to see the mangled signature of the functions in the library and compare them to the expected signature printed in the linker error for the executable (here’s a description I wrote about it: </span><a href="http://stackoverflow.com/questions/261377/lnk2001-error-when-compiling-apps-referencing-stlport-5-1-4-with-vc-2008/687185#687185">http://stackoverflow.com/questions/261377/lnk2001-error-when-compiling-apps-referencing-stlport-5-1-4-with-vc-2008/687185#687185</a> )<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>I’m not sure what the equivolent process would be for gcc if that is what you are using. Looks like it might be the programs ‘nm’ and ‘objdump’.<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'><o:p> </o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>You might try moving your ADD_SUBDIRECTORY() calls to right above ADD_EXECUTABLE and see if that allows the linking to work correctly.<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'><o:p> </o:p></span></p><p class=MsoNormal><b><span style='font-size:9.0pt;font-family:"Arial","sans-serif";color:#666666'>Aaron C. Meadows</span></b><span style='font-size:9.0pt;font-family:"Arial","sans-serif";color:#666666'> </span><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'><o:p></o:p></span></p><div><div style='border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0in 0in 0in'><p class=MsoNormal><b><span style='font-size:10.0pt;font-family:"Tahoma","sans-serif"'>From:</span></b><span style='font-size:10.0pt;font-family:"Tahoma","sans-serif"'> Leila Baghdadi [mailto:baghdadi@phenogenomics.ca] <br><b>Sent:</b> Thursday, June 23, 2011 1:33 PM<br><b>To:</b> Meadows, Aaron C.; cmake@cmake.org<br><b>Subject:</b> RE: [CMake] regarding linking functionality and overloading in cmake<o:p></o:p></span></p></div></div><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal style='margin-bottom:12.0pt'>yep that's how its defined. (note, this is not my code, it is backprojection code free for download at ctsim.org)<br><br>typedef double kfloat64;<br>typedef kfloat64** const ImageFileArrayConst;<br><br>the code has diversions between 32 and 64 bit, anyways, that's how it is defined.<br><br>Leila<o:p></o:p></p><div class=MsoNormal align=center style='text-align:center'><hr size=2 width="100%" align=center></div><p class=MsoNormal style='margin-bottom:12.0pt'><b>From: </b>aaron.meadows@thomsonreuters.com<br><b>Sent: </b>Thu, 6/23/2011 2:09pm<br><b>To: </b>Leila Baghdadi <baghdadi@phenogenomics.ca> ; cmake@cmake.org<br><b>Subject: </b>RE: [CMake] regarding linking functionality and overloading in cmake<o:p></o:p></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>Unless “ImageFileArrayConst” is a typedef for “double **”, there is not an ImageFile::statistics() function which takes a double** as the first parameter. (Line 288 and 296 have the two versions of ImageFile::statistics())</span><o:p></o:p></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'> </span><o:p></o:p></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>If you look in views.cpp at the function ImageFileView::OnProperties() function where it is calling the ImageFile::statistics() function, what is the type of the first parameter? Do you have an extra & on the front of a double* variable there?</span><o:p></o:p></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'> </span><o:p></o:p></p><p class=MsoNormal><b><span style='font-size:9.0pt;font-family:"Arial","sans-serif";color:#666666'>Aaron C. Meadows</span></b><span style='font-size:9.0pt;font-family:"Arial","sans-serif";color:#666666'> </span><o:p></o:p></p><div><div style='border:none;border-top:solid windowtext 1.0pt;padding:3.0pt 0in 0in 0in;border-color:-moz-use-text-color -moz-use-text-color'><p class=MsoNormal><b><span style='font-size:10.0pt;font-family:"Tahoma","sans-serif"'>From:</span></b><span style='font-size:10.0pt;font-family:"Tahoma","sans-serif"'> Leila Baghdadi [mailto:baghdadi@phenogenomics.ca] <br><b>Sent:</b> Thursday, June 23, 2011 12:56 PM<br><b>To:</b> Meadows, Aaron C.; cmake@cmake.org<br><b>Subject:</b> RE: [CMake] regarding linking functionality and overloading in cmake</span><o:p></o:p></p></div></div><p class=MsoNormal> <o:p></o:p></p><p class=MsoNormal>Hello<br><br>I have attached the CMakeLists.txt file (note, I commented the source in question line 76) and I get the following error, If I leave line 76 in, I get a clean build<br>Linking CXX executable opt_ctsim<br>CMakeFiles/opt_ctsim.dir/src/views.cpp.o: In function `ImageFileView::OnProperties(wxCommandEvent&)':<br>views.cpp:(.text+0x1bfd9): undefined reference to `ImageFile::statistics(double**, double&, double&, double&, double&, double&, double&) const'<br>views.cpp:(.text+0x1c57a): undefined reference to `ImageFile::statistics(double**, double&, double&, double&, double&, double&, double&) const'<br>collect2: ld returned 1 exit status<br><br>I am also attaching the source imagefile.cpp located in libctsim subdirectory.<br><br>thanks<o:p></o:p></p><div class=MsoNormal align=center style='text-align:center'><hr size=2 width="100%" align=center></div><p class=MsoNormal style='margin-bottom:12.0pt'><b>From: </b>aaron.meadows@thomsonreuters.com<br><b>Sent: </b>Thu, 6/23/2011 11:29am<br><b>To: </b>Leila Baghdadi <baghdadi@phenogenomics.ca> ; cmake@cmake.org<br><b>Subject: </b>RE: [CMake] regarding linking functionality and overloading in cmake<o:p></o:p></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>This sounds like poorly formed c++, not a CMake issue. Can you include your CMakeLists.txt, a copy of the error, and possibly a simple example which shows the problem?</span><o:p></o:p></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'> </span><o:p></o:p></p><p class=MsoNormal><b><span style='font-size:9.0pt;font-family:"Arial","sans-serif";color:#666666'>Aaron C. Meadows</span></b><span style='font-size:9.0pt;font-family:"Arial","sans-serif";color:#666666'> </span><o:p></o:p></p><div><div style='border:none;border-top:solid windowtext 1.0pt;padding:3.0pt 0in 0in 0in;border-color:-moz-use-text-color'><p class=MsoNormal><b><span style='font-size:10.0pt;font-family:"Tahoma","sans-serif"'>From:</span></b><span style='font-size:10.0pt;font-family:"Tahoma","sans-serif"'> cmake-bounces@cmake.org [mailto:cmake-bounces@cmake.org] <b>On Behalf Of </b>Leila Baghdadi<br><b>Sent:</b> Wednesday, June 22, 2011 3:57 PM<br><b>To:</b> cmake@cmake.org<br><b>Subject:</b> [CMake] regarding linking functionality and overloading in cmake</span><o:p></o:p></p></div></div><p class=MsoNormal> <o:p></o:p></p><p class=MsoNormal style='margin-bottom:12.0pt'>hi everyone,<br><br>I have been trying to use cmake to build ctsim(need to add my own code to it later) and finally managed to do it however I have difficulty understanding why my puny solution works!<br><br>I have 3 different directories (a,b,c) in ctsim , so I set up cmake files in each one and built liba.so and so on,<br><br>now I am trying to build the executable cstim by linking to the above three libraries and I kept getting an error, regarding an overloading function in directory a,<br><br>I thought that using TARGET_LINK_LIBRARIES(target a b c) would address that but instead I had to add the source code with the overloading function from directory a into the list of source codes for the ctsim executable,<br><br>does that make sense? <br><br>any thought <br><br>thanks<br><br>Leila<o:p></o:p></p></div></body></html>