Ganesh Kundapur

Hi,

I'm trying to automate the build process. If I build the x.vcproj from the VC++ express IDE,

it builds properly and if I build from the command line as

vcbuild x.vcproj

It says, windows.h no such file or directory and .

LINK : fatal error LNK1181: cannot open input file 'odbc32.lib'

VC++ directories are set for Include files, Executable files, Library files.

vcbuild x.vcproj works if

I copy Bin, Lib, Include folders from C:\Program Files\Microsoft Platform SDK for Windows Server 2003 R2 to C:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK.

Copying the folders from PlatformSDK conclude that, vcbuild is not getting the include path, library path.

x.vcproj file dont have any information on path to use while building VC++ express edition, i mean

C:\Program Files\Microsoft Platform SDK for Windows Server 2003 R2\Include, C:\Program Files\Microsoft Platform SDK for Windows Server 2003 R2\Include\lib, C:\Program Files\Microsoft Platform SDK for Windows Server 2003 R2\Include\Bin.

But these things are visible from within the IDE. ( Tools->Options->VC++ Directories->Show directories for Include files/Library files/Excutable files )

Please somebody let me know

*. Wheather is it possible to build vc++ express project from the command line

*. The process that i fallowed to build from the command line Is there any other way to do so

*. If vcbuild is used to build from command, isnt it possible without copying Bin, Lib, Include folders from PlatformSDK

*. How can i instruct vcbuild to refer the paths by exporting environment variables

Thanks,

Ganesh



Re: Visual C++ Express Edition how to build vc++ express project from the command line

nobugz

Look for a vcvars32.bat or vcvarsall.bat file in the installation folders. I kinda doubt it is there for the Express edition, command line building wouldn't fit the intended use for that edition.





Re: Visual C++ Express Edition how to build vc++ express project from the command line

einaros

vcvars32 should be in the bin directory. It's there in VC9 Express Beta2, so you may yet be in luck.





Re: Visual C++ Express Edition how to build vc++ express project from the command line

Ganesh Kundapur

vcvarsall.bat is in C:\Program Files\Microsoft Visual Studio 8\VC.

My environment after running vcvarsall.bat is
--
C:\backbuffer\group>env
!C:=C:\backbuffer\group
APPDATA=C:\Documents and Settings\kundapur\Application Data
COMPUTERNAME=2INL02794
COMSPEC=C:\WINNT\system32\cmd.exe
COPYCMD=/Y
DEVENVDIR=C:\Program Files\Microsoft Visual Studio 8\Common7\IDE
FP_NO_HOST_CHECK=NO
FRAMEWORKDIR=C:\WINNT\Microsoft.NET\Framework
FRAMEWORKSDKDIR=C:\Program Files\Microsoft Visual Studio 8\SDK\v2.0
FRAMEWORKVERSION=v2.0.50727
HOMEDRIVE=C:
HOMEPATH=\Documents and Settings\kundapur
INCLUDE=C:\Program Files\Microsoft Visual Studio 8\VC\INCLUDE;C:\Program Files\Microsoft Visual Studio\VC98\atl\include;C:\Program Files\Microsoft Visual Studio\VC98\mfc\include;C:\Program Files\Micro
soft Visual Studio\VC98\include
LIB=C:\Program Files\Microsoft Visual Studio 8\VC\LIB;C:\Program Files\Microsoft Visual Studio 8\SDK\v2.0\lib;C:\Program Files\Microsoft Visual Studio\VC98\mfc\lib;C:\Program Files\Microsoft Visual St
udio\VC98\lib
LIBPATH=C:\WINNT\Microsoft.NET\Framework\v2.0.50727
MSDEVDIR=C:\Program Files\Microsoft Visual Studio\Common\MSDev98
NUMBER_OF_PROCESSORS=2
NUTSUFFIX=1
NUT_SUFFIXED_SEARCHING=1
OS=Windows_NT
PATH=/cygdrive/c/Program Files/Microsoft Visual Studio 8/Common7/IDE:/cygdrive/c/Program Files/Microsoft Visual Studio 8/VC/BIN:/cygdrive/c/Program Files/Microsoft Visual Studio 8/Common7/Tools:/cygdr
ive/c/Program Files/Microsoft Visual Studio 8/SDK/v2.0/bin:/cygdrive/c/WINNT/Microsoft.NET/Framework/v2.0.50727:/cygdrive/c/Program Files/Microsoft Visual Studio 8/VC/VCPackages:/cygdrive/c/APPS/rvct2
2_593/bin:/cygdrive/c/APPS/actperl/bin/:/cygdrive/c/apps/actperl/bin/:/cygdrive/c/apps/ct/bin:/cygdrive/c/apps/ue:/cygdrive/c/Program Files/ThinkPad/Utilities:/cygdrive/c/WINNT/system32:/cygdrive/c/WINNT:/cygdrive/c/WINNT/System32/Wbem:/cygdrive/c/Program Files/ATI Technologies/ATI.ACE/:/cygdrive/c/Program Files/Intel/Wireless/Bin:/cygdrive/c/Program Files/doxygen/bin:/cygdrive/c/PROGRA~1/PuTTY:/:/cygdri
ve/c/APPS/codescanner:/cygdrive/c/APPS/bc:/cygdrive/c/APPS/gracecli/bin:/cygdrive/c/APPS/wget:/cygdrive/c/APPS/ant/bin:/cygdrive/c/Program Files/Microsoft Visual Studio/Common/Tools/WinNT:/cygdrive/c/
Program Files/Microsoft Visual Studio/Common/MSDev98/Bin:/cygdrive/c/Program Files/Microsoft Visual Studio/Common/Tools:/cygdrive/c/Program Files/Microsoft Visual Studio/VC98/bin:/:/usr/bin:/cygdrive/
c/Vim/vim61:/cygdrive/c/Documents and Settings/kundapur/Personal/Ganesh/8086:/cygdrive/c/Program Files/Rational/common:/cygdrive/c/APPS/pclint:/cygdrive/c/APPS/cltools:/cygdrive/c/APPS/7zip:/cygdrive/
c/APPS/cmt:/cygdrive/c/APPS/ctc:/cygdrive/c/APPS/understand/bin/pc-win95:/cygdrive/c/Program Files/QuickTime/QTSystem/:/cygdrive/c/Program Files/Borland/CaliberRM SDK 2005 R2/lib:/cygdrive/c/Program F
iles/Microsoft Visual Studio/Common/Tools/WinNT:/cygdrive/c/Program Files/Microsoft Visual Studio/Common/MSDev98/Bin:/cygdrive/c/Program Files/Microsoft Visual Studio/Common/Tools:/cygdrive/c/Program
Files/Microsoft Visual Studio/VC98/bin
PATHEXT=.COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH;.py;.pyw
PERL=C:\APPS\actperl\bin\perl.exe
PROCESSOR_ARCHITECTURE=x86
PROCESSOR_IDENTIFIER=x86 Family 6 Model 14 Stepping 8, GenuineIntel
PROCESSOR_LEVEL=6
PROCESSOR_REVISION=0e08
PROGRAMFILES=C:\Program Files
PROMPT=$P$G
QTJAVA=C:\Program Files\Java\jre1.5.0_06\lib\ext\QTJava.zip
RATL_RTHOME=C:\Program Files\Rational\Rational Test
SESSIONNAME=Console
SYSTEMDRIVE=C:
SYSTEMROOT=C:\WINNT
TEMP=/cygdrive/c/DOCUME~1/kundapur/LOCALS~1/Temp
TMP=/cygdrive/c/DOCUME~1/kundapur/LOCALS~1/Temp
USERDNSDOMAIN=NOE.NOKIA.COM
USERDOMAIN=NOE
USERNAME=kundapur
USERPROFILE=C:\Documents and Settings\kundapur
VCINSTALLDIR=C:\Program Files\Microsoft Visual Studio 8\VC
VS80COMNTOOLS=C:\Program Files\Microsoft Visual Studio 8\Common7\Tools\
VSINSTALLDIR=C:\Program Files\Microsoft Visual Studio 8
WINDIR=C:\WINNT
TERM=cygwin
HOME=/cygdrive/c/Documents and Settings/kundapur
---
Which is similar to what i get the environement from Visual Studio 2005 Command Prompt.

After running vcvarsall.bat, i'm getting the same error

--
C:\backbuffer\group>vcbuild backbuffer.vcproj
Microsoft (R) Visual C++ Project Builder - Command Line Version 8.00.50727
Copyright (C) Microsoft Corp 1993-2003. All rights reserved.

Build started: Project: backbuffer, Configuration: Debug|Win32
Compiling...
backbufferfactory.cpp
1>c:backbuffer\inc\standardtypes.h(625) : warning C4309: 'initializing' : truncation of constant value
1>c:\backbuffer\inc\standardtypes.h(640) : warning C4309: 'initializing' : truncation of constant value
c:\wxwidgets\include\wx\msw\wrapwin.h(51) : fatal error C1083: Cannot open include file: 'windows.h': No such file or directory
Build log was saved at "file://c:\backbuffer\group\Debug\BuildLog.htm"
backbuffer - 1 error(s), 2 warning(s)
Build started: Project: backbuffer, Configuration: Release|Win32
Compiling...
backbufferfactory.cpp
2>..\..\..\inc\standardtypes.h(625) : warning C4309: 'initializing' : truncation of constant value
2>..\..\..\inc\standardtypes.h(640) : warning C4309: 'initializing' : truncation of constant value
C:\wxWidgets\include\wx/msw/wrapwin.h(51) : fatal error C1083: Cannot open include file: 'windows.h': No such file or directory
Build log was saved at "file://c:\backbuffer\group\Release\BuildLog.htm"
backbuffer - 1 error(s), 2 warning(s)
--


I'm not getting such error if i copy Bin, Include, and lib folder from
C:\Program Files\Microsoft Platform SDK for Windows Server 2003 R2\ to C:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK, even without running the vcvarsall.bat.






Re: Visual C++ Express Edition how to build vc++ express project from the command line

einaros

Notice that "C:\Program Files\Microsoft Platform SDK for Windows Server 2003 R2\include" and \lib isn't added to your include and lib environment settings even after running the vcvars file (which is run by default whan you spawn the vs2005 command prompt). Edit the vcvars file and add both paths.





Re: Visual C++ Express Edition how to build vc++ express project from the command line

Ganesh Kundapur

I'm able to build the same from the IDE without any problem.

How these things(i.e include path, lib path ) are set if i build it from the IDE

I added include path, lib path, etc in IDE from Toos->Option->Project and Solutions->VC++ directories.

How can we get these environment variable when we tried to build from the command line






Re: Visual C++ Express Edition how to build vc++ express project from the command line

einaros

Ganesh Kundapur wrote:
I'm able to build the same from the IDE without any problem.
How these things(i.e include path, lib path ) are set if i build it from the IDE

They are passed to the compiler by the IDE.

Ganesh Kundapur wrote:

I added include path, lib path, etc in IDE from Toos->Option->Project and Solutions->VC++ directories.
How can we get these environment variable when we tried to build from the command line


Add them, as I said in my previous post, to the vcvars32.bat file. There's really not much more to it.





Re: Visual C++ Express Edition how to build vc++ express project from the command line

Ganesh Kundapur

I manually added include path, lib path to INCLUDE, LIB, LIBPATH, BIN environment variables

set PATH=%PATH%;C:\Program Files\Microsoft Platform SDK for Windows Server 2003 R2\bin
set INCLUDE=%PATH%;C:\Program Files\Microsoft Platform SDK for Windows Server 2003 R2\include
set LIB=%LIB%;C:\Program Files\Microsoft Platform SDK for Windows Server 2003 R2\lib
set LIBPATH=%LIBPATH%;C:\Program Files\Microsoft Platform SDK for Windows Server 2003 R2\LIB

still the same problem ( windows.h no such file or directory ) persists!!!





Re: Visual C++ Express Edition how to build vc++ express project from the command line

einaros

So if you, from within the same command prompt, list the environment variables, the sdk folders are there





Re: Visual C++ Express Edition how to build vc++ express project from the command line

Ganesh Kundapur

Yes, they are set within the same command prompt
--
C:\backbuffer\group>echo %INCLUDE%
C:\Program Files\Microsoft Visual Studio 8\VC\INCLUDE;C:\Program Files\Microsoft Visual Studio\VC98\atl\include;C:\Program Files\Microsoft Visual Studio\VC98\mfc\include;C:\Program Files\Microsoft Vis
ual Studio\VC98\include:C:\Program Files\Microsoft Platform SDK for Windows Server 2003 R2\include

C:\backbuffer\group>ECHO %LIB%
C:\Program Files\Microsoft Visual Studio 8\VC\LIB;C:\Program Files\Microsoft Visual Studio 8\SDK\v2.0\lib;C:\Program Files\Microsoft Visual Studio\VC98\mfc\lib;C:\Program Files\Microsoft Visual Studio
\VC98\lib:C:\Program Files\Microsoft Platform SDK for Windows Server 2003 R2\lib

C:\backbuffer\group>path
PATH=C:\Program Files\Microsoft Visual Studio 8\Common7\IDE;C:\Program Files\Microsoft Visual Studio 8\VC\BIN;C:\Program Files\Microsoft Visual Studio 8\Common7\Tools;C:\Program Files\Microsoft Visual
Studio 8\SDK\v2.0\bin;C:\WINNT\Microsoft.NET\Framework\v2.0.50727;C:\Program Files\Microsoft Visual Studio 8\VC\VCPackages;C:\ProgramFiles\ThinkPad\Utilities;C:\WINNT\system32;C:\WINNT;C:\WINNT\System32\Wbem;c:\Program Files\ATI Technologies\ATI.ACE\;C:\Program Files\Intel\Wireless\Bin;C:\Program Files\doxygen\bin;C:\PROGRA~1\PuTTY;C:\cygwin;C:\Program Fi
les\Microsoft Visual Studio\Common\Tools\WinNT;C:\Program Files\Microsoft Visual Studio\Common\MSDev98\Bin;C:\Program Files\Microsoft Visual Studio\Common\Tools;C:\Program Files\Microsoft Visual Studi
o\VC98\bin;C:\cygwin;C:\cygwin\bin;C:\Vim\vim61;C:\Documents and Settings\kundapur\Personal\Ganesh\8086;C:\Program Files\Rational\common;C:\Program Files\QuickTime\QTSystem\;C:\Program Files\Microsoft Visual Studio\Common\Tools\WinNT;C:\Program File
s\Microsoft Visual Studio\Common\MSDev98\Bin;C:\Program Files\Microsoft Visual Studio\Common\Tools;C:\Program Files\Microsoft Visual Studio\VC98\bin:C:\Program Files\Microsoft Platform SDK for Windows
Server 2003 R2\bin:C:\Program Files\Microsoft Platform SDK for Windows Server 2003 R2\bin

C:\backbuffer\group>ECHO %LIBPATH%
C:\WINNT\Microsoft.NET\Framework\v2.0.50727:C:\Program Files\Microsoft Platform SDK for Windows Server 2003 R2\lib






Re: Visual C++ Express Edition how to build vc++ express project from the command line

einaros

Ganesh Kundapur wrote:
Yes, they are set within the same command prompt
--
C:\backbuffer\group>echo %INCLUDE%
C:\Program Files\Microsoft Visual Studio 8\VC\INCLUDE;C:\Program Files\Microsoft Visual Studio\VC98\atl\include;C:\Program Files\Microsoft Visual Studio\VC98\mfc\include;C:\Program Files\Microsoft Vis
ual Studio\VC98\include:C:\Program Files\Microsoft Platform SDK for Windows Server 2003 R2\include


That's not a semicolon, so the path will be invalid.





Re: Visual C++ Express Edition how to build vc++ express project from the command line

Ganesh Kundapur

They are saperated by semicolon only. Thats just a typo mistake.

--
C:\backbuffer\group>echo %INCLUDE%
C:\Program Files\Microsoft Visual Studio 8\VC\INCLUDE;C:\Program Files\Microsoft Visual Studio\VC98\atl\include;C:\Program Files\Microsoft Visual Studio\VC98\mfc\include;C:\Program Files\Microsoft Vis
ual Studio\VC98\include;C:\Program Files\Microsoft Platform SDK for Windows Server 2003 R2\include

C:\backbuffer\group>vcbuild backbuffer.vcproj
Microsoft (R) Visual C++ Project Builder - Command Line Version 8.00.50727
Copyright (C) Microsoft Corp 1993-2003. All rights reserved.

Build started: Project: backbuffer, Configuration: Debug|Win32
Compiling...
backbufferfactory.cpp
1>c:..\inc\standardtypes.h(625) : warning C4309: 'initializing' : truncation of constant value
1>c:..\inc\standardtypes.h(640) : warning C4309: 'initializing' : truncation of constant value
c:\wxwidgets\include\wx\msw\wrapwin.h(51) : fatal error C1083: Cannot open include file: 'windows.h': No such file or directory
Build log was saved at "file://c:\backbuffer\group\Debug\BuildLog.htm"
backbuffer - 1 error(s), 2 warning(s)
Build started: Project: backbuffer, Configuration: Release|Win32
Compiling...
backbufferfactory.cpp
2>..\..\..\inc\standardtypes.h(625) : warning C4309: 'initializing' : truncation of constant value
2>..\..\..\inc\standardtypes.h(640) : warning C4309: 'initializing' : truncation of constant value
C:\wxWidgets\include\wx/msw/wrapwin.h(51) : fatal error C1083: Cannot open include file: 'windows.h': No such file or directory
Build log was saved at "file://c:\backbuffer\group\Release\BuildLog.htm"
backbuffer - 1 error(s), 2 warning(s)





Re: Visual C++ Express Edition how to build vc++ express project from the command line

einaros

Add /useenv to your vcbuild string.





Re: Visual C++ Express Edition how to build vc++ express project from the command line

Ganesh Kundapur

compilation is done by passing /useenv to vcbuild, but it pops up fallowing message
for Release & Debug builds.
--
NOTE: WINVER has been defined as 0x0500 or greater which enables
Windows NT 5.0 and Windows 98 features. When these headers were released,
Windows NT 5.0 beta 1 and Windows 98 beta 2.1 were the current versions.
For this release when WINVER is defined as 0x0500 or greater, you can only
build beta or test applications. To build a retail application,
set WINVER to 0x0400 or visit http://www.microsoft.com/msdn/sdk
to see if retail Windows NT 5.0 or Windows 98 headers are available.
See the SDK release notes for more information.
--

Moreover, when i build from the command line, it builds for both Debug and Release.

Is it possible to build only either Debug|Win32 or Release|Win32 based on configuration and by default it should
build debug version

Logs
--
C:\backbuffer\group>vcbuild /useenv backbuffer.vcproj
Microsoft (R) Visual C++ Project Builder - Command Line Version 8.00.50727
Copyright (C) Microsoft Corp 1993-2003. All rights reserved.

Build started: Project: backbuffer, Configuration: Debug|Win32
Compiling...
backbufferbitmap.cpp
1>c:\..\inc\standardtypes.h(625) : warning C4309: 'initializing' : truncation of constant value
1>c:\..\inc\standardtypes.h(640) : warning C4309: 'initializing' : truncation of constant value
backbufferfactory.cpp
1>c:\..\inc\standardtypes.h(625) : warning C4309: 'initializing' : truncation of constant value
1>c:\..\inc\standardtypes.h(640) : warning C4309: 'initializing' : truncation of constant value
NOTE: WINVER has been defined as 0x0500 or greater which enables
Windows NT 5.0 and Windows 98 features. When these headers were released,
Windows NT 5.0 beta 1 and Windows 98 beta 2.1 were the current versions.
For this release when WINVER is defined as 0x0500 or greater, you can only
build beta or test applications. To build a retail application,
set WINVER to 0x0400 or visit http://www.microsoft.com/msdn/sdk
to see if retail Windows NT 5.0 or Windows 98 headers are available.
See the SDK release notes for more information.
1>c:\..\inc\system_event_handler.h(74) : warning C4091: '__declspec(dllexport)' : ignored on left of 'SystemEventHandler' when no variable is declared
backbufferimplementation.cpp
1>c:\..\inc\standardtypes.h(625) : warning C4309: 'initializing' : truncation of constant value
1>c:\..\inc\standardtypes.h(640) : warning C4309: 'initializing' : truncation of constant value
centralbackbufferfactory.cpp
1>c:\..\inc\standardtypes.h(625) : warning C4309: 'initializing' : truncation of constant value
1>c:\..\inc\standardtypes.h(640) : warning C4309: 'initializing' : truncation of constant value
colorconversion.cpp
1>c:\..\inc\standardtypes.h(625) : warning C4309: 'initializing' : truncation of constant value
1>c:\..\inc\standardtypes.h(640) : warning C4309: 'initializing' : truncation of constant value
frame_buffer.cpp
frontbuffer.cpp
1>c:\..\inc\standardtypes.h(625) : warning C4309: 'initializing' : truncation of constant value
1>c:\..\inc\standardtypes.h(640) : warning C4309: 'initializing' : truncation of constant value
Generating Code...
Linking...
backbufferbitmap.obj : warning LNK4075: ignoring '/EDITANDCONTINUE' due to '/INCREMENTAL:NO' specification
Creating library .\Debug/ngibackbuffer.lib and object .\Debug/ngibackbuffer.exp
Embedding manifest...
Build log was saved at "file://c:\backbuffer\group\Debug\BuildLog.htm"
backbuffer - 0 error(s), 14 warning(s)
Build started: Project: backbuffer, Configuration: Release|Win32
Compiling...
frontbuffer.cpp
2>..\inc\standardtypes.h(625) : warning C4309: 'initializing' : truncation of constant value
2>..\inc\standardtypes.h(640) : warning C4309: 'initializing' : truncation of constant value
frame_buffer.cpp
colorconversion.cpp
2>..\inc\standardtypes.h(625) : warning C4309: 'initializing' : truncation of constant value
2>..\inc\standardtypes.h(640) : warning C4309: 'initializing' : truncation of constant value
centralbackbufferfactory.cpp
2>..\inc\standardtypes.h(625) : warning C4309: 'initializing' : truncation of constant value
2>.\..\inc\standardtypes.h(640) : warning C4309: 'initializing' : truncation of constant value
backbufferimplementation.cpp
2>..\inc\standardtypes.h(625) : warning C4309: 'initializing' : truncation of constant value
2>..\inc\standardtypes.h(640) : warning C4309: 'initializing' : truncation of constant value
backbufferfactory.cpp
2>..\inc\standardtypes.h(625) : warning C4309: 'initializing' : truncation of constant value
2>..\inc\standardtypes.h(640) : warning C4309: 'initializing' : truncation of constant value
NOTE: WINVER has been defined as 0x0500 or greater which enables
Windows NT 5.0 and Windows 98 features. When these headers were released,
Windows NT 5.0 beta 1 and Windows 98 beta 2.1 were the current versions.
For this release when WINVER is defined as 0x0500 or greater, you can only
build beta or test applications. To build a retail application,
set WINVER to 0x0400 or visit http://www.microsoft.com/msdn/sdk
to see if retail Windows NT 5.0 or Windows 98 headers are available.
See the SDK release notes for more information.
2>..\inc\system_event_handler.h(74) : warning C4091: '__declspec(dllexport)' : ignored on left of 'SystemEventHandler' when no variable is declared
backbufferbitmap.cpp
2>..\inc\standardtypes.h(625) : warning C4309: 'initializing' : truncation of constant value
2>..\inc\standardtypes.h(640) : warning C4309: 'initializing' : truncation of constant value
Generating Code...
Linking...
Creating library .\Release/ngibackbuffer.lib and object .\Release/ngibackbuffer.exp
Embedding manifest...
Build log was saved at "file://c:\backbuffer\group\Release\BuildLog.htm"
backbuffer - 0 error(s), 13 warning(s)




Re: Visual C++ Express Edition how to build vc++ express project from the command line

einaros

Pass the name of the configuration you wish to build as the final parameter to vcbuild. As for the warning, this could mean that the headers from the platform sdk you installed aren't the ones used. Try moving them to the front of the include / lib environment strings.