Попытка использовать Winelib со стандартными инструментами сборки macOS: получение странных ошибок компилятора

Я пытаюсь скомпилировать приложение win32 на macOS, используя Winelib. Я бы предпочел использовать стандартный компилятор macOS, предоставляемый с Xcode, если это вообще возможно. Однако до сих пор я не могу заставить его скомпилировать. Если я пытаюсь скомпилировать файл test.cpp со следующим содержанием:

#include <windows.h>
#include <list>

int main(int argc, char *argv[]) {
std::list<int> blah;
blah.push_back(1);
return 0;
}

в Ubuntu 16.04 с помощью следующей команды:

g++ -c -W -fexceptions -fshort-wchar -DWIN32 -D_DEBUG -D_WINDOWS -I/usr/include/wine-development/windows/ -I/usr/include/wine-development/msvcrt/ test.cpp

… Я получаю несколько предупреждений компилятора, но он все равно успешно компилируется.

Однако, если я пытаюсь скомпилировать тот же файл в macOS с помощью следующей эквивалентной команды:

clang++ -c  -W -fexceptions -fshort-wchar -DWIN32 -D_DEBUG -D_WINDOWS -I/usr/local/Cellar/wine/3.0/include/wine/msvcrt -I/usr/local/Cellar/wine/3.0/include/wine/windows test.cpp

…Я получаю следующие ошибки компилятора, которые я не знаю, как исправить:

In file included from test.cpp:3:
In file included from /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/list:173:
In file included from /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/memory:629:
In file included from /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/typeinfo:61:
In file included from /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/exception:82:
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/cstdlib:104:9: error: no member named 'lldiv_t' in the global namespace
using ::lldiv_t;
~~^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/cstdlib:110:9: error: no member named 'atoll' in the global namespace; did you
mean 'atol'?
using ::atoll;
~~^
/usr/local/Cellar/wine/3.0/include/wine/msvcrt/stdlib.h:186:23: note: 'atol' declared here
__msvcrt_long __cdecl atol(const char*);
^
In file included from test.cpp:3:
In file included from /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/list:173:
In file included from /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/memory:629:
In file included from /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/typeinfo:61:
In file included from /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/exception:82:
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/cstdlib:113:9: error: no member named 'strtof' in the global namespace
using ::strtof;
~~^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/cstdlib:114:9: error: no member named 'strtold' in the global namespace
using ::strtold;
~~^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/cstdlib:117:9: error: no member named 'strtoll' in the global namespace
using ::strtoll;
~~^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/cstdlib:121:9: error: no member named 'strtoull' in the global namespace; did you
mean 'strtoul'?
using ::strtoull;
~~^
/usr/local/Cellar/wine/3.0/include/wine/msvcrt/stdlib.h:205:24: note: 'strtoul' declared here
__msvcrt_ulong __cdecl strtoul(const char*,char**,int);
^
In file included from test.cpp:3:
In file included from /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/list:173:
In file included from /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/memory:629:
In file included from /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/typeinfo:61:
In file included from /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/exception:82:
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/cstdlib:132:9: error: no member named '_Exit' in the global namespace; did you
mean '_exit'?
using ::_Exit;
~~^
/usr/local/Cellar/wine/3.0/include/wine/msvcrt/stdlib.h:179:23: note: '_exit' declared here
void          __cdecl _exit(int);
^
In file included from test.cpp:3:
In file included from /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/list:173:
In file included from /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/memory:629:
In file included from /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/typeinfo:61:
In file included from /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/exception:82:
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/cstdlib:140:9: error: no member named 'llabs' in the global namespace; did you
mean 'labs'?
using ::llabs;
~~^
/usr/local/Cellar/wine/3.0/include/wine/msvcrt/stdlib.h:195:23: note: 'labs' declared here
__msvcrt_long __cdecl labs(__msvcrt_long);
^
In file included from test.cpp:3:
In file included from /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/list:173:
In file included from /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/memory:629:
In file included from /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/typeinfo:61:
In file included from /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/exception:82:
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/cstdlib:145:9: error: no member named 'lldiv' in the global namespace; did you
mean 'ldiv'?
using ::lldiv;
~~^
/usr/local/Cellar/wine/3.0/include/wine/msvcrt/stdlib.h:190:16: note: 'ldiv' declared here
ldiv_t __cdecl ldiv(__msvcrt_long,__msvcrt_long);
^
9 errors generated.

Обратите внимание, что я использую wine / winelib, установленную с помощью homebrew.

Судя по всему, реализация msvcrt в Winelib приводит к взрыву цепочки инструментов Xcode.

Что я могу сделать, чтобы это исправить?

0

Решение

Все объявления для этих функций представлены начиная с Wine 3.8. Обновите свою копию Wine до версии 3.8 или более поздней и повторите попытку.

0

Другие решения

Других решений пока нет …

По вопросам рекламы [email protected]