I don't know if anyone else is interested in this, but ...
I found that to get an OBJ file that was created by MS's C++ compiler,
to link with GoLink, you need to do 2 things in a hex editor:
1) Change _memset to memset (delete the '_')
2) Add a zero to the bunch of zeros after memset.
This might also be possible if you're really carefull in a text editor (Note/Word pad).
Does anyone know if this will always work?
I had a problem doing the same thing with the GNU compiler:
There's some thing called "__alloca" and I have no idea is what DLL
in which is exists.
Greetings,
- Mike
I found that to get an OBJ file that was created by MS's C++ compiler,
to link with GoLink, you need to do 2 things in a hex editor:
1) Change _memset to memset (delete the '_')
2) Add a zero to the bunch of zeros after memset.
This might also be possible if you're really carefull in a text editor (Note/Word pad).
Does anyone know if this will always work?
I had a problem doing the same thing with the GNU compiler:
There's some thing called "__alloca" and I have no idea is what DLL
in which is exists.
Greetings,
- Mike
Have you tried just using
memset equ _memset
memset equ _memset
Kind of hard to do that in C++...
That's what I mean, link your C++ object file to an ASM file with the proper equates. I thought he was talking about linking C++ object files to GoAsm projects using GoLink. Sorry if I made a mistake, but otherwise this would belong in the heap as it is not related to Win32asm at all.
Yes, that is what I'm trying to do.
I should have thought of that before...
But, how do I do that?
I should have thought of that before...
But, how do I do that?
Just use an equate in your main asm file and specify multiple objects to link with the main one (with the equate) first. I've never tried this so I'm not sure it will work properly but it should.
I tried assembling this with MASM:
.386
.model flat,stdcall
option casemap:none
.code
start:
memset equ _memset
END start
That's probably not what you meant for me to do,
because it doesn't work..
Your last message went whoosh (over my head).
.386
.model flat,stdcall
option casemap:none
.code
start:
memset equ _memset
END start
That's probably not what you meant for me to do,
because it doesn't work..
Your last message went whoosh (over my head).
In MASM you would do this:
The function would be in test.obj (in this case _TestProc)
in the main.obj file is the equate:
TestProc equ _TestProc
TestProc PROTO
and a call to TestProc:
invoke TestProc
seems to link ok. The proc executed ok
[size=12]C:\Masm32\Bin\LINK.EXE /FILEALIGN:512 /SUBSYSTEM:WINDOWS /RELEASE /VERSION:4.0 LIBPATH:"C:\Masm32\Lib" "Main.obj" "Test.obj"[/SIZE]
The function would be in test.obj (in this case _TestProc)
in the main.obj file is the equate:
TestProc equ _TestProc
TestProc PROTO
and a call to TestProc:
invoke TestProc
seems to link ok. The proc executed ok
I tried with GoAsm as well using :
C:\GoAsm\BIN\GoLink.EXE @C:\GoAsm\BIN\GFL.txt /entry Start "testmain.obj" "Test.obj" "testmain.res"
and the equate in testmain.asm I got it to work on one that was assembled by ML.EXE. I don't have C++ or any object files from it so I can''t really test it with them. I think there would be problems with the external imports though (i.e. __imp_MessageBoxA@16).
This is the syntax to use for your equate :
TestProc equ _TestProc@16
This seems to work.
C:\GoAsm\BIN\GoLink.EXE @C:\GoAsm\BIN\GFL.txt /entry Start "testmain.obj" "Test.obj" "testmain.res"
and the equate in testmain.asm I got it to work on one that was assembled by ML.EXE. I don't have C++ or any object files from it so I can''t really test it with them. I think there would be problems with the external imports though (i.e. __imp_MessageBoxA@16).
This is the syntax to use for your equate :
TestProc equ _TestProc@16
This seems to work.
I haven't been able to get it to work. :(
Are you sure that EQUs make it into the
final OBJ ?
Here's the C++ OBJ file:
Are you sure that EQUs make it into the
final OBJ ?
Here's the C++ OBJ file:
yeah, I can't get it working either, I geuss that the obj file makes a call to _memset and that is not being handled by GoLink. I'll play around with it but I think that you have the only solution for this. Too bad it would have been useful.
Remember to declare the EQU as global...
ASMMike,Donkey,
Here is an example of using VC++ with GoLink:
http://masmforum.com/viewtopic.php?t=394
Here is an example of using VC++ with GoLink:
http://masmforum.com/viewtopic.php?t=394