cant compile secured version of gsoap - c++

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 ==========

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!

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)

Related

Can not open include file; no such file or dir

I created new solution and new project (further A), added another external project (further B) Right click -> add existing project. Now, I have two projects (A & B) in my solution. I added also additional dirs to project A in order to it can see headers of project B. Then I added a few imports in file or project A from project B.
Then if I make right click on project B -> Rebuild it is built without any errors, then if I make right click on project B -> Rebuild I got an error that says :
1>------ Build started: Project: _DecoderEngine, Configuration: Release x64 ------
1>TetStreamDecoder.cpp
1>D:\land\co_main\_Infrastructure\Tier1.0\_FileCodec\_Decoder\_IDecoderCallback.h(3): fatal error C1083: Cannot open include file: '_Shared/_FileTypes.h': No such file or directory
1>Done building project "_DecoderEngine.vcxproj" -- FAILED.
========== Build: 0 succeeded, 1 failed, 2 up-to-date, 0 skipped ==========
What is weird that a file where I got an error it is a file from project B, it means if I make right click on project B -> Rebuild it is ok, but if I try rebuild project A that has import from B I got and error in files from project B...
What am I doing wrong? I feel like I miss something in configuration, maybe should I add something to Liker or something else?
EDIT
tree looks like this
FileCodec
|
-_DecoderEngine (project A)
|
-_Decoder (project B)
|
-_Shared
FYI - project A use project B and project B use Shared
Then, dependencies I have added to C\C++ -> Additional dirs to project A are :
../_Decoder
../_Shared
Looks ok, because Decoder engine reside on the same level in tree as dependency, so we need to go one level up and here you are.

Visual Studio custom build event always executing

I am using the odb compiler as a custom build tool. The build tool is always executing even though the input file is not changing.
The command line:
odb -Ic:\menuplan\src\ingredient -o c:\menuplan\src\ingredient
-d mysql --hxx-prologue "#include \"odb/traits.hxx\"" --generate-query
--generate-schema --schema-format separate
c:\menuplan\src\ingredient\ing_odb_category.hpp`
The input file is:
ing_odb_category.hpp.
The outputs:
ing_odb_category-odb.hxx;ing_odb_category-odb.ixx;ing_odb_category-odb.cxx;ing_odb_category-schema.cxx
The additional dependencies:
ing_odb_category.hpp
The description:
odb ing_odb_category.hpp
The output from Visual Studio 2010:
2>------ Build started: Project: vs_2010, Configuration: Debug Win32 ------
2> odb ing_odb_category.hpp
The odb tool takes the ing_odb_category.hpp as input and produces ing_odb_category-odb.hxx, ing_odb_category-odb.ixx,ing_odb_category-odb.cxx,ing_odb_category-schema.cxx files.
I can build the solution many times in a row and the custom build event will always run, even though the ing_odb_category.hpp file never changes.
How can I make Visual Studio only perform the custom build if the header file changes?
From the vcxproj file:
<CustomBuild Include="..\ing_odb_category.hpp">
<Command Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">odb -Ic:\menuplan\src\ingredient -o c:\menuplan\src\ingredient -d mysql --hxx-prologue "#include \"odb/traits.hxx\"" --generate-query --generate-schema --schema-format separate c:\menuplan\src\ingredient\ing_odb_category.hpp</Command>
<Command Condition="'$(Configuration)|$(Platform)'=='Debug_Static_Unicode|Win32'">odb -Ic:\menuplan\src\ingredient -o c:\menuplan\src\ingredient -d mysql --hxx-prologue "#include \"odb/traits.hxx\"" --generate-query --generate-schema --schema-format separate c:\menuplan\src\ingredient\ing_odb_category.hpp</Command>
<Message Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">odb ing_odb_category.hpp</Message>
<Message Condition="'$(Configuration)|$(Platform)'=='Debug_Static_Unicode|Win32'">odb ing_odb_category.hpp</Message>
<Outputs Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">ing_odb_category-odb.hxx;ing_odb_category-odb.ixx;ing_odb_category-odb.cxx;ing_odb_category-schema.cxx</Outputs>
<Outputs Condition="'$(Configuration)|$(Platform)'=='Debug_Static_Unicode|Win32'">ing_odb_category-odb.hxx;ing_odb_category-odb.ixx;ing_odb_category-odb.cxx;ing_odb_category-schema.cxx</Outputs>
<AdditionalInputs Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">ing_odb_category.hpp</AdditionalInputs>
</CustomBuild>
Environment:
Visual Studio 2010
Windows 7 - 64bit
Visual Studio was always building the files because it said they didn't exist.
Using the Visual Studio project logging article, especially running the DebugView showed that Visual Studio was using a different path for the dependencies. I did not specify the path of the output files and dependencies, so it was trying to locate them in the default project directory.
Also, Visual Studio expects only one output file, according to Specifying Custom Build Tools article. I was supplying all the output filenames.
Summary
In the Custom Build Tool window:
There should only be one output file.
Additional output files are listed in the Additional Dependencies
slot.
All output files should be prefixed with the path of their location,
relative or absolute.
Useful build process debugging aids can be found in the Visual Studio Project Logging article, especially the DebugView application.

DLL Building in VS2012 - no DLL file appears

In VS 2012, I start a DLL library project, add some code, hit Build and no DLL appears.
I know there are similar questions here on SO about the same topic, however
I have checked the output folder (set to the implicit *$(SolutionDir)$(Configuration)*)
Have not confused Debug and Release
etc..
The output folder does contain something after the build - a .lastbuildstate file and a .log file.
The content of the .lastbuildstate file is
#v4.0:v110:false
Debug|Win32|D:\Desktop\newOne\|
while the contents of the .log file is
Build started 16.10.2014 12:28:52.
1>Project "D:\Desktop\newOne\newOne.vcxproj" on node 2 (Build target(s)).
1>InitializeBuildStatus:
Creating "Debug\newOne.unsuccessfulbuild" because "AlwaysCreate" was specified.
FinalizeBuildStatus:
Deleting file "Debug\newOne.unsuccessfulbuild".
Touching "Debug\newOne.lastbuildstate".
1>Done Building Project "D:\Desktop\newOne\newOne.vcxproj" (Build target(s)).
Build succeeded.
Time Elapsed 00:00:00.02
I tried to create another DLL project from scratch, with the same code, and the result is the same.
Any help is much appreciated.
Daniel
Well in most cases people do look in the wrong directories (like in this issue) but usually the build log states the outputs but your log seems to be empty. What I would advice:
1) Check if your dll actually exports any symbols (functions/classes) - I am not actually sure if VS2012 generates the dll depending on the presence of exported symbols, but still
2) If you are build the whole solution not just the project check that the DLL project is actually marked to be built (a small chance but still)
UPDATE
I checked that symbol exports do not affect the producing of a dll - I set up an empty project and added some functions that are not exported and still got a normal build log:
1>------ Build started: Project: EmptyDllTest, Configuration: Debug Win32 ------
1> Source.cpp
1> EmptyDllTest.vcxproj -> c:\users\user\documents\visual studio 2012\Projects\EmptyDllTest\Debug\EmptyDllTest.dll
========== Build: 1 succeeded, 0 failed, 0 up-to-date, 0 skipped ==========
I can reproduce the log you have only with a totally empty solution. Any chances that for some reason you have not added the source files to the project or they are excluded?

Problem with installing Ogre sdk?

I'm new to Ogre and tried to run the first tutorial, but I have faced a problem getting the
error message
OGRE EXCEPTION(6:FileNotFoundException): 'resources_d.cfg' file not found! in
ConfigFile::load at ../../OgreMain/src/OgreConfigFile.cpp (line 83)
Please help, its critical!
Another question:
Is cmake important for installing the Ogre sdk?
After getting ogre compiled/installed using cmake
on linux those two config files live at
/usr/local/share/OGRE/resources.cfg
/usr/local/share/OGRE/plugins.cfg
just import both into your ogre project
Once ogre is installed, your project does not need cmake
To get you going for the tutorials :
How to setup eclipse with ogre :
File -> New -> C++ Project -> EmptyProject
C/C++ Build -> Environment
OGRE_LOC /home/scott/src/ogre_src_v1-7-3
C/C++ Build -> Settings
GCC C++ Compiler -> Includes
${OGRE_LOC}/OgreMain/include
/usr/local/include/OGRE
${OGRE_LOC}/Samples/Common/include
/usr/include/OIS
GCC C++ Linker -> Libraries (-l)
OgreMain
OgreTerrain
OIS
CEGUIOgreRenderer
right click project -> Properties -> Import
General -> File System ->
ONLY import those 4 files from the tutorial project
(NOT dist, build, makefiles ...)
BaseApplication.cpp
BaseApplication.h
TutorialApplication.cpp
TutorialApplication.h
also import these files :
/usr/local/share/OGRE/resources.cfg
/usr/local/share/OGRE/plugins.cfg
Now you are ready to compile and run !
To add an Ogre model :
First do above steps to create an ogre project, assure it compiles OK. On execution it'll render a black screen - thats fine. Now to add a model (an Ogre) simply edit TutorialApplication.cpp so function createScene appears as :
``
void TutorialApplication::createScene(void)
{
Ogre::Entity* ogreHead = mSceneMgr->createEntity("Head", "ogrehead.mesh");
Ogre::SceneNode* headNode = mSceneMgr->getRootSceneNode()->createChildSceneNode();
headNode->attachObject(ogreHead);
// Set ambient light
mSceneMgr->setAmbientLight(Ogre::ColourValue(0.5, 0.5, 0.5));
// Create a light
Ogre::Light* l = mSceneMgr->createLight("MainLight");
l->setPosition(20,80,50);
}
CMake is critical for building the ogre sdk from source - I would not try to configure the installation yourself. If you are using the prebuilt sdk, cmake is probably unnecessary.
As far as your error goes, it happens to be that you are trying to load resources from the resources.cfg. I am unaware of your operating system, however, be sure that your resources.cfg is in the same directory as your binary. If you are using MSVC and running it through the debugger, make sure your working directory (found in Project Properties -> Debugging -> Working Directory) is set to the directory of your executable.

Compile Combination of qtwinmigrate + qtpropertybrowser Under VC++ 2008

I need to display a property browser under a MFC app.
I try to combine and compile the solution for the two
http://qt.nokia.com/products/appdev/add-on-products/catalog/4/Windows/qtwinmigrate/
http://qt.nokia.com/products/appdev/add-on-products/catalog/4/Widgets/qtpropertybrowser/
I am using VC2009, QT 2009.04 with Visual Studio Add-On 1.1.1
Take note, under my machine, there are no problem for me to compile them successfully separately.
I copy, and add all exsiting CPP and HEADER files found in
qtpropertybrowser-2.5-opensource\src
into
qtwinmigrate-2.8-opensource\examples\qtdll
Here is how my new project looks like in the screen shoot (qtwinmigrate - windows at right most)
(source: googlepages.com)
The qtpropertybrowser, is the project which I am able to compile with no problem :
1>------ Rebuild All started: Project: simple, Configuration: Release Win32 ------
1>Deleting intermediate and output files for project 'simple', configuration 'Release|Win32'
1>Moc'ing qtpropertybrowserutils_p.h...
1>RCC ..\..\src\qtpropertybrowser.qrc
1>MOC ..\..\src\qtvariantproperty.h
1>MOC ..\..\src\qttreepropertybrowser.h
1>MOC ..\..\src\qtpropertymanager.h
1>MOC ..\..\src\qtpropertybrowser.h
1>MOC ..\..\src\qtgroupboxpropertybrowser.h
1>MOC ..\..\src\qteditorfactory.h
1>MOC ..\..\src\qtbuttonpropertybrowser.h
1>Compiling...
.
.
.
1>Compiling...
1>moc_qtpropertybrowserutils_p.cpp
1>Linking...
1>Embedding manifest...
However, when come to build modified version of qtwinmigrate (original version of qtwinmigrate was able to compiled with no problem)
1>------ Rebuild All started: Project: qtdialog, Configuration: Release Win32 ------
1>Deleting intermediate and output files for project 'qtdialog', configuration 'Release|Win32'
1>Moc'ing qtpropertybrowserutils_p.h...
1>Moc'ing qteditorfactory.h...
1>Moc'ing qtvariantproperty.h...
1>Moc'ing qttreepropertybrowser.h...
1>Moc'ing qtpropertymanager.h...
1>Moc'ing qtpropertybrowser.h...
1>Moc'ing qtgroupboxpropertybrowser.h...
1>Moc'ing qtbuttonpropertybrowser.h...
1>Moc'ing qwinwidget.h...
1>Moc'ing qwinhost.h...
1>Compiling...
.
.
.
1>Compiling...
1>moc_qtpropertybrowserutils_p.cpp
1>moc_qteditorfactory.cpp
1>.\Release\moc_qteditorfactory.cpp(74) : error C2027: use of undefined type 'QtSpinBoxFactoryPrivate'
1> c:\documents and settings\yan-cheng.cheok\my documents\downloads\qtwinmigrate-2.8-opensource\qtwinmigrate-2.8-opensource\examples\qtdll\release\../../../lib/qtpropertybrowser-2.5-opensource/src/qteditorfactory.h(97) : see declaration of 'QtSpinBoxFactoryPrivate'
1>.\Release\moc_qteditorfactory.cpp(74) : error C2227: left of '->slotPropertyChanged' must point to class/struct/union/generic type
My questions is
Why qtpropertybrowser just perform "Moc'ing" in 1 file, but qtwinmigrate perform "Moc'ing" in so many files?
Why qtpropertybrowser just compile "moc_qtpropertybrowserutils_p.cpp", but qtwinmigrate try to compile so many "moc_....cpp"?
It looks like your two vcproj files don't have the same "moc" properties... It can leads to strange behaviors with the classes that uses the moc...
How did you generate the vcproj file in the second project ?
Did you build both vcproj from the PRO files or just by adding the existing cpp/h files directly in VS ?
If you build the first example from the example's PRO file then just copied the cpp files in another vcproj by adding them through VS, then something probably went wrong with moc properties...
In your vcproj files, try and look for "moc_" and look for differences between the two files... I think it will give you a further step in the process of finding the source of your problem...
I hope it helps a bit...
1) Under Visual Studio 2008, go to Qt -> Open Qt Project File (.pro), open
qtpropertybrowser.pro
2) Go to "simple" Properties, under Build Events -> Pre-Build Event, enter the
following commands :
moc ..\..\src\qttreepropertybrowser.cpp > ..\..\src\qttreepropertybrowser.moc
moc ..\..\src\qtpropertymanager.cpp > ..\..\src\qtpropertymanager.moc
moc ..\..\src\qteditorfactory.cpp > ..\..\src\qteditorfactory.moc
3) Under C/C++ -> Additional Include Directories, enter the following path :
..\..\lib\qtwinmigrate\src
4) Under General -> Configuration Type, change to Dynamic Library (.dll)
5) Under Linker -> General -> Output File, change to \qtdialog.dll
6) Exclude original main.cpp from simple project. Add in main.cpp from
..\..\lib\qtwinmigrate\examples\qtdll
7) Add in all 3 cpp files and 3 header files from
..\..\lib\qtwinmigrate\src
8) Build all. qtdialog.dll will be generated.
9) Open up \lib\qtwinmigrate\examples\mfc\step1. Build all.
10) Move qtdialog.dll same directory as step1 generated exe. Run the application.