how can i compile for windows XP with Visual Studio 2012 from the command prompt -


i running tcl/tk (8.5) external c library interface d2xx usb library. running windows 8 , trying compile library using vs 2012 native tools command prompt. when start command prompt pwd is:

\program files (x86)\microsoft visual studio 11.0\vc 

the c library (tclftd2xx.c) comes nmake files virtual studio sets environment link required tcl libraries , d2xx header.

in vs command window, cd directory containing makefile.vc , type:

nmake .....

and tclftd2xx.dll.

tclftd2xx.dll calls msvcr110.dll. when both of these placed in /tcl/lib, work great on windows 8 system, , on vista , windows 7.

however, when installed on windows xp, windows cannot load tclftd2xx.dll.

i did searches , discovered have configure vs2012 v110_xp toolset. link (http://blogs.msdn.com/b/vcblog/archive/2012/10/08/10357555.aspx) has note:

visual studio 2012 solutions , projects have been switched v110_xp toolset can built command line using msbuild or devenv without additional steps.

however, if wish use cl , link directly, additional steps needed. note steps below may automated creating batch script.

which did here:

rem set include , path variables set include=%programfiles(x86)%\microsoft sdks\windows\7.1a\include;%include% set path=%programfiles(x86)%\microsoft sdks\windows\7.1a\bin;%path%  rem when targeting x86, set lib path follows: set lib=%programfiles(x86)%\microsoft sdks\windows\7.1a\lib;%lib%  rem set compiler options set cl=/d_using_v110_sdk71_;%cl%  rem  when targeting x64, set lib path follows: rem  set lib=%programfiles(x86)%\microsoft sdks\windows\7.1a\lib\x64;%lib%  rem  specify correct subsystem , subsystem version linker based on type of rem  application building. applications targeting x86 version of windows xp must specify rem  subsystem version 5.01, , applications targeting x64 must specify version 5.02.  rem  x86 console applications: set link=/subsystem:console,5.01 %link%  rem  x64 console applications: rem  set link=/subsystem:console,5.02 %link% 

to build xp version, vs command line 1) ran .bat file 2) nmake .....

i .dll same size windows 8 targeted dll.

so have 2 questions:

  1. is there other magic configuration script or environment variable have run enable v110_xp toolset in addition executing .bat file, or executing .bat file full configuration?
  2. is there way confirm .dll indeed targeted xp system other trying load on xp system?

i came following batch script set variables. seems, have include project let people build code visual studio 2012.

@echo off goto :start  :check_dir     if not exist "%~1" (         echo directory "%~1" not exist.         echo things may not work expected.     )     goto :eof  :start     setlocal     if "%processor_architecture%" == "x86" (         set "programfiles(x86)=%programfiles%"     )      set "bindir=%programfiles(x86)%\microsoft sdks\windows\v7.1a\bin"     set "incdir=%programfiles(x86)%\microsoft sdks\windows\v7.1a\include"     set "libdir=%programfiles(x86)%\microsoft sdks\windows\v7.1a\lib"     set "subsys=console,5.01"      rem x64 instead of x86:     rem set "libdir=%programfiles(x86)%\microsoft sdks\windows\v7.1a\lib\x64"     rem set "subsys=console,5.02"      call :check_dir "%%bindir%%"     call :check_dir "%%incdir%%"     call :check_dir "%%libdir%%"      endlocal & (         set "cl=/d_using_v110_sdk71_;%cl%"         set "link=/subsystem:%subsys% %link%"         set "lib=%libdir%;%lib%"         set "path=%bindir%;%path%"         set "include=%incdir%;%include%"     ) 

Comments

Popular posts from this blog

Why does Ruby on Rails generate add a blank line to the end of a file? -

keyboard - Smiles and long press feature in Android -

node.js - Bad Request - node js ajax post -