Есть такая простая программа:
#pragma comment(lib, "user32")
#include <windows.h>
int main() {
MessageBox(NULL, "hello world", "", 0);
return 0;
}
И этот простой pom.xml:
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://maven.apache.org/POM/4.0.0"xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>lmiguelmh.test</groupId>
<artifactId>msgbox-app</artifactId>
<version>1.0</version>
<packaging>nar</packaging>
<build>
<plugins>
<plugin>
<groupId>com.github.maven-nar</groupId>
<artifactId>nar-maven-plugin</artifactId>
<version>3.2.3</version>
<extensions>true</extensions>
<configuration>
<libraries>
<library>
<type>executable</type>
<run>true</run>
</library>
</libraries>
</configuration>
</plugin>
</plugins>
</build>
</project>
В этом случае я использую nar-maven-plugin
версия 3.2.3. я могу бежать mvn compile
и артефакт msgbox-app.exe
будет сгенерирован успешно.
Но когда я меняю версию nar-maven-plugin
в 3.3.0 и я бегу mvn compile
Я получаю много ошибок:
[INFO] C:\Program Files (x86)\Windows Kits\8.0\Include\um\winnt.h(1243) : error C2065: 'SAL_sameIRQL' : undeclared identifier
[ERROR] C:\Program Files (x86)\Windows Kits\8.0\Include\um\winnt.h(1243) : error C2065: 'SAL_sameIRQL' : undeclared identifier
[INFO] C:\Program Files (x86)\Windows Kits\8.0\Include\um\winnt.h(1246) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
[ERROR] C:\Program Files (x86)\Windows Kits\8.0\Include\um\winnt.h(1246) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
[INFO] C:\Program Files (x86)\Windows Kits\8.0\Include\um\winnt.h(1246) : error C2513: 'int' : no variable declared before '='
[ERROR] C:\Program Files (x86)\Windows Kits\8.0\Include\um\winnt.h(1246) : error C2513: 'int' : no variable declared before '='
[INFO] C:\Program Files (x86)\Windows Kits\8.0\Include\um\winnt.h(1246) : error C2146: syntax error : missing ';' before identifier 'EXCEPTION_DISPOSITION'
[ERROR] C:\Program Files (x86)\Windows Kits\8.0\Include\um\winnt.h(1246) : error C2146: syntax error : missing ';' before identifier 'EXCEPTION_DISPOSITION'
[INFO] C:\Program Files (x86)\Windows Kits\8.0\Include\um\winnt.h(1246) : error C2143: syntax error : missing ';' before '__stdcall'
[ERROR] C:\Program Files (x86)\Windows Kits\8.0\Include\um\winnt.h(1246) : error C2143: syntax error : missing ';' before '__stdcall'
[INFO] C:\Program Files (x86)\Windows Kits\8.0\Include\um\winnt.h(1246) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
[ERROR] C:\Program Files (x86)\Windows Kits\8.0\Include\um\winnt.h(1246) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
[INFO] C:\Program Files (x86)\Windows Kits\8.0\Include\um\winnt.h(1246) : error C2377: 'EXCEPTION_DISPOSITION' : redefinition; typedef cannot be overloaded with any other symbol
[ERROR] C:\Program Files (x86)\Windows Kits\8.0\Include\um\winnt.h(1246) : error C2377: 'EXCEPTION_DISPOSITION' : redefinition; typedef cannot be overloaded with any other symbol
[INFO] C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\include\excpt.h(44) : see declaration of 'EXCEPTION_DISPOSITION'
[INFO] C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\include\excpt.h(44) : see declaration of 'EXCEPTION_DISPOSITION'
[INFO] C:\Program Files (x86)\Windows Kits\8.0\Include\um\winnt.h(1252) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
[ERROR] C:\Program Files (x86)\Windows Kits\8.0\Include\um\winnt.h(1252) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
[INFO] C:\Program Files (x86)\Windows Kits\8.0\Include\um\winnt.h(1254) : error C2143: syntax error : missing ';' before '*'
[ERROR] C:\Program Files (x86)\Windows Kits\8.0\Include\um\winnt.h(1254) : error C2143: syntax error : missing ';' before '*'
[INFO] C:\Program Files (x86)\Windows Kits\8.0\Include\um\winnt.h(1254) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
[ERROR] C:\Program Files (x86)\Windows Kits\8.0\Include\um\winnt.h(1254) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
[INFO] C:\Program Files (x86)\Windows Kits\8.0\Include\um\winnt.h(1254) : error C2365: 'EXCEPTION_ROUTINE' : redefinition; previous definition was 'function'
[ERROR] C:\Program Files (x86)\Windows Kits\8.0\Include\um\winnt.h(1254) : error C2365: 'EXCEPTION_ROUTINE' : redefinition; previous definition was 'function'
[INFO] C:\Program Files (x86)\Windows Kits\8.0\Include\um\winnt.h(1247) : see declaration of 'EXCEPTION_ROUTINE'
[INFO] C:\Program Files (x86)\Windows Kits\8.0\Include\um\winnt.h(1247) : see declaration of 'EXCEPTION_ROUTINE'
[INFO] C:\Program Files (x86)\Windows Kits\8.0\Include\um\winnt.h(1254) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
[ERROR] C:\Program Files (x86)\Windows Kits\8.0\Include\um\winnt.h(1254) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
[INFO] C:\Program Files (x86)\Windows Kits\8.0\Include\um\winnt.h(10749) : error C2146: syntax error : missing ';' before identifier 'Handler'
[ERROR] C:\Program Files (x86)\Windows Kits\8.0\Include\um\winnt.h(10749) : error C2146: syntax error : missing ';' before identifier 'Handler'
[INFO] C:\Program Files (x86)\Windows Kits\8.0\Include\um\winnt.h(10749) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
[ERROR] C:\Program Files (x86)\Windows Kits\8.0\Include\um\winnt.h(10749) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
[INFO] C:\Program Files (x86)\Windows Kits\8.0\Include\um\winnt.h(10749) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
[ERROR] C:\Program Files (x86)\Windows Kits\8.0\Include\um\winnt.h(10749) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
[INFO] C:\Program Files (x86)\Windows Kits\8.0\Include\um\winnt.h(16638) : error C2144: syntax error : 'PSLIST_ENTRY' should be preceded by ','
[ERROR] C:\Program Files (x86)\Windows Kits\8.0\Include\um\winnt.h(16638) : error C2144: syntax error : 'PSLIST_ENTRY' should be preceded by ','
[INFO] C:\Program Files (x86)\Windows Kits\8.0\Include\um\winnt.h(16646) : error C2144: syntax error : 'PSLIST_ENTRY' should be preceded by ','
[ERROR] C:\Program Files (x86)\Windows Kits\8.0\Include\um\winnt.h(16646) : error C2144: syntax error : 'PSLIST_ENTRY' should be preceded by ','
[INFO] C:\Program Files (x86)\Windows Kits\8.0\Include\um\heapapi.h(124) : error C2061: syntax error : identifier '_SA_annotes1'
[ERROR] C:\Program Files (x86)\Windows Kits\8.0\Include\um\heapapi.h(124) : error C2061: syntax error : identifier '_SA_annotes1'
[INFO] C:\Program Files (x86)\Windows Kits\8.0\Include\um\heapapi.h(125) : error C2059: syntax error : ')'
[ERROR] C:\Program Files (x86)\Windows Kits\8.0\Include\um\heapapi.h(125) : error C2059: syntax error : ')'
[INFO] C:\Program Files (x86)\Windows Kits\8.0\Include\um\heapapi.h(125) : error C2143: syntax error : missing ')' before ';'
[ERROR] C:\Program Files (x86)\Windows Kits\8.0\Include\um\heapapi.h(125) : error C2143: syntax error : missing ')' before ';'
[INFO] C:\Program Files (x86)\Windows Kits\8.0\Include\um\processthreadsapi.h(204) : error C2144: syntax error : 'LPVOID' should be preceded by ','
[ERROR] C:\Program Files (x86)\Windows Kits\8.0\Include\um\processthreadsapi.h(204) : error C2144: syntax error : 'LPVOID' should be preceded by ','
[INFO] C:\Program Files (x86)\Windows Kits\8.0\Include\um\sysinfoapi.h(189) : error C2065: 'SAL_preferredFunction' : undeclared identifier
[ERROR] C:\Program Files (x86)\Windows Kits\8.0\Include\um\sysinfoapi.h(189) : error C2065: 'SAL_preferredFunction' : undeclared identifier
[INFO] C:\Program Files (x86)\Windows Kits\8.0\Include\um\sysinfoapi.h(192) : error C2448: '_SA_annotes2' : function-style initializer appears to be a function definition
[ERROR] C:\Program Files (x86)\Windows Kits\8.0\Include\um\sysinfoapi.h(192) : error C2448: '_SA_annotes2' : function-style initializer appears to be a function definition
[INFO] C:\Program Files (x86)\Windows Kits\8.0\Include\um\sysinfoapi.h(192) : error C2143: syntax error : missing ';' before '__stdcall'
[ERROR] C:\Program Files (x86)\Windows Kits\8.0\Include\um\sysinfoapi.h(192) : error C2143: syntax error : missing ';' before '__stdcall'
[INFO] C:\Program Files (x86)\Windows Kits\8.0\Include\um\sysinfoapi.h(351) : error C2065: 'COMPUTER_NAME_FORMAT' : undeclared identifier
[ERROR] C:\Program Files (x86)\Windows Kits\8.0\Include\um\sysinfoapi.h(351) : error C2065: 'COMPUTER_NAME_FORMAT' : undeclared identifier
[INFO] C:\Program Files (x86)\Windows Kits\8.0\Include\um\sysinfoapi.h(351) : error C2146: syntax error : missing ')' before identifier 'NameType'
[ERROR] C:\Program Files (x86)\Windows Kits\8.0\Include\um\sysinfoapi.h(351) : error C2146: syntax error : missing ')' before identifier 'NameType'
[INFO] C:\Program Files (x86)\Windows Kits\8.0\Include\um\sysinfoapi.h(351) : warning C4229: anachronism used : modifiers on data are ignored
[INFO] C:\Program Files (x86)\Windows Kits\8.0\Include\um\sysinfoapi.h(351) : warning C4229: anachronism used : modifiers on data are ignored
[INFO] C:\Program Files (x86)\Windows Kits\8.0\Include\um\sysinfoapi.h(351) : error C2491: 'GetComputerNameExA' : definition of dllimport data not allowed
[ERROR] C:\Program Files (x86)\Windows Kits\8.0\Include\um\sysinfoapi.h(351) : error C2491: 'GetComputerNameExA' : definition of dllimport data not allowed
[INFO] C:\Program Files (x86)\Windows Kits\8.0\Include\um\sysinfoapi.h(354) : error C2059: syntax error : ')'
[ERROR] C:\Program Files (x86)\Windows Kits\8.0\Include\um\sysinfoapi.h(354) : error C2059: syntax error : ')'
[INFO] C:\Program Files (x86)\Windows Kits\8.0\Include\um\sysinfoapi.h(361) : error C2065: 'COMPUTER_NAME_FORMAT' : undeclared identifier
[ERROR] C:\Program Files (x86)\Windows Kits\8.0\Include\um\sysinfoapi.h(361) : error C2065: 'COMPUTER_NAME_FORMAT' : undeclared identifier
[INFO] C:\Program Files (x86)\Windows Kits\8.0\Include\um\sysinfoapi.h(361) : error C2146: syntax error : missing ')' before identifier 'NameType'
[ERROR] C:\Program Files (x86)\Windows Kits\8.0\Include\um\sysinfoapi.h(361) : error C2146: syntax error : missing ')' before identifier 'NameType'
[INFO] C:\Program Files (x86)\Windows Kits\8.0\Include\um\sysinfoapi.h(361) : warning C4229: anachronism used : modifiers on data are ignored
[INFO] C:\Program Files (x86)\Windows Kits\8.0\Include\um\sysinfoapi.h(361) : warning C4229: anachronism used : modifiers on data are ignored
[INFO] C:\Program Files (x86)\Windows Kits\8.0\Include\um\sysinfoapi.h(361) : error C2491: 'GetComputerNameExW' : definition of dllimport data not allowed
[ERROR] C:\Program Files (x86)\Windows Kits\8.0\Include\um\sysinfoapi.h(361) : error C2491: 'GetComputerNameExW' : definition of dllimport data not allowed
[INFO] C:\Program Files (x86)\Windows Kits\8.0\Include\um\sysinfoapi.h(364) : error C2059: syntax error : ')'
[ERROR] C:\Program Files (x86)\Windows Kits\8.0\Include\um\sysinfoapi.h(364) : error C2059: syntax error : ')'
[INFO] C:\Program Files (x86)\Windows Kits\8.0\Include\um\sysinfoapi.h(383) : error C2065: 'COMPUTER_NAME_FORMAT' : undeclared identifier
[ERROR] C:\Program Files (x86)\Windows Kits\8.0\Include\um\sysinfoapi.h(383) : error C2065: 'COMPUTER_NAME_FORMAT' : undeclared identifier
[INFO] C:\Program Files (x86)\Windows Kits\8.0\Include\um\sysinfoapi.h(383) : error C2146: syntax error : missing ')' before identifier 'NameType'
[ERROR] C:\Program Files (x86)\Windows Kits\8.0\Include\um\sysinfoapi.h(383) : error C2146: syntax error : missing ')' before identifier 'NameType'
[INFO] C:\Program Files (x86)\Windows Kits\8.0\Include\um\sysinfoapi.h(383) : warning C4229: anachronism used : modifiers on data are ignored
[INFO] C:\Program Files (x86)\Windows Kits\8.0\Include\um\sysinfoapi.h(383) : warning C4229: anachronism used : modifiers on data are ignored
[INFO] C:\Program Files (x86)\Windows Kits\8.0\Include\um\sysinfoapi.h(383) : error C2491: 'SetComputerNameExW' : definition of dllimport data not allowed
[ERROR] C:\Program Files (x86)\Windows Kits\8.0\Include\um\sysinfoapi.h(383) : error C2491: 'SetComputerNameExW' : definition of dllimport data not allowed
[INFO] C:\Program Files (x86)\Windows Kits\8.0\Include\um\sysinfoapi.h(385) : error C2059: syntax error : ')'
[ERROR] C:\Program Files (x86)\Windows Kits\8.0\Include\um\sysinfoapi.h(385) : error C2059: syntax error : ')'
[INFO] C:\Program Files (x86)\Windows Kits\8.0\Include\um\memoryapi.h(429) : error C2065: 'MEMORY_RESOURCE_NOTIFICATION_TYPE' : undeclared identifier
[ERROR] C:\Program Files (x86)\Windows Kits\8.0\Include\um\memoryapi.h(429) : error C2065: 'MEMORY_RESOURCE_NOTIFICATION_TYPE' : undeclared identifier
[INFO] C:\Program Files (x86)\Windows Kits\8.0\Include\um\memoryapi.h(430) : error C2146: syntax error : missing ')' before identifier 'NotificationType'
[ERROR] C:\Program Files (x86)\Windows Kits\8.0\Include\um\memoryapi.h(430) : error C2146: syntax error : missing ')' before identifier 'NotificationType'
[INFO] C:\Program Files (x86)\Windows Kits\8.0\Include\um\memoryapi.h(430) : warning C4229: anachronism used : modifiers on data are ignored
[INFO] C:\Program Files (x86)\Windows Kits\8.0\Include\um\memoryapi.h(430) : warning C4229: anachronism used : modifiers on data are ignored
[INFO] C:\Program Files (x86)\Windows Kits\8.0\Include\um\memoryapi.h(430) : error C2491: 'CreateMemoryResourceNotification' : definition of dllimport data not allowed
[ERROR] C:\Program Files (x86)\Windows Kits\8.0\Include\um\memoryapi.h(430) : error C2491: 'CreateMemoryResourceNotification' : definition of dllimport data not allowed
[INFO] C:\Program Files (x86)\Windows Kits\8.0\Include\um\memoryapi.h(430) : error C2059: syntax error : ')'
[ERROR] C:\Program Files (x86)\Windows Kits\8.0\Include\um\memoryapi.h(430) : error C2059: syntax error : ')'
[INFO] C:\Program Files (x86)\Windows Kits\8.0\Include\um\memoryapi.h(536) : error C2061: syntax error : identifier 'PWIN32_MEMORY_RANGE_ENTRY'
[ERROR] C:\Program Files (x86)\Windows Kits\8.0\Include\um\memoryapi.h(536) : error C2061: syntax error : identifier 'PWIN32_MEMORY_RANGE_ENTRY'
[INFO] C:\Program Files (x86)\Windows Kits\8.0\Include\um\threadpoolapiset.h(341) : error C2061: syntax error : identifier 'PTP_WIN32_IO_CALLBACK'
[ERROR] C:\Program Files (x86)\Windows Kits\8.0\Include\um\threadpoolapiset.h(341) : error C2061: syntax error : identifier 'PTP_WIN32_IO_CALLBACK'
[INFO] C:\Program Files (x86)\Windows Kits\8.0\Include\um\bemapiset.h(54) : error C2061: syntax error : identifier 'BEM_FREE_INTERFACE_CALLBACK'
[ERROR] C:\Program Files (x86)\Windows Kits\8.0\Include\um\bemapiset.h(54) : error C2061: syntax error : identifier 'BEM_FREE_INTERFACE_CALLBACK'
[INFO] C:\Program Files (x86)\Windows Kits\8.0\Include\um\bemapiset.h(64) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
[ERROR] C:\Program Files (x86)\Windows Kits\8.0\Include\um\bemapiset.h(64) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
[INFO] C:\Program Files (x86)\Windows Kits\8.0\Include\um\bemapiset.h(64) : error C2143: syntax error : missing ',' before '*'
[ERROR] C:\Program Files (x86)\Windows Kits\8.0\Include\um\bemapiset.h(64) : error C2143: syntax error : missing ',' before '*'
[INFO] C:\Program Files (x86)\Windows Kits\8.0\Include\um\bemapiset.h(73) : error C2065: 'BEM_REFERENCE' : undeclared identifier
[ERROR] C:\Program Files (x86)\Windows Kits\8.0\Include\um\bemapiset.h(73) : error C2065: 'BEM_REFERENCE' : undeclared identifier
[INFO] C:\Program Files (x86)\Windows Kits\8.0\Include\um\bemapiset.h(73) : error C2065: 'reference' : undeclared identifier
[ERROR] C:\Program Files (x86)\Windows Kits\8.0\Include\um\bemapiset.h(73) : error C2065: 'reference' : undeclared identifier
[INFO] C:\Program Files (x86)\Windows Kits\8.0\Include\um\bemapiset.h(74) : error C2065: 'BEM_REFERENCE' : undeclared identifier
[ERROR] C:\Program Files (x86)\Windows Kits\8.0\Include\um\bemapiset.h(74) : error C2065: 'BEM_REFERENCE' : undeclared identifier
[INFO] C:\Program Files (x86)\Windows Kits\8.0\Include\um\bemapiset.h(75) : error C2065: 'copiedReference' : undeclared identifier
[ERROR] C:\Program Files (x86)\Windows Kits\8.0\Include\um\bemapiset.h(75) : error C2065: 'copiedReference' : undeclared identifier
[INFO] C:\Program Files (x86)\Windows Kits\8.0\Include\um\bemapiset.h(75) : warning C4229: anachronism used : modifiers on data are ignored
[INFO] C:\Program Files (x86)\Windows Kits\8.0\Include\um\bemapiset.h(75) : warning C4229: anachronism used : modifiers on data are ignored
[INFO] C:\Program Files (x86)\Windows Kits\8.0\Include\um\bemapiset.h(75) : error C2078: too many initializers
[ERROR] C:\Program Files (x86)\Windows Kits\8.0\Include\um\bemapiset.h(75) : error C2078: too many initializers
[INFO] C:\Program Files (x86)\Windows Kits\8.0\Include\um\bemapiset.h(81) : error C2065: 'BEM_REFERENCE' : undeclared identifier
[ERROR] C:\Program Files (x86)\Windows Kits\8.0\Include\um\bemapiset.h(81) : error C2065: 'BEM_REFERENCE' : undeclared identifier
[INFO] C:\Program Files (x86)\Windows Kits\8.0\Include\um\bemapiset.h(82) : error C2065: 'reference' : undeclared identifier
[ERROR] C:\Program Files (x86)\Windows Kits\8.0\Include\um\bemapiset.h(82) : error C2065: 'reference' : undeclared identifier
[INFO] C:\Program Files (x86)\Windows Kits\8.0\Include\um\bemapiset.h(82) : warning C4229: anachronism used : modifiers on data are ignored
[INFO] C:\Program Files (x86)\Windows Kits\8.0\Include\um\bemapiset.h(82) : warning C4229: anachronism used : modifiers on data are ignored
[INFO] C:\Program Files (x86)\Windows Kits\8.0\Include\um\bemapiset.h(82) : error C2182: 'BemFreeReference' : illegal use of type 'void'
[ERROR] C:\Program Files (x86)\Windows Kits\8.0\Include\um\bemapiset.h(82) : error C2182: 'BemFreeReference' : illegal use of type 'void'
[INFO] C:\Program Files (x86)\Windows Kits\8.0\Include\um\bemapiset.h(82) : fatal error C1903: unable to recover from previous error(s); stopping compilation
[ERROR] C:\Program Files (x86)\Windows Kits\8.0\Include\um\bemapiset.h(82) : fatal error C1903: unable to recover from previous error(s); stopping compilation
Обновить
Возможно, проблема в том, что разница 1) в том, что поиск Visual Studio (в моем случае у меня msvc9 и msvc11) 2) в способе вызова компилятора:
Для 3.2.3
[DEBUG] cl /c /nologo /EHsc /DNDEBUG /MD /GR /DWindows /DWIN32 /IE:\PROY\test\dev\1.0\msgbox-app\src\main\include E:\PROY\test\dev\1.0\msgbox-app\src\main\c\main.cpp
[DEBUG] Execute:Java13CommandLauncher: Executing 'cl' with arguments:
''
'/c'
'/nologo'
'/EHsc'
'/DNDEBUG'
'/MD'
'/GR'
'/DWindows'
'/DWIN32'
'/IE:\PROY\test\dev\1.0\msgbox-app\src\main\include'
'E:\PROY\test\dev\1.0\msgbox-app\src\main\c\main.cpp'
Для 3.3.0
[DEBUG] "C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\bin\cl" /c /nologo /EHsc /DNDEBUG /MD /GR /DWIN32 /IE:\PROY\test\dev\1.0\msgbox-app\target\nar\obj\x86-Windows-msvc /IE:\PROY\test\dev\1.0\msgbox-app\target\nar\obj\x86-Windows-msvc /IE:\PROY\test\dev\1.0\msgbox-app\src\main\include "/IC:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\include" "/IC:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\atlmfc\include" "/IC:\Program Files (x86)\Windows Kits\8.0\Include\um" "/IC:\Program Files (x86)\Windows Kits\8.0\Include\shared" "/IC:\Program Files (x86)\Windows Kits\8.0\Include\winrt" /FoE:\PROY\test\dev\1.0\msgbox-app\target\nar\obj\x86-Windows-msvc\main.c1e925e5.obj c/main.cpp
[DEBUG] Setting environment variable: PATH=C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\bin;C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\vcpackages;C:\Program Files (x86)\Microsoft Visual Studio 9.0\Common7\Tools;C:\Program Files (x86)\Microsoft Visual Studio 9.0\Common7\IDE;C:\Program Files (x86)\Windows Kits\8.0\bin\x86;C:\Windows\System32;C:\Windows;C:\Windows\System32\wbem
[DEBUG] Setting environment variable: SystemRoot=C:\windows
[DEBUG] Setting environment variable: TMP=C:\Users\lmamani\AppData\Local\Temp
[DEBUG] Execute:Java13CommandLauncher: Executing 'C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\bin\cl' with arguments:
''
'/c'
'/nologo'
'/EHsc'
'/DNDEBUG'
'/MD'
'/GR'
'/DWIN32'
'/IE:\PROY\test\dev\1.0\msgbox-app\target\nar\obj\x86-Windows-msvc'
'/IE:\PROY\test\dev\1.0\msgbox-app\target\nar\obj\x86-Windows-msvc'
'/IE:\PROY\test\dev\1.0\msgbox-app\src\main\include'
'/IC:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\include'
'/IC:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\atlmfc\include'
'/IC:\Program Files (x86)\Windows Kits\8.0\Include\um'
'/IC:\Program Files (x86)\Windows Kits\8.0\Include\shared'
'/IC:\Program Files (x86)\Windows Kits\8.0\Include\winrt'
'/FoE:\PROY\test\dev\1.0\msgbox-app\target\nar\obj\x86-Windows-msvc\main.c1e925e5.obj'
'c/main.cpp'
Важно: последние обновления этого вопроса можно найти в https://github.com/maven-nar/nar-maven-plugin/issues/217
Как я уже сказал, проблема была в функциональности, добавленной в Maven NAR Plugin. Оригинальный ответ был опубликован GregDomjan на github и может быть найден здесь:
Плагин Maven NAR: ошибки компилятора в простой программе, использующей Windows.h в версии 3.3.0
TLDR: Вам необходимо использовать последнюю версию плагина (3.3.0) и изменить свою конфигурацию в соответствии с вашей средой (в моем случае msvc11.0 / winsdk8.0):
<build>
<plugins>
<plugin>
<groupId>com.github.maven-nar</groupId>
<artifactId>nar-maven-plugin</artifactId>
<version>3.3.0</version>
<extensions>true</extensions>
<configuration>
<libraries>
<library>
<type>executable</type>
<run>true</run>
</library>
</libraries>
<msvc>
<version>11.0</version>
<windowsSdkVersion>8.0</windowsSdkVersion>
</msvc>
</configuration>
</plugin>
</plugins>
</build>
Других решений пока нет …