VC++ Link Error - Assembly and C++
Posted on 2003-11-28
Using Visual C++ 6.0 I am able to compile my files fine, but get the following error when trying to link:
fringe.obj : error LNK2001: unresolved external symbol _StringBack
fringe.cpp calls a function _StringBack which is defined in the assembly file asm.asm and has the header file asm.hpp.
I have #include "asm.hpp" in fringe.cpp
I have extern "C" void StringBack(); in asm.hpp
The beginning of asm.asm is as follows:
This file also contains the assembly definition for StringBack.
The assembly code compiles fine. I am using masm32 to compile it. In VC++ I compile it using the following command. Maybe I'm missing a switch?
c:\masm32\bin\ml /c $(inputpath)
I get an asm.obj file in the directory with all the other .obj files for the project. This file has the information that fringe.cpp needs, but some how the linker isn't finding it.
I am not that familiar with visual studios so I have a strong feeling that it is some setting that I have wrong. Thanks for the help!