MASM HELP !!!!!!!!!!!!!!!1

I wrote a assembly procedure to implement selection sort.

When I call this procedure from selectionSort.cpp file, I got an error

like this.

* ) Error 1 error LNK2019: unresolved external symbol _selectionSort referenced in function _main selectionSort.obj

**) Error 2 fatal error LNK1120: 1 unresolved externals selectionSort.exe

I USED LOCAL VARIABLES IN THE PROCEDURE. (for example : maxIndex)

IS A PROBLEM USING LOCAL VARIABLES




Answer this question

MASM HELP !!!!!!!!!!!!!!!1

  • NeW2VB

    look at:

    PUBLIC [[langtype]] name [[, [[langtype]] name]]...

    langtype must match function type in app file types ie the .cpp ,c ect.

    langtype types are C, BASIC, FORTRAN, PASCAL, SYSCALL, or STDCALL

    thus:

    public _selectionSort

    should be one of:

    public C _selectionSort

    public BASIC _selectionSort

    public STDCALL _selectionSort

    get it LOL


  • Vhradice

    Right done do public _selectionSort -> _ <- is a problem

    do: public [langtype] selectionSort

    langtype can be one of:C, BASIC, FORTRAN, PASCAL, SYSCALL, or STDCALL

    ie. public C selectionSort

    or public STDCALL selectionSort

    MASM will automaticly put the '_' in.

    get it LOL


  • walkeryan

    In addition to linking in the obj file, a few things to try (via process of elimination):

    1. don't try to decorate your function using _. I think MASM might do that on its own.
    2. remove the near keyword on your SelectionSort proc line
    3. try adding % in front of public:
    % public SelectionSort


  • justicelin

    Are you linking the .obj file that MASM generates


  • MASM HELP !!!!!!!!!!!!!!!1