<?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[Dll Fehler]]></title><description><![CDATA[<p>Hoi, ich will grad kurz ne kleine Dll schreiben und kriege da dauernd nicht aufgelöste externe, obwohl das eigentlich nicht sein sollte, ein kleines minimal snippet:</p>
<p>main.h:</p>
<pre><code>#ifdef MAIN_EXPORTS
#define MAIN_API __declspec(dllexport) 
#else
#define MAIN_API __declspec(dllimport) 
#endif
#include &lt;iostream&gt;

namespace CurlDll
{

    class CallHost
    {
    public: 
        static MAIN_API std::string callUrl(std::string pUrl, std::string pProxy); 
		static MAIN_API void Try(); 
    };
}
</code></pre>
<p>main.cpp</p>
<pre><code>#include &quot;main.h&quot;
#include &lt;Windows.h&gt;
#include &lt;curl/curl.h&gt;

namespace CurlDll
{
	std::string CallHost::callUrl(std::string pUrl, std::string pProxy)
    {
		CURL *curl;
		CURLcode res;
		curl = curl_easy_init();
		if(curl) 
		{
			curl_easy_setopt(curl, CURLOPT_URL, &quot;http://example.com&quot;);

			curl_easy_setopt(curl, CURLOPT_FOLLOWLOCATION, 1L);

			res = curl_easy_perform(curl);

			if(res != CURLE_OK)
				fprintf(stderr, &quot;curl_easy_perform() failed: %s\n&quot;,
						curl_easy_strerror(res));

			curl_easy_cleanup(curl);
		}
        return &quot;test&quot;;
    }
	void CallHost::Try()
    {
		MessageBox(0,&quot;lololowwwwwwwwwwwl&quot;, &quot;wqgqwwwwwgq&quot;, MB_OK |MB_ICONINFORMATION);
    }
}
</code></pre>
<p>Spätestens beim curl Kram rastet der compiler komplett aus und wirft 52 unaufgelöste externe, aber wenn man den Curl Kram weglässt und nur die Try Methode anwendet kommt auch:<br />
Fehler 4 error LNK1120: 1 nicht aufgelöste Externe<br />
Fehler 3 error LNK2001: Nicht aufgelöstes externes Symbol &quot;__imp__MessageBoxA@16&quot;.</p>
<p>Sry aber ich steh grad etwas aufm Schlauch, ist auch ehrlich gesagt das erste mal, dass ich eine Dll mache, die einfach nur ein paar Funktionen bereitstellen soll.</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/326220/dll-fehler</link><generator>RSS for Node</generator><lastBuildDate>Sat, 11 Jul 2026 06:20:08 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/326220.rss" rel="self" type="application/rss+xml"/><pubDate>Sat, 07 Jun 2014 01:06:06 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Dll Fehler on Sat, 07 Jun 2014 01:06:06 GMT]]></title><description><![CDATA[<p>Hoi, ich will grad kurz ne kleine Dll schreiben und kriege da dauernd nicht aufgelöste externe, obwohl das eigentlich nicht sein sollte, ein kleines minimal snippet:</p>
<p>main.h:</p>
<pre><code>#ifdef MAIN_EXPORTS
#define MAIN_API __declspec(dllexport) 
#else
#define MAIN_API __declspec(dllimport) 
#endif
#include &lt;iostream&gt;

namespace CurlDll
{

    class CallHost
    {
    public: 
        static MAIN_API std::string callUrl(std::string pUrl, std::string pProxy); 
		static MAIN_API void Try(); 
    };
}
</code></pre>
<p>main.cpp</p>
<pre><code>#include &quot;main.h&quot;
#include &lt;Windows.h&gt;
#include &lt;curl/curl.h&gt;

namespace CurlDll
{
	std::string CallHost::callUrl(std::string pUrl, std::string pProxy)
    {
		CURL *curl;
		CURLcode res;
		curl = curl_easy_init();
		if(curl) 
		{
			curl_easy_setopt(curl, CURLOPT_URL, &quot;http://example.com&quot;);

			curl_easy_setopt(curl, CURLOPT_FOLLOWLOCATION, 1L);

			res = curl_easy_perform(curl);

			if(res != CURLE_OK)
				fprintf(stderr, &quot;curl_easy_perform() failed: %s\n&quot;,
						curl_easy_strerror(res));

			curl_easy_cleanup(curl);
		}
        return &quot;test&quot;;
    }
	void CallHost::Try()
    {
		MessageBox(0,&quot;lololowwwwwwwwwwwl&quot;, &quot;wqgqwwwwwgq&quot;, MB_OK |MB_ICONINFORMATION);
    }
}
</code></pre>
<p>Spätestens beim curl Kram rastet der compiler komplett aus und wirft 52 unaufgelöste externe, aber wenn man den Curl Kram weglässt und nur die Try Methode anwendet kommt auch:<br />
Fehler 4 error LNK1120: 1 nicht aufgelöste Externe<br />
Fehler 3 error LNK2001: Nicht aufgelöstes externes Symbol &quot;__imp__MessageBoxA@16&quot;.</p>
<p>Sry aber ich steh grad etwas aufm Schlauch, ist auch ehrlich gesagt das erste mal, dass ich eine Dll mache, die einfach nur ein paar Funktionen bereitstellen soll.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2402833</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2402833</guid><dc:creator><![CDATA[Etix]]></dc:creator><pubDate>Sat, 07 Jun 2014 01:06:06 GMT</pubDate></item><item><title><![CDATA[Reply to Dll Fehler on Sat, 07 Jun 2014 02:04:11 GMT]]></title><description><![CDATA[<p>Du musst dem Linker sagen dass er gegen die &quot;User32.lib&quot; linken soll.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2402835</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2402835</guid><dc:creator><![CDATA[DarkShadow44]]></dc:creator><pubDate>Sat, 07 Jun 2014 02:04:11 GMT</pubDate></item><item><title><![CDATA[Reply to Dll Fehler on Sat, 07 Jun 2014 09:08:08 GMT]]></title><description><![CDATA[<p>Ah war wohl ein Problem mit der einen Solution, in der neuen gings, user32 sollte ja auch standardmäßig drin sein^^</p>
<p>Aber hast du vil. noch ne Idee warum der Libcurl Kram auch linker error´s throwt? Die verlinkung in eingabe und include ist definitiv richtig und funktioniert in nem executable Projekt wunderbar. Ist auch static gelinkt <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f62e.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--face_with_open_mouth"
      title=":O"
      alt="😮"
    /></p>
]]></description><link>https://www.c-plusplus.net/forum/post/2402859</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2402859</guid><dc:creator><![CDATA[Etix]]></dc:creator><pubDate>Sat, 07 Jun 2014 09:08:08 GMT</pubDate></item><item><title><![CDATA[Reply to Dll Fehler on Sat, 07 Jun 2014 11:17:02 GMT]]></title><description><![CDATA[<p>Schön, dass du die Namen der fehlenden Funktionen verschweigst! Da können wir endlich mal wieder raten.</p>
<p>Binde die fehlende Bibliothek dazu. 32 und 64 Bit lassen sich nicht mischen!</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2402870</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2402870</guid><dc:creator><![CDATA[manni66]]></dc:creator><pubDate>Sat, 07 Jun 2014 11:17:02 GMT</pubDate></item><item><title><![CDATA[Reply to Dll Fehler on Sat, 07 Jun 2014 15:03:39 GMT]]></title><description><![CDATA[<p>Sry^^</p>
<p>Projekt ist 32 bit, die Lib´s auch, wie gesagt, funktioniert mit den gleichen includes und links in nem anderen executable Projekt ganz wunderbar.</p>
<p>mein Code atm:</p>
<p>main.h</p>
<pre><code>#ifdef MAIN_EXPORTS 
#define MAIN_API __declspec(dllexport) 
#else 
#define MAIN_API __declspec(dllimport) 
#endif 
#include &lt;iostream&gt; 

namespace CurlDll 
{ 

    class CallHost 
    { 
    public: 
        static MAIN_API void Try(); 
    }; 
}
</code></pre>
<pre><code>#include &quot;main.h&quot; 
#include &lt;Windows.h&gt; 
#include &lt;curlpp/cURLpp.hpp&gt;
#include &lt;curlpp/Easy.hpp&gt;
#include &lt;curlpp/Info.hpp&gt;
#include &lt;curlpp/Options.hpp&gt;  
  #include &lt;curlpp/Exception.hpp&gt;

namespace CurlDll 
{ 

    void CallHost::Try() 
    { 
		curlpp::Easy request;
		request.setOpt(new curlpp::options::UserAgent(&quot;Mozilla/4.0&quot;));
		request.setOpt(new curlpp::options::AutoReferer(true));
		request.setOpt(new curlpp::options::FollowLocation(true));
		request.setOpt(new curlpp::options::Url(&quot;http://xml.utrace.de&quot;));
		request.perform();
        MessageBox(0,&quot;lololowwwwwwwwwwwl&quot;, &quot;wqgqwwwwwgq&quot;, MB_OK |MB_ICONINFORMATION); 
    } 
}	
BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason)
{return 1;}
</code></pre>
<p>Ich kriege 47 Fehler mit 26 nicht aufgelösten externen (ohne den Curl Kram klappts jetzt also liegt definitiv daran)</p>
<p>Fehler 2 error LNK2001: Nicht aufgelöstes externes Symbol &quot;__imp__WSAStartup@8&quot;.</p>
<p>Fehler 11 error LNK2001: Nicht aufgelöstes externes Symbol &quot;__imp__WSAGetLastError@0&quot;.</p>
<p>Fehler 33 error LNK2001: Nicht aufgelöstes externes Symbol &quot;__imp__setsockopt@20&quot;.</p>
<p>usw. und so fort, brauch ich jetzt glaub ich nicht alle rauskopieren^^</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2402900</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2402900</guid><dc:creator><![CDATA[Etix]]></dc:creator><pubDate>Sat, 07 Jun 2014 15:03:39 GMT</pubDate></item><item><title><![CDATA[Reply to Dll Fehler on Sat, 07 Jun 2014 15:41:29 GMT]]></title><description><![CDATA[<p>Und hast du mal versucht herauszufinden, was das für Funktionen sind?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2402903</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2402903</guid><dc:creator><![CDATA[manni66]]></dc:creator><pubDate>Sat, 07 Jun 2014 15:41:29 GMT</pubDate></item><item><title><![CDATA[Reply to Dll Fehler on Sat, 07 Jun 2014 15:49:32 GMT]]></title><description><![CDATA[<p>Alle funktionen der libcurl library <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f62e.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--face_with_open_mouth"
      title=":O"
      alt="😮"
    /></p>
<p>Wie gesagt, wenn ich ne statische Library oder ne .exe compile gehts wunderbar, also muss es offenbar daran liegen, dass man bei einer dll noch etwas extra machen muss o.ä. ?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2402905</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2402905</guid><dc:creator><![CDATA[Etix]]></dc:creator><pubDate>Sat, 07 Jun 2014 15:49:32 GMT</pubDate></item><item><title><![CDATA[Reply to Dll Fehler on Sat, 07 Jun 2014 16:53:12 GMT]]></title><description><![CDATA[<p>Etix schrieb:</p>
<blockquote>
<p>Alle funktionen der libcurl library <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f62e.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--face_with_open_mouth"
      title=":O"
      alt="😮"
    /></p>
</blockquote>
<p>Nein, keine der drei.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2402916</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2402916</guid><dc:creator><![CDATA[manni66]]></dc:creator><pubDate>Sat, 07 Jun 2014 16:53:12 GMT</pubDate></item><item><title><![CDATA[Reply to Dll Fehler on Sat, 07 Jun 2014 17:40:52 GMT]]></title><description><![CDATA[<p>Tipp: WSA steht für &quot;Windows Sockets API&quot;</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2402919</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2402919</guid><dc:creator><![CDATA[Th69]]></dc:creator><pubDate>Sat, 07 Jun 2014 17:40:52 GMT</pubDate></item><item><title><![CDATA[Reply to Dll Fehler on Sun, 08 Jun 2014 03:11:13 GMT]]></title><description><![CDATA[<p>Etix schrieb:</p>
<blockquote>
<p>Wie gesagt, wenn ich ne statische Library oder ne .exe compile gehts wunderbar, also muss es offenbar daran liegen, dass man bei einer dll noch etwas extra machen muss o.ä. ?</p>
</blockquote>
<p>Naja in eine Anwendung werden wohl standardmäßig ein paar mehr libs gelinkt. Normal brauchst du aber &quot;Ws2_32.lib&quot; auch noch.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2402942</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2402942</guid><dc:creator><![CDATA[DarkShadow44]]></dc:creator><pubDate>Sun, 08 Jun 2014 03:11:13 GMT</pubDate></item></channel></rss>