I would like to compile a Windows source code on Linux. Can wine help me for that ?
I've tried to link agains kernel32.dll.so, but something in the stack is wrong.
Code: Select all
int main()
{
HANDLE hFile = CreateFile("tt_win_src_on_linux.txt", GENERIC_WRITE, 0, NULL, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL);
printf("File created successfully\n");
return 0;
}
I can step into CreateFileA(), but a further calling function of GetVersion() crashes with a SIGSEGV before first C-line is executed. Maybe something bad on the stack - maybe calling convention ?
Assembly Code of GetVersion():
Code: Select all
0x7b496630 push rbp
0x7b496631 mov rax,QWORD PTR gs:0x30
Code: Select all
gcc -Wall -nostdinc -fno-builtin -H -fasynchronous-unwind-tables -DRC_INVOKED=1 -D_REENTRANT -g -I../wine/install/include/wine/windows -I../wine/install/include/wine/msvcrt -c /home/cvmann/dev/tt_win_src_on_linux/tt_win_src_on_linux.c -o obj/Debug/tt_win_src_on_linux.o
[100.0%] g++ -L../wine/install/lib64/wine -L../wine/install/lib64 -o bin/Debug/tt_win_src_on_linux obj/Debug/tt_win_src_on_linux.o -l:kernel32.dll.so -Wl,-rpath-link=/home/cvmann/dev/wine/install/lib64 -l:msvcrt.dll.so
Clemens