<div class="gmail_quote">On Mon, Mar 30, 2009 at 7:48 PM, Kermit Mei <span dir="ltr">&lt;<a href="mailto:kermit.mei@gmail.com">kermit.mei@gmail.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
I want to add the following program as a part of my project, but I don&#39;t<br>
konw how to manage it in CMake.<br>
<br>
I worte the following in my CMakeLists.txt:<br>
  FIND_LIBRARY(LIBWMM winmm)<br>
  ADD_EXECUTABLE(aplay WIN32 aplay.c)<br>
  TARGET_LINK_LIBRARIES(aplay ${LIBWMM})<br>
But it always told me that &quot;undefined reference to &#39;PlaySoundA@12&#39; &quot;.<br>
How can I solve it?</blockquote><div><br>Double check to make sure that winmm (and the MinGW implementation of this library) has that function in it.  You might also consider asking for help on a MinGW forum?<br> <br></div>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">

By the way, what&#39;s the meaning of -mwindows? Can I also use strip in<br>
CMake for optimization?</blockquote><div><br>This sounds like a MinGW thing.  If Google doesn&#39;t yield the answer you should check with the MinGW mailing lists.  Also double check with make VERBOSE=1 to make sure that you&#39;re actually passing -lwinmm and it&#39;s finding the library.<br>
<br>It looks like CPack has an option to strip binaries.<br><a href="http://www.cmake.org/Wiki/CMake:Packaging_With_CPack">http://www.cmake.org/Wiki/CMake:Packaging_With_CPack</a><br><br></div></div>-- <br>Philip Lowman<br>