I use objcopy on windows 10 to embed my dll inside an exe and load it. It runs fine with 32 bit compilation with a 32 bits binary dll file as i am getting no errors loading my dll.
objcopy --prefix-symbol=_ --input-target binary --output-target pe-i386 --binary-architecture i386 somedll.dll somedll.o
How can I set objcopy arguments so that I can get a 64 bit binaries object file? If it is not possible with objcopy
is there any alternatives to it ? My dll doesnt get loaded when i compile it to be 64 bits, and if i try to compile the executable with the object file as in 64 bits it returns error saying that my object file is not compatible with 64 bit compilation.
so during gcc compilation for example, i have to do
gcc -m32 Myfile.c somedll.o -o output.exe
if i remove -m32
it doesnt compile because somedll.o is set to 32 bits even if it was 64 bits as in dll, so thats why my LoadLibrary()
function can not load it.