0

i have downloaded gSOAP 2.8.17r stable (update) (20.7 MB)

in /bin/ there are 2 exe wsdl2h.exe and soapcpp2.exe but they work only with non secure website,now for secured wsdl2h.exe there is a source code in gsoap/VisualStudio2005/... which we have to compile. While compiling i am getting errors

i have already installed minGW,bison,flex,m4,perl,....

also created build custom tools for .l and .y files in the project soapcpp2 as given in readme file.

-------Read me ---------

Flex and Bison for Windows
==========================

Visual Studio 2005 Solution files for soapcpp2 and wsdl2h are included.

If not already installed, install the Platform SDK (R2) for `winsock2.h`.

To build `soapcpp2.exe`, first install Bison and Flex (in the default dirs):

<http://gnuwin32.sourceforge.net/packages/bison.htm>
<http://gnuwin32.sourceforge.net/packages/flex.htm>

then add the FlexBison.rules as explained here:

<http://msdn2.microsoft.com/en-us/library/aa730877(VS.80).aspx>

These custom-build rules are used to build the scanner and parser for
`soapcpp2.exe`.

To build `wsdl2h.exe`, you first need to build `soapcpp2.exe` and install it in
Program Files or copy it to the `wsdl` directory. This is needed to execute the
custom-build step on `wsdl.h` to generate `wsdlStub.h`, `wsdlH.h`, and
`wsdlC.cpp`.

Build Rules for `soapcpp2.exe` VS 2008 and 2010
===============================================

To build `soapcpp2.exe` you need to install Flex and Bison. To do so, you need
to create custom build rules to compile `.l` and `.y` files with Flex and
Bison.

Please see:

<http://msdn.microsoft.com/en-us/library/aa730877(VS.80).aspx#vccustombr_topic3>

In VS2008, there is UI available to help you create the custom build rule.

Make sure you have `flex.exe`, `bison.exe`, and `m4.exe` on the system search
path.

- Right click on the `.l` file and select properties
- Configuration -> All Configurations
- General -> Item Typ e-> Custom Build Tool
- Apply
- Custom Build Tool -> General -> Command Line -> `flex -olexer.c lexer.l`
- Custom Build Tool -> General -> Outputs -> `lexer.c`
- Custom Build Tool -> General -> Additional Dependencies -> `parser.y parser.c`
- Apply
- Select the `.y` file in the solution explorer
- Configuration -> All Configurations
- General -> Item Type -> Custom Build Tool
- Apply
- Custom Build Tool -> General -> Command Line -> `bison -oparser.c parser.y`
- Custom Build Tool -> General -> Outputs -> `parser.c parser.h`

In VS2010, there may not be a UI available to create the custom build rules.
To add or modify build rules in VS2010 you need to edit:

`%ProgramFiles%\MSBuild\Microsoft.Cpp\v4.0\BuildCustomizations`

and/or

`%ProgramFiles(x86)%\MSBuild\Microsoft.Cpp\v4.0\BuildCustomizations`

----------- Error -------------

1>------ Build started: Project: soapcpp2, Configuration: Debug Win32 ------
1>Performing Custom Build Step
1>bison: cannot open file `parser.y': No such file or directory
1>Project : error PRJ0019: A tool returned an error code from "Performing Custom Build Step"
1>Build log was saved at "file://c:\gs\gsoap-2.8\gsoap\VisualStudio2005\soapcpp2\soapcpp2\Debug\BuildLog.htm"
1>soapcpp2 - 1 error(s), 0 warning(s)
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
Mandar
  • 1,006
  • 11
  • 28
  • It looks like you don't have a 'parser.y', or it's in the wrong location? – Yann Aug 22 '14 at 13:11
  • is there anyway to compile bison,flex.. file manually – Mandar Aug 22 '14 at 13:11
  • i have searched for parser.y but cant find anywhere, i think it should be generated by the custom build rules – Mandar Aug 22 '14 at 13:13
  • I'd recommend either restarting from step 1, if possible, and find out how the file supposed to appear, if it's supposed to be a download or what. – Yann Aug 22 '14 at 13:15
  • The `soapcpp2_yacc.y` file is the file with the parser, not `parser.y`. The instructions should be updated to reflect that. – Dr. Alex RE Jul 25 '17 at 00:12

2 Answers2

0

To build soapcpp2.exe you need to install Flex and Bison. To do so, you need to create custom build rules to compile .l and .y files with Flex and Bison.Please see:http://msdn.microsoft.com/en-us/library/aa730877(VS.80).aspx#vccustombr_topic3.

You can download Win flex-bison from sourceforge, when you compile soapcpp2 with VS you should setup custom build rules,please see https://sourceforge.net/p/winflexbison/wiki/Visual%20Studio%20custom%20build%20rules/ Good Luck!

0

I suppose that parser.y and lexer.l are just wrong names for soapcpp2_lex.l and soapcpp2_yacc.y files we have in soapcpp2 project.

So just correct "Command Line" for both files:

for '.y' file: bison -oparser.c $(InputFileName)
for '.l' file: flex -olexer.c $(InputFileName)