首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >无法编译gsoap的安全版本

无法编译gsoap的安全版本
EN

Stack Overflow用户
提问于 2014-08-22 21:09:44
回答 2查看 920关注 0票数 0

我已经下载了gSOAP 2.8.17r稳定(更新)(20.7MB)

在/bin/有2个exe wsdl2h.exe和soapcpp2.exe,但它们只适用于不安全的网站,现在对于安全的wsdl2h.exe有一个源代码在gsoap/VisualStudio2005/...我们必须对其进行编译。在编译时,我遇到错误

我已经安装了minGW,bison,flex,m4,perl,...

还为项目soapcpp2中的.l和.y文件创建了构建自定义工具,如自述文件中所示。

-读我的话

代码语言:javascript
复制
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`

-错误

代码语言:javascript
复制
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 ==========
EN

回答 2

Stack Overflow用户

发布于 2016-05-01 17:10:23

要构建soapcpp2.exe,您需要安装Flex。为此,您需要创建自定义构建规则,以便使用Flex和Bison.Please编译.l.y文件。请参阅:http://msdn.microsoft.com/en-us/library/aa730877(VS.80).aspx#vccustombr_topic3

您可以从sourceforge下载Win flex-bison,当您使用VS编译soapcpp2时,您应该设置自定义构建规则,请参阅https://sourceforge.net/p/winflexbison/wiki/Visual%20Studio%20custom%20build%20rules/好运!

票数 0
EN

Stack Overflow用户

发布于 2016-09-07 18:37:19

我认为parser.ylexer.l只是我们在soapcpp2项目中的soapcpp2_lex.lsoapcpp2_yacc.y文件的错误名称。

因此,只需为这两个文件改正“命令行”:

代码语言:javascript
复制
for '.y' file: bison -oparser.c $(InputFileName)
for '.l' file: flex -olexer.c $(InputFileName)
票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/25447853

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档