I am writing a DLL with mixed C/C++ code. I want to specify the ordinals of the functions I'm exporting. So I created a .DEF file that looks like this
LIBRARY LEONMATH
EXPORTS
sca_alloc @1
vec_alloc @2
mat_alloc @3
sca_free @4
vec_free @5
mat_free @6
...
I would like to specify the ordinals of my C++ functions and class methods too. I have tried using the Dependency Walker to add the mangled names of my functions to the .DEF file:
??0CScalar@@QAE@XZ @25
??0CScalar@@QAE@O@Z @26
??0CScalar@@QAE@ABV0@@Z @27
??1CScalar@@QAE@XZ @28
But this has failed. Any ideas why this could be happening?
EDIT: kauppi made a good observation, so I'm adding more information to the question.
- Platform: Windows (and I'm not interested in portability)
- Compiler: Microsoft's C++ compiler (I'm using VS2005)
- Why I want to do this?: Using the ordinals has the advantage of letting me call exported C++ functions from C code.