<?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[ChangeDisplaySettings VC++ Linker-Error]]></title><description><![CDATA[<p>Huhu <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f609.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--winking_face"
      title=";)"
      alt="😉"
    /><br />
Kämpfe gerade mit folgendem Problem:<br />
Der untere Quelltext wirft mir in VC++ ständig Linker-Errors aus.</p>
<pre><code class="language-cpp">#include &quot;stdafx.h&quot;
#include &quot;windows.h&quot;

using namespace System;

int main(array&lt;System::String ^&gt; ^args)
{
int w=1024;
int h=768;
int d=32;
DEVMODE sDevMode;
ZeroMemory(&amp;sDevMode, sizeof(DEVMODE));
sDevMode.dmSize = sizeof(DEVMODE);
sDevMode.dmPelsWidth = w;
sDevMode.dmFields |= DM_PELSWIDTH;
sDevMode.dmPelsHeight = h;
sDevMode.dmFields |= DM_PELSHEIGHT;
sDevMode.dmBitsPerPel = d;
sDevMode.dmFields |= DM_BITSPERPEL;
LONG rVal = ChangeDisplaySettings(&amp;sDevMode, CDS_UPDATEREGISTRY);
    return 0;
}
</code></pre>
<p>Errors:</p>
<pre><code class="language-cpp">1&gt;Linking...
1&gt;new.obj : error LNK2028: unresolved token (0A000011) &quot;extern &quot;C&quot; long __stdcall ChangeDisplaySettingsW(struct _devicemodeW *,unsigned long)&quot; (?ChangeDisplaySettingsW@@$$J18YGJPAU_devicemodeW@@K@Z) referenced in function &quot;int __clrcall main(cli::array&lt;class System::String ^ &gt;^)&quot; (?main@@$$HYMHP$01AP$AAVString@System@@@Z)
1&gt;new.obj : error LNK2019: unresolved external symbol &quot;extern &quot;C&quot; long __stdcall ChangeDisplaySettingsW(struct _devicemodeW *,unsigned long)&quot; (?ChangeDisplaySettingsW@@$$J18YGJPAU_devicemodeW@@K@Z) referenced in function &quot;int __clrcall main(cli::array&lt;class System::String ^ &gt;^)&quot; (?main@@$$HYMHP$01AP$AAVString@System@@@Z)
</code></pre>
<p>In Dev-Cpp hingegen läuft der Code einwandfrei...<br />
Weiss jemand wo der Fehler liegt bzw. wieso der Linker hier rumnervt?</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/248492/changedisplaysettings-vc-linker-error</link><generator>RSS for Node</generator><lastBuildDate>Thu, 17 Sep 2026 00:36:18 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/248492.rss" rel="self" type="application/rss+xml"/><pubDate>Tue, 25 Aug 2009 17:02:58 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to ChangeDisplaySettings VC++ Linker-Error on Tue, 25 Aug 2009 17:02:58 GMT]]></title><description><![CDATA[<p>Huhu <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f609.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--winking_face"
      title=";)"
      alt="😉"
    /><br />
Kämpfe gerade mit folgendem Problem:<br />
Der untere Quelltext wirft mir in VC++ ständig Linker-Errors aus.</p>
<pre><code class="language-cpp">#include &quot;stdafx.h&quot;
#include &quot;windows.h&quot;

using namespace System;

int main(array&lt;System::String ^&gt; ^args)
{
int w=1024;
int h=768;
int d=32;
DEVMODE sDevMode;
ZeroMemory(&amp;sDevMode, sizeof(DEVMODE));
sDevMode.dmSize = sizeof(DEVMODE);
sDevMode.dmPelsWidth = w;
sDevMode.dmFields |= DM_PELSWIDTH;
sDevMode.dmPelsHeight = h;
sDevMode.dmFields |= DM_PELSHEIGHT;
sDevMode.dmBitsPerPel = d;
sDevMode.dmFields |= DM_BITSPERPEL;
LONG rVal = ChangeDisplaySettings(&amp;sDevMode, CDS_UPDATEREGISTRY);
    return 0;
}
</code></pre>
<p>Errors:</p>
<pre><code class="language-cpp">1&gt;Linking...
1&gt;new.obj : error LNK2028: unresolved token (0A000011) &quot;extern &quot;C&quot; long __stdcall ChangeDisplaySettingsW(struct _devicemodeW *,unsigned long)&quot; (?ChangeDisplaySettingsW@@$$J18YGJPAU_devicemodeW@@K@Z) referenced in function &quot;int __clrcall main(cli::array&lt;class System::String ^ &gt;^)&quot; (?main@@$$HYMHP$01AP$AAVString@System@@@Z)
1&gt;new.obj : error LNK2019: unresolved external symbol &quot;extern &quot;C&quot; long __stdcall ChangeDisplaySettingsW(struct _devicemodeW *,unsigned long)&quot; (?ChangeDisplaySettingsW@@$$J18YGJPAU_devicemodeW@@K@Z) referenced in function &quot;int __clrcall main(cli::array&lt;class System::String ^ &gt;^)&quot; (?main@@$$HYMHP$01AP$AAVString@System@@@Z)
</code></pre>
<p>In Dev-Cpp hingegen läuft der Code einwandfrei...<br />
Weiss jemand wo der Fehler liegt bzw. wieso der Linker hier rumnervt?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1766557</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1766557</guid><dc:creator><![CDATA[KorredC++]]></dc:creator><pubDate>Tue, 25 Aug 2009 17:02:58 GMT</pubDate></item><item><title><![CDATA[Reply to ChangeDisplaySettings VC++ Linker-Error on Tue, 25 Aug 2009 17:30:34 GMT]]></title><description><![CDATA[<p>Hast du denn die nötigen Libs gelinkt?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1766577</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1766577</guid><dc:creator><![CDATA[drakon]]></dc:creator><pubDate>Tue, 25 Aug 2009 17:30:34 GMT</pubDate></item><item><title><![CDATA[Reply to ChangeDisplaySettings VC++ Linker-Error on Tue, 25 Aug 2009 17:42:42 GMT]]></title><description><![CDATA[<p>Danke für den Tipp ;P Habs mal wieder verpasst die Libs zu adden...<br />
Hab einfach folgendes geadded:</p>
<pre><code>user32.lib
</code></pre>
<p>tja... *Banging head against wall*</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1766582</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1766582</guid><dc:creator><![CDATA[KorredC++]]></dc:creator><pubDate>Tue, 25 Aug 2009 17:42:42 GMT</pubDate></item></channel></rss>