i want to write an inline asm code and call a windows API in it.
i am using code::blocks with Mingw, in windows environment and i get this error while trying to compile a x86 version of my code:
i tried Mingw64, Mingw32 and Mingw multi libs, none worked for me.
i tried packages from official site, modified ones and installing with Msys2 (i don't know if i correctly installed the x86 one with Msys2 or not)
it's either i don't know how to properly add the libs or its that i don't have the right package.
interesting part is that i don't have any problem while compiling my x64 asm code with Mingw64; it compiles and runs fine:
#include<iostream>char*msg="Hello, World!\n";char*wMsg="Content of the window..";char*constwCaption="Window title";char*constwCaption222="Window title";intvar=999999999999999;intmain(){std::cout<<"before call"<<"\n";asm("movq $0, %%rcx\n\t""movq %2, %%rdx\n\t""movq %4, %%r8\n\t""movq $0, %%r9\n\t""callq MessageBoxA\n\t":"=r"(var):"r"(msg),"r"(wMsg),"r"(wCaption),"r"(wCaption222):"cc");std::cout<<var<<"\n";std::cout<<"after call"<<"\n";}
Last edit: alex parker 2022-06-22
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
hi
i want to write an inline asm code and call a windows API in it.
i am using code::blocks with Mingw, in windows environment and i get this error while trying to compile a x86 version of my code:
my x86 code:
i tried Mingw64, Mingw32 and Mingw multi libs, none worked for me.
i tried packages from official site, modified ones and installing with Msys2 (i don't know if i correctly installed the x86 one with Msys2 or not)
it's either i don't know how to properly add the libs or its that i don't have the right package.
interesting part is that i don't have any problem while compiling my x64 asm code with Mingw64; it compiles and runs fine:
Last edit: alex parker 2022-06-22