<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
</head>
<body text="#000000" bgcolor="#ffffff">
On 09/06/09 11:22, Eric Noulard wrote:
<blockquote
cite="mid:cbe23c50906091122h741bf757occ472232f3c622e5@mail.gmail.com"
type="cite">
<pre wrap="">.2009/6/10 Ángel Alonso <a class="moz-txt-link-rfc2396E" href="mailto:feler@archlinux.us"><feler@archlinux.us></a>:
</pre>
<blockquote type="cite">
<pre wrap="">Hi,
I'm using cmake for a project that embed Python in C.
For include the Python libs i use: include(FindPythonLibs)
</pre>
</blockquote>
<pre wrap=""><!---->
One usually do:
find_package(PythonLibs)
instead of:
include(FindPythonLibs)
</pre>
<blockquote type="cite">
<pre wrap="">But compiling, I get this errors:
/usr/lib/python2.6/config/libpython2.6.a(posixmodule.o): In function
`posix_tmpnam':
(.text+0x8f4): warning: the use of `tmpnam_r' is dangerous, better use
</pre>
</blockquote>
<pre wrap=""><!---->[...]
include(FindPythonLibs) may not be enough:
you seem to be missing something like:
target_link_library(<your_target> ${PYTHON_LIBRARIES})
[...]
</pre>
<blockquote type="cite">
<pre wrap="">I also try include(FindThreads) but the problem persist.
</pre>
</blockquote>
<pre wrap=""><!---->
Same for FindThreads.
find_package(Threads)
however I dont' know that one works because the FindThreads.cmake
module does not seem to define THREADS_LIBRARIES
in order for you to
target_link_library(<your_target> ${THREADS_LIBRARIES})
May be the author of FindThreads may help us with the usage of this module?
</pre>
<blockquote type="cite">
<pre wrap="">I think that is a problem of cmake, because in other tests that I made (with
a simple Makefile, not cmake) it works.
</pre>
</blockquote>
<pre wrap=""><!---->
compare the link command used by CMake and te one you use in your makefile.
make VERBOSE=1
with CMake generated makefile should show you the full link line.
</pre>
</blockquote>
Thanks for your help,<br>
<br>
I did what you said, and it works! I only had to link lib pthreads and
lib util.<br>
<br>
Cheers<br>
</body>
</html>