Step 1- download the Microsoft Windows SDK 7.1 from http://www.mathworks.co.uk/support/compilers/R2012a/win64.html.
Step 2 - Open the command line and type mex -setup
Step 3 - type y to locate installed compilers
Step 4 - Type the number in front of the Microsoft Software Development Kit 7.1 (for me it was 1)
Step 5 - type y to verify your choice
Step 6 - Open matlab and use the 'Build Function' to convert your simulink block to c/c++ code (For me it worked)