Trying to build GDAL from github using Visual Studio 2019 v16.6.5 on Windows 10 x64 - c++

I want to use Visual Studio 2019 to build GDAL. But I keep getting errors when trying to build.
The computer I'm using is Acer Aspire f 15 F5573G-72CP,
CPU is i7 7500U 2.7GHz, RAM is 16GB, OS is Windows 10 64 bit
Steps I've taken are:
Download Visual Studio Community, included .NET desktop development, Universal Windows Platform development, Desktop development with C++ and Node.js development.
Used GIT BASH from git for windows to pull the repo https://github.com/OSGeo/GDAL.git and located it c:/gdal
in c:/gdal/GDAL/nmake.opt:
3.a. changed line 42 to Line 42: MSVC_VER=1926
3.b. I uncommented line 260:
Line 259: # PROJ stuff (required dependency: PROJ >= 6)
Line 260: PROJ_INCLUDE = -Id:\install-proj\local\include
3.c. Uncommented line 213: Line 213: WIN64=YES
Also pulled the repo: https://github.com/OSGeo/PROJ.git located at c:/proj/PROJ
Using Windows Powershell, cd c:/gdal/gdal -> generate_vcxproj.bat 16.0 64 gdal_vs2019
which outputs the following:
PS C:\gdal\gdal> .\generate_vcxproj.bat 16.0 64 gdal_vs2019
The system cannot find the path specified.
Generating:
"C:\gdal\gdal\gdal_vs2019.vcxproj"
"C:\gdal\gdal\gdal_vs2019.vcxproj.user"
"C:\gdal\gdal\gdal_vs2019.vcxproj.filters"
"C:\gdal\autotest\cpp\gdal_vs2019_test.vcxproj"
"C:\gdal\autotest\cpp\gdal_vs2019_test.vcxproj.user"
"C:\gdal\autotest\cpp\gdal_vs2019_test.vcxproj.filters"
This might take a little while...
Projects done!
Launch Visual Studio IDE
* Open project "C:\gdal\gdal\gdal_vs2019.vcxproj"
* Add project "C:\gdal\autotest\cpp\gdal_vs2019_test.vcxproj"
* Configure Build Dependencies to build the main project before the test project.
* Save solution in .sln file
Done!
PS C:\gdal\gdal>
Open Visual Studio 2019, open a project or solution, select C:\gdal\gdal\gdal_vs2019.vcxproj, ensure Solution Platforms dropdown is set to x64, Build->Build Solution, which returns three errors:
Severity Code Description Project File Line Suppression State
Error U1077 'call' : return code '0x1' gdal_vs2019 C:\gdal\gdal\NMAKE 1
Severity Code Description Project File Line Suppression State
Error U1077 '"C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.26.28801\bin\HostX86\x64\nmake.EXE"' : return code '0x2' gdal_vs2019 C:\gdal\gdal\NMAKE 1
Severity Code Description Project File Line Suppression State
Error MSB3073 The command "chcp 65001 >NUL && nmake -f makefile.vc MSVC_VER=1926 WIN64=1 DEBUG=1 WITH_PDB=1" exited with code 2. gdal_vs2019 C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Microsoft\VC\v160\Microsoft.MakeFile.Targets 46
The Output tab shows:
1>------ Build started: Project: gdal_vs2019, Configuration: Debug x64 ------
1>
1>Microsoft (R) Program Maintenance Utility Version 14.26.28806.0
1>Copyright (C) Microsoft Corporation. All rights reserved.
1>
1> cd port
1> nmake /nologo /f makefile.vc
1> call prev_dllbuild.bat
1>The system cannot find the path specified.
1>
1>C:\gdal\gdal\port>IF NOT EXIST dllbuild.prev (ECHO 1 ) 1>dllbuild.prev
1>
1>C:\gdal\gdal\port>SET /P PREV_DLLBUILD= 0<dllbuild.prev
1>
1>C:\gdal\gdal\port>IF NOT "1" == "1" (ECHO 1 ) 1>dllbuild.prev
1>NMAKE : fatal error U1077: 'call' : return code '0x1'
1>Stop.
1>NMAKE : fatal error U1077: '"C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.26.28801\bin\HostX86\x64\nmake.EXE"' : return code '0x2'
1>Stop.
1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Microsoft\VC\v160\Microsoft.MakeFile.Targets(46,5): error MSB3073: The command "chcp 65001 >NUL && nmake -f makefile.vc MSVC_VER=1926 WIN64=1 DEBUG=1 WITH_PDB=1" exited with code 2.
1>Done building project "gdal_vs2019.vcxproj" -- FAILED.
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
How should I address these errors to get GDAL built successfully?

This is a little late, but have you tried the following:
Read https://trac.osgeo.org/gdal/wiki/BuildingOnWindows
Read https://trac.osgeo.org/gdal/wiki/BuildHints for specific
needs/dependencies/drivers
Get all the dependencies you need
Edit nmake.opt to disable/enable features/drivers you don't
need
Run NMAKE
You could also try cleaning:
nmake /f makefile.vc clean
nmake /f makefile.vc
Finally, you could try building on a different computer.

Hark, this is the way one should ask questions: clear, precise steps, detailed description. Very helpful!
I could compile when I didn't use the GIT repo. Instead I downloaded PROJ following their Windows installation documentation:
The simplest way to install PROJ on Windows is to use the OSGeo4W_
software distribution. OSGeo4W provides easy access to many popular
open source geospatial software packages. After installation you can
use PROJ from the OSGeo4W shell. To install PROJ do the following:
note::
If you have already installed software via OSGeo4W on your computer, or if
you have already installed QGIS on your computer, it is likely that PROJ is
already installed. Type "OSGeo4W Shell" in your start menu and check whether
that gives a match.
Download either the 32 bit or 64 bit installer.
Run the OSGeo4W setup program.
Select "Advanced Install" and press Next.
Select "Install from Internet" and press Next.
Select a installation directory. The default suggestion is fine in most cases. Press Next.
Select "Local package directory". The default suggestion is fine in most cases. Press Next.
Select "Direct connection" and press Next.
Choose the download.osgeo.org server and press Next.
Find "proj" under "Commandline_Utilities" and click the package in the "New" column until the version you want to install appears.
Press next to install PROJ.
I downloaded the installers from osgeo4W. Because I needed both 32 and 64 bit versions I downloaded osgeo4w-setup-x86-v1.exe and osgeo4w-setup-x86_64-v1.exe. The download got stuck after 25% when downloading the big proj-file from osgeo, so I selected the oslandia download link instead. This initially fails (at least for me), but after restart it could finish.
In the download package selection click on the "Skip" logo to select binary ("B") and source ("S"). I selected both. I downloaded "proj", "proj-dev" and "proj-dev-data", not sure what is actually neeeded. When it asked to include dependencies (a lot), I selected to include them.
In the nmake.opt (your step 3) I used for the 32 bit:
PROJ_INCLUDE = -IC:\OSGeo4W\include
PROJ_LIBRARY = C:\OSGeo4W\lib\proj.lib
and for the 64 bit:
PROJ_INCLUDE = -IC:\OSGeo4W64\include
PROJ_LIBRARY = C:\OSGeo4W64\lib\proj.lib
For running the generate_vcxproj.bat, I used Visual Studio 2022 x86 and x64 native tool command prompts. In the bat-file I changed:
if "%_vcver_%"=="16.0" (
set _clver_=1926
set _vstoolset_=v143
And in the nmake.opt:
MSVC_VER=1929
I run the bat separately for 64 and 32 bits:
generate_vcxproj.bat 16.0 64 gdal_vs2022
generate_vcxproj.bat 16.0 32 gdal_vs2022_x86
After this step I could open the vcxproj-files in Visual Studio and compile the libraries. I used the genererated gdal_i.lib's and accompanying gdal303.dll's in my project.

Related

Build error with new UE5.1 project in Rider

I am just getting started with C++ in UE5.1. I am using Rider 2022.3.1
Upon trying to build the project in Rider, I get the following error:
C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Microsoft\VC\v170\Microsoft.MakeFile.Targets(44,5): error MSB3073: The command "D:\UE_5.1\Engine\Build\BatchFiles\Build.bat R2NAlaskaEditor Win64 Development -Project="C:\Users\..........R2NAlaska.uproject" -WaitMutex -FromMsBuild" exited with code 6. [C:\Users.....\R2NAlaska\Intermediate\ProjectFiles\R2NAlaska.vcxproj]
I've tried nuking the intermediate and VS folders and rebuilding the solution with no effect.
Here is the full build log:
Build started 1/28/2023 9:09:02 AM.
Logging verbosity is set to: Normal.Project "C:\Users\javor\Desktop\R2NAlaska\R2NAlaska.sln" on node 1 (Games\R2NAlaska target(s)).
ValidateSolutionConfiguration:
Building solution configuration "Development Editor|Win64".
ValidateProjects:
The project "UE5" is not selected for building in solution configuration "Development Editor|Win64".
Project "C:\Users\javor\Desktop\R2NAlaska\R2NAlaska.sln" (1) is building "C:\Users\javor\Desktop\R2NAlaska\Intermediate\ProjectFiles\R2NAlaska.vcxproj" (2) on node 1 (default targets).
Build:
D:\UE_5.1\Engine\Build\BatchFiles\Build.bat R2NAlaskaEditor Win64 Development -Project="C:\Users\javor\Desktop\R2NAlaska\R2NAlaska.uproject" -WaitMutex -FromMsBuild
Running UnrealBuildTool: dotnet "..\..\Engine\Binaries\DotNET\UnrealBuildTool\UnrealBuildTool.dll" R2NAlaskaEditor Win64 Development -Project="C:\Users\javor\Desktop\R2NAlaska\R2NAlaska.uproject" -WaitMutex -FromMsBuild
Log file: C:\Users\javor\AppData\Local\UnrealBuildTool\Log.txt
Unable to build while Live Coding is active. Exit the editor and game, or press Ctrl+Alt+F11 if iterating on code in the editor or game
C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Microsoft\VC\v170\Microsoft.MakeFile.Targets(44,5): error MSB3073: The command "D:\UE_5.1\Engine\Build\BatchFiles\Build.bat R2NAlaskaEditor Win64 Development -Project="C:\Users\javor\Desktop\R2NAlaska\R2NAlaska.uproject" -WaitMutex -FromMsBuild" exited with code 6. [C:\Users\javor\Desktop\R2NAlaska\Intermediate\ProjectFiles\R2NAlaska.vcxproj]
Done Building Project "C:\Users\javor\Desktop\R2NAlaska\Intermediate\ProjectFiles\R2NAlaska.vcxproj" (default targets) -- FAILED.
Done Building Project "C:\Users\javor\Desktop\R2NAlaska\R2NAlaska.sln" (Games\R2NAlaska target(s)) -- FAILED.
Build FAILED.
"C:\Users\javor\Desktop\R2NAlaska\R2NAlaska.sln" (Games\R2NAlaska target) (1) ->
"C:\Users\javor\Desktop\R2NAlaska\Intermediate\ProjectFiles\R2NAlaska.vcxproj" (default target) (2) ->
(Build target) ->
C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Microsoft\VC\v170\Microsoft.MakeFile.Targets(44,5): error MSB3073: The command "D:\UE_5.1\Engine\Build\BatchFiles\Build.bat R2NAlaskaEditor Win64 Development -Project="C:\Users\javor\Desktop\R2NAlaska\R2NAlaska.uproject" -WaitMutex -FromMsBuild" exited with code 6. [C:\Users\javor\Desktop\R2NAlaska\Intermediate\ProjectFiles\R2NAlaska.vcxproj]
0 Warning(s)
1 Error(s)
Note that is warns about Live Coding and exiting the engine, but the engine was not running during these builds.

Unable to build GDAL Visual Studio project with "generate_vcxproj.bat"

I need to link GDAL library to a c++ project.
I use the instruction from here:
http://trac.osgeo.org/gdal/wiki/GeneratingVisualStudioProject
Download gdal231.zip from official web site. Unpack.
(this step may be omitted — result will be the same) Edit nmake.opt by adding this in the very top of the file:
MSVC_VER=1910
WIN64=1
(don't know if it's right; there is no thorough guide)
Run win cmd, type "generate_vcxproj.bat 15.0 64 gdal_vs2017", wait for finish.
Open gdal_vs2017.vcxproj with MSVS Community 15.8.4. Build solution.
Build failed with "fatal error C1083: Cannot open include file: 'stdio.h': No such file or directory".
Project settings look strange:
1
"VC++ Directories" seem normal, except $(VC_SourcePath) in "Library Directories":
2
What's wrong with it?
In order to build GDAL one doesn't need a Visual Studio project. Don't know what's wrong with "generate_vcxproj" script — it just does'nt work. But there is another way.
Unpack gdal231.zip.
Launch "x64 Native Tools Command Prompt for VS 2017" (or whatever version of VS command prompt that suits your needs). cd to "gdal-2.3.1\" dir.
Open nmake.opt file. In it's beginning there are some hints for usage of makefile.vc. Pick some arguments from there. I opt for x64 release build, so my call to nmake was like that: "nmake -f makefile.vc MSVC_VER=1910 WIN64=1". (1910 is a version of Visual Studio 2017).
Switch to "Native tools command prompt" and type "nmake -f makefile.vc MSVC_VER=1910 WIN64=1" there. Enter.
When it's finished, type "nmake -f makefile.vc MSVC_VER=1910 WIN64=1 install" and press Enter.
When that's finished too, type "nmake -f makefile.vc MSVC_VER=1910 WIN64=1 devinstall" and press Enter.
Done. The library is in C:\warmerda\bld\ folder.
I got the same problem when building with VS2017 Community Edition. I was able to build fine using VS2015 Community Edition.
Bottom line: when running the .bat, use the 2015 option.
Modify the generate_vcxproj.bat file using the information from here:
https://en.wikipedia.org/wiki/Microsoft_Visual_C%2B%2B#Internal_version_numbering
I modified mine to work with Visual Studio Community 2019 by modifying lines 55-70 to be this:
if "%_vcver_%"=="16.2" (
set _clver_=1922
set _vstoolset_=v1422
) else if "%_vcver_%"=="15.0" (
set _clver_=1910
set _vstoolset_=v141
) else if "%_vcver_%"=="14.0" (
set _clver_=1900
set _vstoolset_=v140
) else ( if "%_vcver_%"=="12.0" (
set _clver_=1800
set _vstoolset_=v120
) else (
echo Wrong value for parameter 1. See usage:
goto :usage
))

Can build Mysql Connector C++ on vs 2017?

I tried to build mysql-connector-c++ from source to static library.
Referring the official spec here, I generated the Visual studio solution by the following command:
cmake -DMYSQL_DIR="E:\mysql-5.7.21-winx64" -DWITH_BOOST="E:\libs\boost_1_67_0_BUILDED" -DWITH_JDBC=ON -G "Visual Studio 15 2017 Win64" ../
Then, I opened the vs solution generated by cmake.Run build, got the two libs: mysqlcppconn8-static-mt.lib, mysqlcppconn-static-mt.lib, and copied them to my project.
When I built my project (also vs2017 version), I got the error:
mysqlcppconn-static-mt.lib(net_serv.obj) : error LNK2038: 检测到“_MSC_VER”的不匹配项: 值“1800”不匹配值“1900”(ActionProcessor.obj 中)
I am confused. They're all built in vs2017, and platform toolset are all set to "Visual Studio 2017 (v141)". I can't understand where 1800_MSC_VER has come from.
Here is what I did
Specs
Visual Studio 15, (2017)
x64
Static (.lib)
With static runtime (/MT)
Tools
CMAKE
Bison (In a folder without spaces)
Perl (ActiveState or Strawberry)
OpenSSL 1.0.2q.tar.gz
Add CMAKE, Bison and pearl to your system path
Check to see if you got all setup correctly
C:\>cmake --version
cmake version 3.9.6
C:\>bison --version
bison (GNU Bison) 2.4.1
C:\>m4 --version
m4 (GNU M4) 1.4.13
C:\>perl -version
This is perl 5, version 24, subversion 3 (v5.24.3)
Step 1: Build OpenSSL 1.0.x
Note: if you want to build OpenSSL 1.1.x steps will be a bit different
Extract to: C:\mysql-8.0.15\openssl-1.0.2q
Run: x64 Native Tools Command prompt for VS 2017
cd C:\mysql-8.0.15\openssl-1.0.2q
Release
perl Configure VC-WIN64A no-shared --openssldir=.\rel64
ms\do_win64a
nmake -f ms\nt.mak
nmake -f ms\nt.mak install
Debug
nmake -f ms\nt.mak clean
perl Configure debug-VC-WIN64A no-shared --openssldir=.\dbg64
ms\do_win64a
nmake -f ms\nt.mak
nmake -f ms\nt.mak install
Step 2: Build MySQL (Yes the actual database)
Extract to: C:\mysql-8.0.15
Run: x64 Native Tools Command prompt for VS 2017
cd C:\mysql-8.0.15\
cmake . -G "Visual Studio 15 2017 Win64" ^
-DWITH_BOOST=C:/mysql-8.0.15/boost ^
-DDOWNLOAD_BOOST=1 ^
-DBUILD_CONFIG=mysql_release ^
-DWITH_SSL=C:\mysql-8.0.15\openssl-1.0.2q\rel64 ^
-DLINK_STATIC_RUNTIME_LIBRARIES=1
Copy m4.exe to C:\mysql-8.0.15\sql\ this avoids any m4.exe errors during built
Open MySQL.sln and build for release x64
Copy binary_log_funcs.h and binary_log_types.h from mysql-8.0.15\libbinlogevents\export to mysql-8.0.15\include
The library should be located at:
Static release library: C:\mysql-8.0.15\archive_output_directory\Release\mysqlclient.lib
Step 3: Build MySQL Connector C++
Copy C:\mysql-8.0.15-dbg\archive_output_directory\Debug\mysqlclient.lib
to C:\mysql-8.0.15-dbg\lib\vs14
Run CMAKE GUI
Browse to the path of the MySQL Connector Project.
Click Configure, Select Visual studio 15 2017 Win64, native compilers
Tick BUILD_STATIC
Tick STATIC_MSVCRT
TICK WITH_JDBC
remove WIN_SSL_YASL from CONFIG_VARS
WITH_SSL = C:\mysql-8.0.15\openssl-1.0.2q\rel64
WITH_BOOST= C:\mysql-8.0.15\boost\boost_1_66_0
MYSQL_DIR=C:\mysql-8.0.15
Open MySQL_CONCPP.sln build for Release x64
The library is located at:
C:\mysql-connector-c++-8.0.15\jdbc\install\lib\mysqlcppconn-static-mt.lib
C:\mysql-connector-c++-8.0.15\Release\mysqlcppconn8-static-mt.lib
Step 4: Test it
Note: This test is for the JDBC style API. If you are not maintaining an existing application, use the new xdevapi API.
Create a new project and put the following in main.cpp
#define WIN32_LEAN_AND_MEAN
#include <Windows.h>
#define STATIC_CONCPP
#define CONCPP_BUILD_STATIC
#define CPPCONN_PUBLIC_FUNC
#include <driver.h>
#include <connection.h>
#include <statement.h>
#include <exception.h>
sql::Driver *mDriver;
sql::Connection *mConnection;
int main() {
mDriver = get_driver_instance(); //or use: new MySQL_Driver()
try {
mConnection = mDriver->connect("host", "username", "password");
mConnection->close();
}catch(sql::SQLException& ex) {
std::cout << ex.what();
}
delete mConnection;
return 0;
}
Set: Linker > Input > Additional Dependecies:
libeay32.lib;mysqlclient.lib;mysqlcppconn8-static-mt.lib;mysqlcppconn-static-mt.lib;ssleay32.lib;%(AdditionalDependencies)
Set: Configuration Properties > VC++ Directories
Include Directories.
Library Directories.
I don't even know where to start explaining to be honest. Building this was a massive pain.
Before you begin to read this, please ensure you have the following:
C:\boost
C:\OpenSSL-Win32
C:\OpenSSL-Win64
Because I was writing my own "wrapper" and trying to make UNICODE work properly, I was getting weird exceptions, and I was unable to debug anything because I downloaded the latest package which is built without debug information (https://dev.mysql.com/downloads/connector/cpp/)
This is the first time I try to build this, so I went to their Github repository and grabbed the latest "master": https://github.com/mysql/mysql-connector-cpp
BUT! This does not contain the "JDBC" sources, which is by the way the "native" connector as they call it. So I grabbed it from the branch: https://github.com/mysql/mysql-connector-cpp/tree/jdbc and then copied the files into "mysql-connector-cpp-master\jdbc".
OK. I opened "x64 Native Tools Command Prompt for VS 2017" and navigated to "mysql-connector-cpp-master". At this point I still had no idea what I am doing and how to build it, all I could understand from the docs and different articles here is to run:
cmake -DWITH_JDBC=ON --build .
This started to configure things and build OK, but it stopped here:
-- Searching for static libraries with the base name(s) "mysqlclient"
CMake Error at FindMySQL.cmake:524 (message):
Could not find "mysql.h" from searching "/usr/include/mysql
/usr/local/include/mysql /opt/mysql/mysql/include
/opt/mysql/mysql/include/mysql /usr/local/mysql/include
/usr/local/mysql/include/mysql C:\Program Files/MySQL/*/include
C:/MySQL/*/include"
Call Stack (most recent call first):
CMakeLists.txt:332 (INCLUDE)
OK. So what now... where is "mysql.h" ?! After searching... and searching, I found this: Missing mysql.h and trying to find mysql-devel
And I quote:
Grab the MySQL Community Server and install it on your system. It
contains a directory called include in which you find the mysql.h.
Ok, great we need more stuff. So I download: https://dev.mysql.com/downloads/mysql/ and run the command again.
Happy days, something happened but no libs yet. I did get however a VS 2017 solution called: "MYSQLCPPCONN.sln".
This contains VS 2017 configuration to build the library for Win32. And of course trying to build with this solution will give you A LOT of unresolved external symbols.
So I run again the cmake but with static option added:
cmake -DWITH_JDBC=ON -DBUILD_STATIC=ON --build .
This time when I open "MYSQLCPPCONN.sln" I can see another project "mysqlcppconn-static" and this builds fine without issues.
However, in my case I need x64. I just created a new configuration for x64 by copying the exiting configuration fron Win32.
So that's it, I have both Win32 and x64 "mysqlcppconn-static.lib".
Overall Conclusion at this time:
Quite hard to build, without experience you will spend some time...
time.
No proper documentation, their existing documentation is poorly
written and very confusing.
No UNICODE support, yes the projects compile as Multi-Byte
Character Set.
I will see if I can debug and find out why am I getting exceptions in the library when using this (from their documentation):
sql::ConnectOptionsMap connection_properties;
connection_properties["hostName"] = "";
connection_properties["port"] = "";
connection_properties["userName"] = "";
connection_properties["password"] = "";
connection_properties["schema"] = "";
connection_properties["OPT_CONNECT_TIMEOUT"] = 10;
connection_properties["CLIENT_MULTI_STATEMENTS"] = (true);
connection_properties["OPT_CHARSET_NAME"] = "utf8";
connection_properties["OPT_SET_CHARSET_NAME"] = "utf8";
I hope you can build your library with this information, and hopefully in the future it will become more easier and clear.
Good Luck.

VisualGDB Embedded Project Error

I am using VisualGDB to build an Emedded Project using Visual StudionCommunity 2013. I chose STM32F4xxxx as my device type. I am getting the below error while doing, clean, build or rebuild
Error 6 error MSB3073: The command ""\VisualGDB.exe" /rebuild "C:\MyWork\experiments\Embedded\EmbeddedProject1\EmbeddedProject2\EmbeddedProject2.vcxproj" "/solution:C:\MyWork\experiments\Embedded\EmbeddedProject1\EmbeddedProject1.sln" "/config:Debug" "/platform:ARM"" exited with code 9009.
C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V120\Microsoft.MakeFile.Targets 43 5 EmbeddedProject2
I had the same error and my problem was that I had not the beginning of a path in my makefile (I had just ".../NameOfTheLib" and I replace by "C:/Documents/...AllMyPath/NameOfTheLib") and now it works and I can send my project by SSH.

v8.5 - Error Compiling Parallel Transformer

I would appreciate if i can get some help in solving this issue for which i have been looking for information for over 2 days through various forums. Crying or Very sad Crying or Very sad
I have installed Infosphere Datastage v8.5 on windows environment for testing and have run a couple of jobs, but when i run a job containing a transformer i get compilation error.
Job: Row generator -> Tfx -> Sequential File
Based on my search through various forums i find that Similar issue has been faced by others as well.But i am unable to find a concrete answer regarding the following:
1. A Compiler that i need to install and the related SDK that needs to be installed along with it
2. or A combined pack that has both compiler+SDK
The Installation Guide talks about Microsoft Visual Studio .NET 2008 Express Edition C++: but does not mention which is the associated SDK that needs to be installed ?
or is there a newer version of C++ compiler+SDK that will work on my environment
My Environment Details:
OS - Windows Server 2008 R2(Standard) SP1 - 64 bit
IIS - Infosphere Information Server v8.5 64bit Multilingual
--================
.Net framework
--================
Microsoft .Net framework 1.1
Microsoft .Net framework 4 Client Profile
Microsoft .Net framework 4 Extended
--=====
SDK
--=====
Microsoft Windows SDK for Windows 7 and .NET Framework 3.5 SP1
This SDK created 2 directories path , which are as follows:
C:\Program Files\Microsoft SDKs
C:\Program Files (x86)\Microsoft Visual Studio 9.0
Windows Environment Variables:
INCLUDE - C:\IBM\SQLLIB\INCLUDE;C:\IBM\SQLLIB\LIB;C:\Program Files\Microsoft SDKs\Windows\v7.0\Include
LIB - C:\Program Files\Microsoft SDKs\Windows\v7.0\Lib;C:\IBM\SQLLIB\LIB
CLASSPATH - .;C:\IBM\SQLLIB\java\db2java.zip;C:\IBM\SQLLIB\java\db2jcc.jar;C:\IBM\SQLLIB\java\sqlj.zip;
C:\IBM\SQLLIB\java\db2jcc_license_cu.jar;C:\IBM\SQLLIB\bin;C:\IBM\SQLLIB\java\common.jar
Path - C:\IBM\InformationServer\Server\DSComponents\bin;C:\Program Files (x86)\MKS Toolkit\mksnt;C:\PROGRA~2\MKSTOO~1\bin64;C:\PROGRA~2\MKSTOO~1\bin;
C:\PROGRA~2\MKSTOO~1\bin\X11;C:\PROGRA~2\MKSTOO~1\mksnt;C:\IBM\InformationServer\ASBNode\apps\jre\bin\classic;C:\IBM\InformationServer\ASBNode\lib\cpp;
C:\IBM\InformationServer\ASBNode\apps\proxy\cpp\vc60\MT_dll\bin;%systemroot%\system32;%systemroot%;
%systemroot%\system32\wbem;%systemroot%\system32\windowspowershell\v1.0\;c:\program files (x86)\microsoft visual studio 9.0\vc\bin;
c:\program files (x86)\microsoft visual studio 9.0\common7\ide;c:\program files\ibm\gsk8\lib64;C:\IBM\SQLLIB\BIN;C:\IBM\SQLLIB\FUNCTION;
C:\IBM\SQLLIB\SAMPLES\REPL;C:\Windows/SysWOW64
Compiler information from windows command prompt:
c:\Users\skh>cl.exe
Microsoft (R) 32-bit C/C++ Optimizing Compiler Version 15.00.30729.01 for 80x86
Copyright (C) Microsoft Corporation. All rights reserved.
usage: cl [ option... ] filename... [ /link linkoption... ]
Datastage Environment Variables:
APT_COMPILEOPT (old): -W/TP -W/EHa -DAPT_USE_ANSI_IOSTREAMS -c -W/Zc:wchar_t-
APT_COMPILEOPT (new): -W/TP -W/EHa -DAPT_USE_ANSI_IOSTREAMS -c
APT_LINKOPT(old): -s -W/dll -W/base:0x50000000 -W/Zc:wchar_t-
APT_LINKOPT(new): -s -W/dll -W/base:0x50000000
The (old) represent the default values that DS Environment variables had. I ran my job which had a transformer but i got the compilation error.
I changed the Environment variable values to what is stated in (new), still i get the compilation error mentioned below
Output from transformer compilation follows:
I IIS-DSEE-TFCN-00001 12:55:36(000)
IBM WebSphere DataStage Enterprise Edition 8.5.0.5746
Copyright (c) 2001, 2005-2008 IBM Corporation. All rights reserved
##I IIS-DSEE-TFCN-00006 12:55:36(001) <main_program> conductor uname: -s=Windows_NT; -r=1; -v=6; -n=IN-MUM-IBMQLT; -m=Pentium
##I IIS-DSEE-TOSH-00002 12:55:36(002) <main_program> orchgeneral: loaded
##I IIS-DSEE-TOSH-00002 12:55:36(003) <main_program> orchsort: loaded
##I IIS-DSEE-TOSH-00002 12:55:36(004) <main_program> orchstats: loaded
##W IIS-DSEE-TOSH-00049 12:55:36(007) <main_program> Parameter specified but not used in flow: DSPXWorkingDir
##E IIS-DSEE-TBLD-00076 12:55:39(000) <main_program> Error when checking composite operator: Subprocess command failed with exit status 256.
##E IIS-DSEE-TFSR-00019 12:55:39(001) <main_program> Could not check all operators because of previous error(s)
##W IIS-DSEE-TFTM-00012 12:55:39(002) <transform> Error when checking composite operator: The number of reject datasets "0" is less than the number of input datasets "1".
##I IIS-DSEE-TBLD-00000 12:55:39(003) <main_program> Error when checking composite operator: Output from subprocess: cl : Command line warning D9035 : option 'GX' has been deprecated and will be removed in a future release
cl : Command line warning D9036 : use 'EHsc' instead of 'GX'
cl : Command line warning D9025 : overriding '/GX' with '/EHa'
##I IIS-DSEE-TBLD-00000 12:55:39(004) <main_program> Error when checking composite operator: Output from subprocess: C:\IBM\InformationServer\Server\PXEngine\include\apt_util/ints.h(83) : fatal error C1083: Cannot open include file: 'strstream': No such file or directory
##W IIS-DSEE-TFEV-00025 12:55:39(005) <transform> Error when checking composite operator: Converting string to number.
##W IIS-DSEE-TFEV-00023 12:55:39(006) <transform> Error when checking composite operator: Implicit conversion from source type "String" to result type "DFloat".
##W IIS-DSEE-TFEV-00025 12:55:39(007) <transform> Error when checking composite operator: Converting number to string.
##W IIS-DSEE-TFEV-00023 12:55:39(008) <transform> Error when checking composite operator: Implicit conversion from source type "DFloat" to result type "String".
##W IIS-DSEE-TBLD-00000 12:55:39(009) <main_program> Error when checking composite operator: Output from subprocess: ld: script execution error in file 'C:/PROGRA~2/MKSTOO~1/etc/nutccg/ld.ccg' on line 1119
>>> execv: could not run 'link32': The system cannot find the file specified.
##I IIS-DSEE-TBLD-00079 12:55:39(010) <transform> Error when checking composite operator: cxx -LC:/IBM/InformationServer/Server/Projects/PRJ_QSPOC/RT_BP2.O/ -LC:/IBM/InformationServer/Server/PXEngine/lib -LC:/IBM/InformationServer/Server/PXEngine/user_lib -s -W/dll -W/base:0x50000000 -lliborchnt -lliborchcorent -lliborchbuildopnt C:/IBM/InformationServer/Server/Projects/PRJ_QSPOC/RT_BP2.O/V0S3_TestJob_Tfx_Transformer.tmp.o -o C:/IBM/InformationServer/Server/Projects/PRJ_QSPOC/RT_BP2.O/V0S3_TestJob_Tfx_Transformer.dll.
##E IIS-DSEE-TCOS-00029 12:55:39(011) <main_program> Creation of a step finished with status = FAILED. (TestJob_Tfx.Transformer)
*** Internal Generated Transformer Code follows:
0001: //
0002: // Generated file to implement the V0S3_TestJob_Tfx_Transformer transform operator.
0003: //
0004:
0005: // define our input/output link names
0006: inputname 0 DSLink2;
0007: outputname 0 DSLink5;
0008:
0009: initialize {
0010: // define our control variables
0011: int8 RowRejected0;
0012: int8 NullSetVar0;
0013:
0014: }
0015:
0016: mainloop {
0017:
0018: // declare our intermediate variables for this section
0019: dfloat InterVar0_0;
0020:
0021: // initialise the rejected row variable
0022: RowRejected0 = 1;
0023:
0024: // evaluate columns (no constraints) for link: DSLink5
0025: InterVar0_0 = DSLink2.Dummy1;
0026: DSLink5.Dummy1 = (InterVar0_0 + 5);
0027: writerecord 0;
0028: RowRejected0 = 0;
0029: }
0030:
0031: finish {
0032: }
0033:
*** End of Internal Generated Transformer Code
This is how i went about fixing it. I hope this helps people facing similar problems and saves some time and effort.
so , here it goes :
I installed Visual Studio C++ 2008 Express Edition.
I then worked around vcvarsall.bat file .if you are wondering why , please check
(
http://msdn.microsoft.com/en-us/library/x4d2c09s(v=vs.80).aspx )
and
Errors while building/installing C module for Python 2.7
)
I executed the following from the cmd window, to set the 64 bit compiler:
vcvarsall.bat amd64
NOTE: my environment has a X64 AMD chipset windows server;I used echo %PROCESSOR_ARCHITECTURE% , from cmd window to determine this.
To cross check which compiler is set, execute the following and the output would indicate.
cl.exe
Next , set the following windows system variables:
INCLUDE - C:\IBM\SQLLIB\INCLUDE;C:\IBM\SQLLIB\LIB; C:\Program Files\Microsoft SDKs\Windows\v6.0A\Include
LIB - C:\Program Files\Microsoft SDKs\Windows\v6.0A\Lib ;C:\IBM\SQLLIB\LIB
Note:-
The folder path C:\Program Files\Microsoft SDKs\Windows\v6.0A is created by the Visual Studio C++ 2008 Express Edition. This should be the source for folder paths that are set for INCLUDE & LIB
There is a similar path that the SDK creates C:\Program Files\Microsoft SDKs\Windows\v7.0\ , but Include and Lib folder from this path should not be used to set the above mentioned Windows Environment variables , I made this mistake during my set up :(
for reference please check the Release Note of the SDK that is to be installed.
Set the following Datastage ENV variable,from the Administrator, to values below.
APT_COMPILEOPT : -W/TP -W/EHa -DAPT_USE_ANSI_IOSTREAMS -c -W/Zc:wchar_t-
APT_LINKOPT : -s -W/dll -W/base:0x50000000 -W/Zc:wchar_t-
I then restarted the Datastage services.
.. and the transformers started to work :)
PS : I did not uninstall Information Server nor the SDK (which i initially presumed was the problem)