none
c program with asm subroutine

    Question

  • Hi,

    where can i add the .asm file so that visual studio will find the subroutine?

    ive started with a default c++ project, added the c file to "source files" but just adding the .asm there to does not work.

    error: external symbol cant be resolved (free translation)

    any ideas?

    Monday, May 21, 2012 1:04 PM

Answers

  • For assembly files to be assembled by VS, you need to enable the build customisations.

    You can do this by going to Project->Build Customisations and in the window that appears, select the check box next to masm and then click OK.

    You could also get to this from Solution Explorer. If you open up Solution Explorer, right click on the project you want to enable this for and then in the context menu select Build Customisations then you will get to the same place.

    With this selected, when Visual Studio finds a .asm file in the project, it will now assemble it using masm.


    This is a signature

    Any samples given are not meant to have error checking or show best practices. They are meant to just illustrate a point. I may also give inefficient code or introduce some problems to discourage copy/paste coding. This is because the major point of my posts is to aid in the learning process.

    Do you want Visual Studio 11 Express to be freely installable on Windows 7 and able to write regular C++ applications? Please vote for this.

    • Marked as answer by stephenmeier Thursday, May 24, 2012 12:50 PM
    Monday, May 21, 2012 1:18 PM

All replies

  • Please copy/paste full error report, if it is not pages long and version of VS.

    Check this out, it may help "how do i properly link asm files to c++?".


    1. Whiter than the white is UV bright! 2. Eat your vegetables or you are going to turn in to blobs of lazy fat! 3. Fruits won't cut it 4 wheel drive with levers to lock differentials was a hack

    • Edited by D3F84U Monday, May 21, 2012 1:18 PM
    Monday, May 21, 2012 1:10 PM
  • For assembly files to be assembled by VS, you need to enable the build customisations.

    You can do this by going to Project->Build Customisations and in the window that appears, select the check box next to masm and then click OK.

    You could also get to this from Solution Explorer. If you open up Solution Explorer, right click on the project you want to enable this for and then in the context menu select Build Customisations then you will get to the same place.

    With this selected, when Visual Studio finds a .asm file in the project, it will now assemble it using masm.


    This is a signature

    Any samples given are not meant to have error checking or show best practices. They are meant to just illustrate a point. I may also give inefficient code or introduce some problems to discourage copy/paste coding. This is because the major point of my posts is to aid in the learning process.

    Do you want Visual Studio 11 Express to be freely installable on Windows 7 and able to write regular C++ applications? Please vote for this.

    • Marked as answer by stephenmeier Thursday, May 24, 2012 12:50 PM
    Monday, May 21, 2012 1:18 PM
  • thx Crescens2k

    that worked

    Thursday, May 24, 2012 12:49 PM