Page 1 of 1

Can't build DocumentLoader example: error C1189

Posted: Fri Nov 21, 2008 3:07 pm
by mats
I'm trying to migrate from MS Office to OOO but getting started with UNO was difficult. I can't compile the C++ example DocumentLoader.cxx.

I get the following error: c:\Program\OpenOffice2_4_SDK\include\sal\types.h(77): fatal error C1189: #error : "Could not find 16-bit type, add support for your architecture
I have searched the Internet for days without success.

My Build log:
------- Build started: Project: UNOExWin32Consol03, Configuration: Debug|Win32 -------
Command Lines
Creating temporary file "d:\MinaFiler\MinaDokument\OOB\ExamplesUNO\UNOExWin32Consol03\UNOExWin32Consol03\Debug\RSP000002.rsp" with contents
[
/Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_AFXDLL" /D "_ATL_STATIC_REGISTRY" /D "_MBCS" /Gm /EHsc /RTC1 /MDd /Yu"stdafx.h" /Fp"Debug/UNOExWin32Consol03.pch" /Fo"Debug/" /Fd"Debug/vc70.pdb" /W3 /c /Wp64 /ZI /TP
c:\Program\OpenOffice2_4_SDK\examples\cpp\DocumentLoader\DocumentLoader.cxx
]
Creating command line "cl.exe @d:\MinaFiler\MinaDokument\OOB\ExamplesUNO\UNOExWin32Consol03\UNOExWin32Consol03\Debug\RSP000002.rsp /nologo"

What I have done:
1.Installed OpenOffice.org 2.4 SDK (en-US)t trying to follow instructions at http://wiki.services.openoffice.org/wik ... stallation
and changed:
REM Set environment for C++ compiler tools, if necessary.
if defined OO_SDK_CPP_HOME call "C:\Program Files\Microsoft Visual C++ Toolkit 2003\VCVARS32.bat"
to:
REM Set environment for C++ compiler tools, if necessary.
if defined OO_SDK_CPP_HOME call "C:\Program\Microsoft Visual Studio .NET 2003\Vc7\bin\VCVARS32.bat"
in file: setsdkenv_windows.bat

2. I have added this to C:\Program\OpenOffice2_4_SDK\examples\cpp\DocumentLoader\Makefile
# Builds the C++ DocumentLoader example of the SDK.
#define WIN32
#define WNT
#define WINNT
#define CPPU_ENV=msci

3. I have added #include "stdafx.h" in DocumentLoader.cxx

I did not understand what was meant with the following sentence:: C:\openoffice\OpenOffice.org2.0_SDK\examples\DevelopersGuide\ProfUNO\CppBinding\office_connect.cxx to change the port accordingly to what OOo is listening.

My environment:
******************************************************************
*
* SDK environment is prepared for Windows
*
* SDK = C:\Program\OpenOffice2_4_SDK
* Office = C:\Program\OpenOffice2_4
* URE =
* Make = C:\Program\MinGW\bin
* Zip = C:\Program\OpenOffice2_4_SDK\windows\bin
* C++ Compiler = C:\Program\Microsoft Visual Studio .NET 2003\Vc7\bin
* C# and VB.NET compilers = C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727
* Java =
* Special Output directory = D:\MinaFiler\MinaDokument\OOB\SDKs
* Auto deployment = YES
*
******************************************************************
Microsoft Windows XP Professional Ver. 5.1.2600 Service Pack 3 build 2600 (Swedish)
C++ : Microsoft Visual Studio .NET 2003 ver: 7.1.6030
.NET Framework 1.1 ver. 1.1.4322 SP1
( I notice now that Visual Studio and setsdkenv_windows.bat report different versions of .NET Framework.)

Please don't let me stay with MS Office!

Re: Can't build DocumentLoader example: error C1189

Posted: Wed Nov 26, 2008 7:23 am
by vaibhavnagar
Hi Mats,
Please try compiling this example in open office 2.0 version and see.

Re: Can't build DocumentLoader example: error C1189

Posted: Wed Nov 26, 2008 9:46 am
by miket
My reply may not be of much help, as I've never tried to compile any of the examples or tried to use the makefiles that comes with the SDK. It seems you don't use the makefiles either, Mats... ;).
The compile flags that end up in the command are not complete:

/Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_AFXDLL" /D "_ATL_STATIC_REGISTRY" /D "_MBCS" /Gm /EHsc /RTC1 /MDd /Yu"stdafx.h" /Fp"Debug/UNOExWin32Consol03.pch" /Fo"Debug/" /Fd"Debug/vc70.pdb" /W3 /c /Wp64 /ZI /TP

At least, you neede the following: "-DWNT -DWIN32 -DCPPU_ENV=msci"
How to get to use them in your make system I don't know. But the make process seems to ignore C:\Program\OpenOffice2_4_SDK\examples\cpp\DocumentLoader\Makefile (and the changes you've made to that file shouldn't be necessary, as they come from C:\Program\OpenOffice2_4_SDK\settings\settings.mk as far as I can tell -- besides, haven't you just introduced some extra comments in the makefile..?).

Also, the line "Make = C:\Program\MinGW\bin" might cause worry, as the site you link to states that "other compilers like MinGW have turned out to be hard to configure for OOo on Windows" -- I don't know if that has anything to do with your problems.

Re: Can't build DocumentLoader example: error C1189

Posted: Wed Nov 26, 2008 6:08 pm
by mats
Thank you, I felt stuck.
I'm going to download OOo2.0. But as miket says; I'm probably not using the makefile in a correct way.
How to use the makefile in a correct way?
For instance: How to tell Visual Studio 2003 to use the makefile?

mats

Re: Can't build DocumentLoader example: error C1189

Posted: Fri Nov 28, 2008 2:45 pm
by miket
I don't know how to use the makefiles with VS. Perhaps you could just try to set the flags "-DWNT -DWIN32 -DCPPU_ENV=msci" and see if that helps.

Concerning the line with setting the right port number: When connecting to OO, you specify a port on which OO is listing. The port number was given to OO when you launched it (cf. the Developer's Guide on how to pass the port to OO). How you have to connect to right port (otherwise OO won't hear you). In the example programs I guess the port is just hardcoded, eg: "uno:socket,host=localhost,port=2083;urp;StarOffice.ServiceManager" in office_connect.cxx.

Re: Can't build DocumentLoader example: error C1189

Posted: Mon Mar 02, 2009 9:20 pm
by 0xBA0BAB
The similiar problem. I'm using similiar tools, MSVS2008, MinGW. Realy I know, this is a not good way - use GNU utilites with non-GNU compiler. But when I tried do run nmake, I can't build. nmake can't found including files (*.mk). I changed Makefile, nmake answers:
C:\Program Files\OpenOffice.org 3\Basis\sdk\settings/settings.mk(4) : error U1033: syntax error: "=" not required
Stop.

(I'm not sure for correct error translation, my locale is cyrilic)

I tried to use this:
C:\Program Files\OpenOffice.org 3\Basis\sdk\examples\cpp\DocumentLoader>mingw32-
make -DWNT -DWIN32 -DCPPU_ENV=msci
mingw32-make (pid = 888)
mingw32-make is suspending for 30 seconds...done sleep(30). Continuing.
mingw32-make: *** PPU_ENV=msci: No such file or directory. Stop.

So. How it is possible to build smth for Windows? Which tools are required? setsdkenv_windows.bat asks exactly for GNU make utility...

Is it possible to make solution for MSVS (without using Makefiles)? Can somebody give me simple WORKING project for MSVS?