I tried to build vapor 2.2.4 from its source using Visual Studio 2010. I've read the installation documentation and do all the necessary configurations before building the source. However I still got some build errors in project vdf and all of them are C2440. Could someone help, thanks.
The build output messages of project vdf are:
1>------ Build started: Project: udunits2, Configuration: Debug Win32 ------
2>------ Build started: Project: common, Configuration: Debug Win32 ------
2> Version.cpp
2> PVTime.cpp
1> xml.c
1> ut_free_system.c
1> unitToIdMap.c
1> unitcore.c
1>d:\projects\vapor\vapor-2.2.4-src\lib\udunits2\unitcore.c(3776): warning C4028: formal parameter 1 different from declaration
1> unitAndId.c
1> tsearch.c
1> systemMap.c
1>d:\projects\vapor\vapor-2.2.4-src\lib\udunits2\systemmap.c(99): warning C4090: 'function' : different 'const' qualifiers
1> status.c
1> prefix.c
1> parser.c
1>parser.c(395): warning C4273: 'malloc' : inconsistent dll linkage
1> c:\program files (x86)\microsoft visual studio 10.0\vc\include\stdlib.h(600) : see previous definition of 'malloc'
1>parser.c(402): warning C4273: 'free' : inconsistent dll linkage
1> c:\program files (x86)\microsoft visual studio 10.0\vc\include\stdlib.h(599) : see previous definition of 'free'
1>parser.c(1407): warning C4013: 'utlex' undefined; assuming extern returning int
1>parser.y(262): warning C4013: 'utGetPrefixByName' undefined; assuming extern returning int
1>parser.y(269): warning C4013: 'utGetPrefixBySymbol' undefined; assuming extern returning int
1>(1767): warning C4003: not enough actual parameters for macro 'utwrap'
1>(2141): warning C4003: not enough actual parameters for macro 'utwrap'
1>parser.y(561): warning C4090: 'function' : different 'const' qualifiers
1> idToUnitMap.c
1> formatter.c
1> error.c
1> converter.c
1> Generating Code...
2> OptionParser.cpp
1>LINK : warning LNK4075: ignoring '/INCREMENTAL' due to '/LTCG' specification
1> Creating library ../../../targets/win32/bin/render.lib and object ../../../targets/win32/bin/render.exp
1> LINK : /LTCG specified but no code generation required; remove /LTCG from the link command line to improve linker performance
2> MyBase.cpp
1>LINK : warning LNK4075: ignoring '/INCREMENTAL' due to '/LTCG' specification
1> Creating library ../../../targets/win32/bin/render.lib and object ../../../targets/win32/bin/render.exp
1> LINK : /LTCG specified but no code generation required; remove /LTCG from the link command line to improve linker performance
1> udunits2.vcxproj -> D:\Projects\vapor\vapor-2.2.4-src\make\win32\udunits2\..\..\..\targets\win32\bin\udunits2.dll
2> GetAppPath.cpp
2> EasyThreads.cpp
2> common.cpp
2> CFuncs.cpp
2> Base64.cpp
2> Generating Code...
2>Base64.obj : warning LNK4075: ignoring '/EDITANDCONTINUE' due to '/INCREMENTAL:NO' specification
2> Creating library ../../../targets/win32/bin/common.lib and object ../../../targets/win32/bin/common.exp
2> common.vcxproj -> D:\Projects\vapor\vapor-2.2.4-src\make\win32\common\..\..\..\targets\win32\bin\common.dll
3>------ Build started: Project: vdf, Configuration: Debug Win32 ------
3>cl : Command line warning D9035: option 'Wp64' has been deprecated and will be removed in a future release
3> WaveCodecIO.cpp
3>c:\program files (x86)\microsoft visual studio 10.0\vc\include\vector(979): error C2440: '-' : cannot convert from 'unsigned int *' to 'const size_t *'
3> c:\program files (x86)\microsoft visual studio 10.0\vc\include\vector(976) : while compiling class template member function 'void std::vector<_Ty>::push_back(const _Ty &)'
3> with
3> [
3> _Ty=size_t
3> ]
3> d:\projects\vapor\vapor-2.2.4-src\include\vapor\metadata.h(103) : see reference to class template instantiation 'std::vector<_Ty>' being compiled
3> with
3> [
3> _Ty=size_t
3> ]
3> WRF.cpp
3>c:\program files (x86)\microsoft visual studio 10.0\vc\include\vector(979): error C2440: '-' : cannot convert from 'unsigned int *' to 'const size_t *'
3> c:\program files (x86)\microsoft visual studio 10.0\vc\include\vector(976) : while compiling class template member function 'void std::vector<_Ty>::push_back(const _Ty &)'
3> with
3> [
3> _Ty=size_t
3> ]
3> d:\projects\vapor\vapor-2.2.4-src\include\vapor\wrf.h(27) : see reference to class template instantiation 'std::vector<_Ty>' being compiled
3> with
3> [
3> _Ty=size_t
3> ]
3> VDCFactory.cpp
3>c:\program files (x86)\microsoft visual studio 10.0\vc\include\vector(979): error C2440: '-' : cannot convert from 'unsigned int *' to 'const size_t *'
3> c:\program files (x86)\microsoft visual studio 10.0\vc\include\vector(976) : while compiling class template member function 'void std::vector<_Ty>::push_back(const _Ty &)'
3> with
3> [
3> _Ty=size_t
3> ]
3> d:\projects\vapor\vapor-2.2.4-src\include\vapor\metadata.h(103) : see reference to class template instantiation 'std::vector<_Ty>' being compiled
3> with
3> [
3> _Ty=size_t
3> ]
3> SignificanceMap.cpp
3>c:\program files (x86)\microsoft visual studio 10.0\vc\include\vector(979): error C2440: '-' : cannot convert from 'unsigned int *' to 'const size_t *'
3> c:\program files (x86)\microsoft visual studio 10.0\vc\include\vector(976) : while compiling class template member function 'void std::vector<_Ty>::push_back(const _Ty &)'
3> with
3> [
3> _Ty=size_t
3> ]
3> d:\projects\vapor\vapor-2.2.4-src\include\vapor\significancemap.h(302) : see reference to class template instantiation 'std::vector<_Ty>' being compiled
3> with
3> [
3> _Ty=size_t
3> ]
3> NetCDFSimple.cpp
3>c:\program files (x86)\microsoft visual studio 10.0\vc\include\vector(979): error C2440: '-' : cannot convert from 'unsigned int *' to 'const size_t *'
3> c:\program files (x86)\microsoft visual studio 10.0\vc\include\vector(976) : while compiling class template member function 'void std::vector<_Ty>::push_back(const _Ty &)'
3> with
3> [
3> _Ty=size_t
3> ]
3> d:\projects\vapor\vapor-2.2.4-src\include\vapor\netcdfsimple.h(144) : see reference to class template instantiation 'std::vector<_Ty>' being compiled
3> with
3> [
3> _Ty=size_t
3> ]
3> NetCDFCollection.cpp
3>c:\program files (x86)\microsoft visual studio 10.0\vc\include\vector(979): error C2440: '-' : cannot convert from 'unsigned int *' to 'const size_t *'
3> c:\program files (x86)\microsoft visual studio 10.0\vc\include\vector(976) : while compiling class template member function 'void std::vector<_Ty>::push_back(const _Ty &)'
3> with
3> [
3> _Ty=size_t
3> ]
3> d:\projects\vapor\vapor-2.2.4-src\include\vapor\netcdfsimple.h(144) : see reference to class template instantiation 'std::vector<_Ty>' being compiled
3> with
3> [
3> _Ty=size_t
3> ]
3> MetadataVDC.cpp
3>c:\program files (x86)\microsoft visual studio 10.0\vc\include\vector(979): error C2440: '-' : cannot convert from 'unsigned int *' to 'const size_t *'
3> c:\program files (x86)\microsoft visual studio 10.0\vc\include\vector(976) : while compiling class template member function 'void std::vector<_Ty>::push_back(const _Ty &)'
3> with
3> [
3> _Ty=size_t
3> ]
3> d:\projects\vapor\vapor-2.2.4-src\include\vapor\metadata.h(103) : see reference to class template instantiation 'std::vector<_Ty>' being compiled
3> with
3> [
3> _Ty=size_t
3> ]
3> DataMgrWC.cpp
3>c:\program files (x86)\microsoft visual studio 10.0\vc\include\vector(979): error C2440: '-' : cannot convert from 'unsigned int *' to 'const size_t *'
3> c:\program files (x86)\microsoft visual studio 10.0\vc\include\vector(976) : while compiling class template member function 'void std::vector<_Ty>::push_back(const _Ty &)'
3> with
3> [
3> _Ty=size_t
3> ]
3> d:\projects\vapor\vapor-2.2.4-src\include\vapor\blkmemmgr.h(82) : see reference to class template instantiation 'std::vector<_Ty>' being compiled
3> with
3> [
3> _Ty=size_t
3> ]
3> DataMgrFactory.cpp
3>c:\program files (x86)\microsoft visual studio 10.0\vc\include\vector(979): error C2440: '-' : cannot convert from 'unsigned int *' to 'const size_t *'
3> c:\program files (x86)\microsoft visual studio 10.0\vc\include\vector(976) : while compiling class template member function 'void std::vector<_Ty>::push_back(const _Ty &)'
3> with
3> [
3> _Ty=size_t
3> ]
3> d:\projects\vapor\vapor-2.2.4-src\include\vapor\blkmemmgr.h(82) : see reference to class template instantiation 'std::vector<_Ty>' being compiled
3> with
3> [
3> _Ty=size_t
3> ]
3> DataMgr.cpp
3>d:\projects\vapor\vapor-2.2.4-src\lib\vdf\datamgr.cpp(511): warning C4800: 'int' : forcing value to bool 'true' or 'false' (performance warning)
3>c:\program files (x86)\microsoft visual studio 10.0\vc\include\vector(979): error C2440: '-' : cannot convert from 'unsigned int *' to 'const size_t *'
3> c:\program files (x86)\microsoft visual studio 10.0\vc\include\vector(976) : while compiling class template member function 'void std::vector<_Ty>::push_back(const _Ty &)'
3> with
3> [
3> _Ty=size_t
3> ]
3> d:\projects\vapor\vapor-2.2.4-src\include\vapor\blkmemmgr.h(82) : see reference to class template instantiation 'std::vector<_Ty>' being compiled
3> with
3> [
3> _Ty=size_t
3> ]
3> DCReaderNCDF.cpp
3>c:\program files (x86)\microsoft visual studio 10.0\vc\include\vector(979): error C2440: '-' : cannot convert from 'unsigned int *' to 'const size_t *'
3> c:\program files (x86)\microsoft visual studio 10.0\vc\include\vector(976) : while compiling class template member function 'void std::vector<_Ty>::push_back(const _Ty &)'
3> with
3> [
3> _Ty=size_t
3> ]
3> d:\projects\vapor\vapor-2.2.4-src\include\vapor\netcdfsimple.h(144) : see reference to class template instantiation 'std::vector<_Ty>' being compiled
3> with
3> [
3> _Ty=size_t
3> ]
3> Compressor.cpp
3>c:\program files (x86)\microsoft visual studio 10.0\vc\include\vector(979): error C2440: '-' : cannot convert from 'unsigned int *' to 'const size_t *'
3> c:\program files (x86)\microsoft visual studio 10.0\vc\include\vector(976) : while compiling class template member function 'void std::vector<_Ty>::push_back(const _Ty &)'
3> with
3> [
3> _Ty=size_t
3> ]
3> d:\projects\vapor\vapor-2.2.4-src\include\vapor\significancemap.h(302) : see reference to class template instantiation 'std::vector<_Ty>' being compiled
3> with
3> [
3> _Ty=size_t
3> ]
3> BlkMemMgr.cpp
3>c:\program files (x86)\microsoft visual studio 10.0\vc\include\vector(979): error C2440: '-' : cannot convert from 'unsigned int *' to 'const size_t *'
3> c:\program files (x86)\microsoft visual studio 10.0\vc\include\vector(976) : while compiling class template member function 'void std::vector<_Ty>::push_back(const _Ty &)'
3> with
3> [
3> _Ty=size_t
3> ]
3> d:\projects\vapor\vapor-2.2.4-src\include\vapor\blkmemmgr.h(82) : see reference to class template instantiation 'std::vector<_Ty>' being compiled
3> with
3> [
3> _Ty=size_t
3> ]
3> Generating Code...
========== Build: 2 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
Would you please try to build the x64 configuration, instead of win32? (unless of course you do not have a 64-bit windows installed). I think the projects and instructions are currently set to only build 64-bit on windows.
-Alan
Thanks a lot for your quick reply. I change the solution configuration to x64 and this time the compiler errors are gone. However, there is a couple of link errors that the .map files cannot be opened. I check these files and they are there. I guess the directory is not set up correctly and find no where to modify the related configuration. Here is the error message when building project vdf:
1>------ Build started: Project: udunits2, Configuration: Debug x64 ------
2>------ Build started: Project: common, Configuration: Debug x64 ------
1> udunits2.vcxproj -> D:\Projects\vapor\vapor-2.2.4-src\make\win32\udunits2\..\..\..\targets\win64\bin\udunits2.dll
2> Creating library ../../../targets/win64/bin/common.lib and object ../../../targets/win64/bin/common.exp
2> common.vcxproj -> D:\Projects\vapor\vapor-2.2.4-src\make\win32\common\..\..\..\targets\win64\bin\common.dll
2> common.vcxproj -> D:\Projects\vapor\vapor-2.2.4-src\make\win32\common\..\..\..\targets\win64\bin\common.dll
3>------ Build started: Project: vdf, Configuration: Debug x64 ------
3> Creating library ../../../targets/win64/bin/vdf.lib and object ../../../targets/win64/bin/vdf.exp
3> vdf.vcxproj -> D:\Projects\vapor\vapor-2.2.4-src\make\win32\vdf\..\..\..\targets\win64\bin\vdf.dll
3> Creating library ../../../targets/win64/bin/vdf.lib and object ../../../targets/win64/bin/vdf.exp
3>LINK : fatal error LNK1104: cannot open file '../../../targets/win64/bin/vdf.map'
========== Build: 2 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
Yes, I have seen those errors about the map files. You should build those projects again (but don't rebuild!) and the errors will go away. I think there is something wrong with the project file setup but I haven't figured out how to avoid these errors. Let me know if you see any way to avoid the errors.
-Alan
I believe that the latest error may be a consequence of doing a parallel build. In the visual studio menu Tools->Options under Projects and Solutions, you can limit the number of parallel project builds to 1.
-Alan
Thank you very much. Now the build is successful. But I found a strange problem. Every time I started debugging vaporgui, the build process always started to check if something need to be rebuilt. Although it did not compile the code, it did waste some time. Any idea to fix this issue?
Yulq, is parallel project building enabled? This seems to be a known issue in VS2010, where a race condition is generated by threads trying to access a given log file.
More info here: http://social.msdn.microsoft.com/Forums/vstudio/en-US/caffd893-3d5c-495e...
I believe that setting the 'maximum number of parallel project builds' field to 1 will fix this problem. This is under Tools->Options->Projects and Solutions->Build and Run. If this does not work or if you've already tried it, please let us know.
Reduce the number of parallel builds to 1 fix the issue. Thank you all your guys.