News:

MASM32 SDK Description, downloads and other helpful links
MASM32.com New Forum Link
masmforum WebSite

How to access external global variables from masm?

Started by a_h, July 14, 2005, 02:02:54 PM

Previous topic - Next topic

a_h

Hi!

Currently I've some masm-assembly as .asm file that is part of a Visualc++6-project. In the .cpp file I declare global variables N, B of type unsigned int that I want to access.
---------------------------------
.686
.model flat, stdcall
option casemap :none

.code

Extrn _B:DWORD
Extrn _N:DWORD
...
--------------------------------
doesn't link. How can I access them?

Thanks for helping me out!

Cheers, Hannes

ToutEnMasm

Hello,
The library must be link with the source,includelib .....
The source of the library must declare the external like that
          EXTERNDEF Copier :PROTO  :DWORD,:DWORD
          EXTERNDEF EtatMemoirePile :MEMORY_BASIC_INFORMATION
          EXTERNDEF PoriginePile:DWORD      
This externals can be use only by the library,to use it in your source
                PUBLIC  PoriginePile  ;for example
I have no sample of externdef with c,perhaps declaring the externdef in the include of the library is enough.
                                ToutEnMasm

                             


a_h

Merci beaucoup!

Unfortunately I don't understand your reply...I tried Extern _BitsLeft:dword (and without the underscore), but it simply issues the unresolved error.

Any ideas what I can try?

Cheers, Hannes

Vortex

Hannes,

Here is an example for you. C++ file compiled with MS VC++ 2005 beta2

[attachment deleted by admin]