<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[LoadLibraryExA - Die angegebene Datei wurde nicht gefunden]]></title><description><![CDATA[<p>Ich habe ein Python Modul in C geschrieben und mit MinGW und den Distutils von Python übersetzt. Jetzt möchte ich es gerne importieren und bekomme folgendes:</p>
<pre><code>&gt;&gt;&gt; import tpytk.win32_wrap
# trying C:\PYTHON24\lib\site-packages\tpytk\win32_wrap.pyd
Traceback (most recent call last):
  File &quot;&lt;stdin&gt;&quot;, line 1, in ?
ImportError: DLL load failed: Die angegebene Datei wurde nicht gefunden.
&gt;&gt;&gt;
</code></pre>
<p>Ich hab Python mit dem Programm Dependency Walker gestartet und bekomme folgendes:</p>
<pre><code>GetProcAddress(0xBFF60000 [KERNEL32.DLL], &quot;InterlockedCompareExchange&quot;) called from &quot;PYTHON24.DLL&quot; at address 0x1E0A4FB4 and returned 0x83E6CC98.
LoadLibraryExA(&quot;C:\PYTHON24\lib\site-packages\tpytk\win32_wrap.pyd&quot;, 0x00000000, LOAD_WITH_ALTERED_SEARCH_PATH) called from &quot;PYTHON24.DLL&quot; at address 0x1E054705.
LoadLibraryExA(&quot;C:\PYTHON24\lib\site-packages\tpytk\win32_wrap.pyd&quot;, 0x00000000, LOAD_WITH_ALTERED_SEARCH_PATH) returned NULL. Error: Die angegebene Datei wurde nicht gefunden (2).
</code></pre>
<p>Das Problem ist, dass die Datei C:\PYTHON24\lib\site-packages\tpytk\win32_wrap.pyd existiert. Welche ursache kann also diese Fehlermeldung haben? .pyd sind .DLL Dateien, nur Python benennt sie als .pyd. Das ist sonst auch kein problem. Ich hab auch schon versucht die Datei in .DLL umzubennenen, mit dem selben Resultat.</p>
<p>Hier noch das Python modul:</p>
<pre><code class="language-cpp">#include &lt;Python.h&gt;
#include &quot;structmember.h&quot;

static PyMethodDef win32_wrap_module_methods[] = {
	{NULL, NULL, 0, NULL}
};

PyMODINIT_FUNC
initwin32_wrap(void) {
	PyObject *m, *d;
	PyObject *tmp;

	m = Py_InitModule( &quot;win32_wrap&quot;, win32_wrap_module_methods );
	d = PyModule_GetDict( m );

}
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/topic/118017/loadlibraryexa-die-angegebene-datei-wurde-nicht-gefunden</link><generator>RSS for Node</generator><lastBuildDate>Fri, 03 Jul 2026 18:29:38 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/118017.rss" rel="self" type="application/rss+xml"/><pubDate>Sat, 13 Aug 2005 19:34:27 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to LoadLibraryExA - Die angegebene Datei wurde nicht gefunden on Sat, 13 Aug 2005 19:34:27 GMT]]></title><description><![CDATA[<p>Ich habe ein Python Modul in C geschrieben und mit MinGW und den Distutils von Python übersetzt. Jetzt möchte ich es gerne importieren und bekomme folgendes:</p>
<pre><code>&gt;&gt;&gt; import tpytk.win32_wrap
# trying C:\PYTHON24\lib\site-packages\tpytk\win32_wrap.pyd
Traceback (most recent call last):
  File &quot;&lt;stdin&gt;&quot;, line 1, in ?
ImportError: DLL load failed: Die angegebene Datei wurde nicht gefunden.
&gt;&gt;&gt;
</code></pre>
<p>Ich hab Python mit dem Programm Dependency Walker gestartet und bekomme folgendes:</p>
<pre><code>GetProcAddress(0xBFF60000 [KERNEL32.DLL], &quot;InterlockedCompareExchange&quot;) called from &quot;PYTHON24.DLL&quot; at address 0x1E0A4FB4 and returned 0x83E6CC98.
LoadLibraryExA(&quot;C:\PYTHON24\lib\site-packages\tpytk\win32_wrap.pyd&quot;, 0x00000000, LOAD_WITH_ALTERED_SEARCH_PATH) called from &quot;PYTHON24.DLL&quot; at address 0x1E054705.
LoadLibraryExA(&quot;C:\PYTHON24\lib\site-packages\tpytk\win32_wrap.pyd&quot;, 0x00000000, LOAD_WITH_ALTERED_SEARCH_PATH) returned NULL. Error: Die angegebene Datei wurde nicht gefunden (2).
</code></pre>
<p>Das Problem ist, dass die Datei C:\PYTHON24\lib\site-packages\tpytk\win32_wrap.pyd existiert. Welche ursache kann also diese Fehlermeldung haben? .pyd sind .DLL Dateien, nur Python benennt sie als .pyd. Das ist sonst auch kein problem. Ich hab auch schon versucht die Datei in .DLL umzubennenen, mit dem selben Resultat.</p>
<p>Hier noch das Python modul:</p>
<pre><code class="language-cpp">#include &lt;Python.h&gt;
#include &quot;structmember.h&quot;

static PyMethodDef win32_wrap_module_methods[] = {
	{NULL, NULL, 0, NULL}
};

PyMODINIT_FUNC
initwin32_wrap(void) {
	PyObject *m, *d;
	PyObject *tmp;

	m = Py_InitModule( &quot;win32_wrap&quot;, win32_wrap_module_methods );
	d = PyModule_GetDict( m );

}
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/851709</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/851709</guid><dc:creator><![CDATA[[[global:guest]]]]></dc:creator><pubDate>Sat, 13 Aug 2005 19:34:27 GMT</pubDate></item><item><title><![CDATA[Reply to LoadLibraryExA - Die angegebene Datei wurde nicht gefunden on Sun, 14 Aug 2005 00:43:09 GMT]]></title><description><![CDATA[<p>Problem gelöst. Anscheinent arbeiten die Distutils nicht richtig. Ich hab die DLL jetzt mit dem MinGW dllwrap tool erstellt.</p>
<pre><code>dllwrap --dllname foo.pyd --driver-name gcc --def win32_wrap.def -o win32_wrap.pyd win32_wrap.o -s --entry _DllMain@12 --target=i386-mingw32 -LC:\Python24\Libs -lpython24
</code></pre>
<p>Es hatte also nichts mit der WinAPI zu tun, außer der irreführenden Fehlermeldung.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/851790</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/851790</guid><dc:creator><![CDATA[[[global:guest]]]]></dc:creator><pubDate>Sun, 14 Aug 2005 00:43:09 GMT</pubDate></item></channel></rss>