<?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[[SOLVED]qtcreator under Wine ( MinGw compilant ) windows.h program]]></title><description><![CDATA[<p dir="auto">Hello. I am trying again to compile a windows exe under wine+qtcreator. I am wondering why this code does not compile and reports an error.<br />
@<br />
#ifdef _WIN32<br />
#include "Service.h"<br />
#include &lt;stdio.h&gt;<br />
SERVICE_STATUS ServiceStatus;<br />
SERVICE_STATUS_HANDLE  hStatus;<br />
int InitService() {<br />
int result = WriteToLog("Monitoring started.");<br />
return result;<br />
}</p>
<p dir="auto">int WriteToLog(char <em>str) {<br />
FILE</em> fp;<br />
fp = fopen(LOG_FILE, "a+");<br />
if ( ! fp) return -1;<br />
fprintf(fp, "%s\n", str);<br />
fclose(fp);<br />
return 0;<br />
}</p>
<p dir="auto">int ServiceMain(int argc, char <em>argv[])  {<br />
int error = InitService();<br />
if ( error ) {<br />
ServiceStatus.dwCurrentState = SERVICE_STOPPED;<br />
ServiceStatus.dwWin32ExitCode = -1;<br />
SetServiceStatus(hStatus, &amp;ServiceStatus);<br />
return 1;<br />
}<br />
ServiceStatus.dwCurrentState = SERVICE_RUNNING;<br />
SetServiceStatus(hStatus, &amp;ServiceStatus);<br />
return 0;<br />
}<br />
int mainO(int argc, char</em>* argv) {<br />
SERVICE_TABLE_ENTRY  ServiceTable[2];<br />
ServiceTable[0].lpServiceName = "MemoryStatus" ;<br />
ServiceTable[0].lpServiceProc = (LP_SERVICE_MAIN_FUNCTION) ServiceMain ;<br />
printf("%d is status \n", StartServiceCtrlDispatcher(ServiceTable));<br />
}<br />
@<br />
qtcreator reports errors in mainO ServiceTable[0].lpServiceName and lpServiceProc. The errors are as follows:<br />
@<br />
cannot convert 'const char[13]' to LPWSTR {aka wchar_t*} in assignment<br />
LP_SERVICE_MAIN_FUNCTION was not declared in this scope<br />
@<br />
Should I include something in pro file?</p>
]]></description><link>https://forum.qt.io/topic/45883/solved-qtcreator-under-wine-mingw-compilant-windows-h-program</link><generator>RSS for Node</generator><lastBuildDate>Sat, 16 May 2026 02:06:29 GMT</lastBuildDate><atom:link href="https://forum.qt.io/topic/45883.rss" rel="self" type="application/rss+xml"/><pubDate>Fri, 12 Sep 2014 15:51:13 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to [SOLVED]qtcreator under Wine ( MinGw compilant ) windows.h program on Fri, 12 Sep 2014 16:18:10 GMT]]></title><description><![CDATA[<p dir="auto">Thank you very much! I`ve figured it by casting the string to wchar_t* but never got the idea it was LPSERVICE not LP_SERVICE... damn windows.<br />
[quote author="hskoglund" date="1410538438"]Hi, try change lines 35 and 36 to:<br />
@<br />
ServiceTable[0].lpServiceName = L"MemoryStatus" ;<br />
ServiceTable[0].lpServiceProc = (LPSERVICE_MAIN_FUNCTION) ServiceMain ;<br />
@[/quote]</p>
]]></description><link>https://forum.qt.io/post/243615</link><guid isPermaLink="true">https://forum.qt.io/post/243615</guid><dc:creator><![CDATA[heatblazer]]></dc:creator><pubDate>Fri, 12 Sep 2014 16:18:10 GMT</pubDate></item><item><title><![CDATA[Reply to [SOLVED]qtcreator under Wine ( MinGw compilant ) windows.h program on Fri, 12 Sep 2014 16:16:15 GMT]]></title><description><![CDATA[<p dir="auto">OK, I was able to just cast to wchar_t* the string. I<code>ve added to pro file windows.h which for god sake, I </code>ve found in Qt Dir :) This is nice feat. But I still got that weird err:<br />
@<br />
ServiceTable[0].lpServiceProc = (LP_SERVICE_MAIN_FUNCTION) ServiceMain ;<br />
@<br />
@<br />
Z:\home\ilian\QT5\SampleGame\Service.cpp:38: error: 'LP_SERVICE_MAIN_FUNCTION' was not declared in this scope<br />
ServiceTable[0].lpServiceProc = (LP_SERVICE_MAIN_FUNCTION) ServiceMain ;<br />
^<br />
Z:\home\ilian\QT5\SampleGame\Service.cpp:38: error: expected ';' before 'ServiceMain'<br />
ServiceTable[0].lpServiceProc = (LP_SERVICE_MAIN_FUNCTION) ServiceMain ;<br />
^<br />
@</p>
]]></description><link>https://forum.qt.io/post/243611</link><guid isPermaLink="true">https://forum.qt.io/post/243611</guid><dc:creator><![CDATA[heatblazer]]></dc:creator><pubDate>Fri, 12 Sep 2014 16:16:15 GMT</pubDate></item><item><title><![CDATA[Reply to [SOLVED]qtcreator under Wine ( MinGw compilant ) windows.h program on Fri, 12 Sep 2014 16:13:58 GMT]]></title><description><![CDATA[<p dir="auto">Hi, try change lines 35 and 36 to:<br />
@<br />
ServiceTable[0].lpServiceName = L"MemoryStatus" ;<br />
ServiceTable[0].lpServiceProc = (LPSERVICE_MAIN_FUNCTION) ServiceMain ;<br />
@</p>
]]></description><link>https://forum.qt.io/post/243613</link><guid isPermaLink="true">https://forum.qt.io/post/243613</guid><dc:creator><![CDATA[hskoglund]]></dc:creator><pubDate>Fri, 12 Sep 2014 16:13:58 GMT</pubDate></item></channel></rss>