flat assembler
Message board for the users of flat assembler.
Index
> High Level Languages > How to use asmlib with mingw? (c++ and asm linking) |
Author |
|
vivik 02 Aug 2017, 14:23
I tried this library http://www.agner.org/optimize/#asmlib
mingw doesn't support .lib files, so I converted it to .a using "Object file converter" from the same page. I used command "objconv -felf32 -nu libacof32o.lib libacof32o.a". I moved resulting .a file in the directory with all other .a files, and added -lacof32o linker flag. mingw showed error "undefined reference to MersRandomInit" in asmlibran.h. Probably issue is in name mangling. If somebody knows where I can copypaste random number generator from, please share. Last edited by vivik on 03 Aug 2017, 12:48; edited 1 time in total |
|||
02 Aug 2017, 14:23 |
|
vivik 03 Aug 2017, 13:07
Tried compiling with command "g++ main.o mersenne32.o", resulted in "undefined reference to `InstructionSet'"
Tried compiling with command "g++ main.o libacof32o.a", ended as usual. |
|||
03 Aug 2017, 13:07 |
|
vivik 03 Aug 2017, 13:13
"objdump -t mersenne32.o" shows this, among others
0000056b g O .CODE 00000004 MersenneBRandom |
|||
03 Aug 2017, 13:13 |
|
vivik 05 Aug 2017, 17:52
My mainCRTStartup function looks like _mainCRTStartup@0 in object files. Thought I used C compiler, why is there still name mangling in it. I thought it was a C++ thing.
|
|||
05 Aug 2017, 17:52 |
|
pber 11 Aug 2017, 22:39
strcmp is surprisigly faster than gcc 4.8
thanks for the hint vivik. but... why you dont simply recompile? |
|||
11 Aug 2017, 22:39 |
|
Furs 14 Aug 2017, 11:27
Do you even export the function? Either a .def file or __declspec(dllexport) would work with MinGW. When importing it, of course you need __declspec(dllimport). So if it's an asm function then use __declspec(dllimport) in the C header so it imports it.
There is name mangling because of the Win32 API using stdcall -- and mainCRTStartup being stdcall as well. |
|||
14 Aug 2017, 11:27 |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2025, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.