anyone have jsoncpp working on vc90?
they use a build system, Scons, which I have never heard of. I installed the latest Scons, found an undocumented scons.bat, launched a vc90 prompt in my jsoncpp dir, modified the SConstruct file to support a msvc90 target (i copied the boilerplate from the msvc80 platform which was already supported) ran scons.bat platform=msvc90 and got errors:
scons: done reading SConscript files.
scons: Building targets ...
cl /Fobuildscons\msvc90\src\jsontestrunner\main.obj /c src\jsontestrunner\main.c
pp -GR -EHsc /nologo /MT /nologo /Iinclude /I.
main.cpp
c:\projects\docwayhead\wspt_docway_plugins\contrib\jsoncpp-src-0.5.0\include\jso
n\value.h(5) : fatal error C1083: Cannot open include file: 'string': No such fi
le or directory
scons: *** [buildscons\msvc90\src\jsontestrunner\main.obj] Error 2
scons: building terminated because of errors.
i've already put too much effort into getting this to build, and jsoncpp is clearly unmaintained, so i give up for now.
No need to use Scons.
Under the /makefiles/vc71/ you can find a visual studio solution which you can up convert and build.
Modify the msvc90 platform file to make sure VC90 include directories are used when calling cl (clearly not yet the case in the provided command line you provided).
Note that Scons is written using Python and so are its configuration files, so people who know Python around you might be able to help you efficiently, even if they know nothing about scons.
Are you sure your VS command line is working properly? I got it to work just by:
- Adding a msvc90 entry in allowed_values
- copy/pasting the msvc80 section later and modifying it to use env['MSVS_VERSION'] = 9.0
I'm using scons 1.3.0.
The scons setup for jsoncpp 0.5.0 does not support VS 9.0 or 10.0 out of the box. You need to first add msvc90 to the allowed_values in the SConstruct line 21, and the to add this section on line 103.
elif platform == 'msvc90':
env['MSVS_VERSION']='9.0'
for tool in ['msvc', 'msvs', 'mslink', 'masm', 'mslib']:
env.Tool( tool )
env['CXXFLAGS']='-GR -EHsc /nologo /MT'
Just replace 9.0 with 10.0 and 90 with 100 for VS 10.0 support.
As of version 0.6.0 of jsoncpp, you can avoid a lot of hassle by using the new Amalgamated version. This is just two .h files and one .cpp file that you compile directly into your projects. It's working great for me so far in VS 9 (and with a few mods I'm now able to compile it with C++Builder 2010 as well -- haven't really tested the result yet).
By the way, I've filed a bug against version 0.6.0-rc2; one line in the Amalgamated version of json.h needs to have a macro name changed.
Related
On Windows 10, Visual Studio 2015, I'm building QtWebKit (5.212) against Qt 5.10.1, and I'm running into an error during the configuration part of the build.
Here is the command line I use:
perl Tools\Scripts\build-webkit --qt --release --only-webkit --no-ninja --cmakeargs="-Thost=x64 -DCMAKE_GENERATOR_PLATFORM=x64" -G \"Visual Studio 14 2015 Win64\" --prefix=E:\Qt-5.10.1\QtWebKitBin -v
Here is the error:
-- Performing Test Qt5Gui_PRIVATE_HEADER_FOUND
-- Performing Test Qt5Gui_PRIVATE_HEADER_FOUND - Failed
CMake Error at Source/cmake/OptionsQt.cmake:75 (message):
Header private/qhexstring_p.h is not found. Please make sure that:
1. Private headers of Qt5Gui are installed
2. Qt5Gui_PRIVATE_INCLUDE_DIRS is correctly defined in Qt5GuiConfig.cmake
Call Stack (most recent call first):
Source/cmake/OptionsQt.cmake:612 (CHECK_QT5_PRIVATE_INCLUDE_DIRS)
Source/cmake/WebKitCommon.cmake:50 (include)
CMakeLists.txt:139 (include)
-- Configuring incomplete, errors occurred!
The private header that it's using to do the test does exist in the Qt5 include directory, as one would expect, in this location:
E:\Qt-5.10.1\QtBin\include\QtGui\5.10.1\QtGui\private\qhexstring_p.h
The Qt5GuiConfig.cmake file exists only in the E:\Qt-5.10.1\QtBin\lib\cmake\Qt5Gui directory of the Qt installation (not in the QtWebKit source installation). I don't know if it's making use of this in any way.
What do I need to do to make the build find this directory as desired? Adding 'include\QtGui\5.10.1\QtGui\' to the INCLUDE env var doesn't work, but I don't believe that's the correct solution anyway.
Here are the parts of my environment related to the Qt directories:
INCLUDE = ...;E:\Qt-5.10.1\QtBin\include;E:\Qt-5.10.1\qt-everywhere-src-5.10.1\include
LIB = ...;E:\Qt-5.10.1\QtBin\lib;E:\Qt-5.10.1\qt-everywhere-src-5.10.1\lib
PATH = E:\Qt-5.10.1\qt-everywhere-src-5.10.1\qtbase\bin;E:\Qt-5.10.1\qt-everywhere-src-5.10.1\gnuwin32\bin;E:\Qt-5.10.1\QtBin\bin;...
QtBin is the directory with my compiled Qt 5.10.1.
qt-everywhere-src-5.10.1 is the Qt 5.10.1 source package
Thanks in advance for any help. I couldn't find any answers searching Google or StackOverflow.
According to the wiki, you should try to define CMAKE_PREFIX_PATH to point to your Qt installation
For example :
perl Tools\Scripts\build-webkit --qt --release --only-webkit --no-ninja --cmakeargs="-Thost=x64 -DCMAKE_GENERATOR_PLATFORM=x64 -DCMAKE_PREFIX_PATH=c:\Qt\Qt5.6.0\5.6\msvc2015" -G \"Visual Studio 14 2015 Win64\" --prefix=E:\Qt-5.10.1\QtWebKitBin -v
Build on Windows using build-webkit fails because it was unable to find the location for this header file qhexstring_p.h. How to fix this error and although is not a standard way but it works.
Located the file qhexstring_p.h in your prefix directory, or your
preferred Qt Installation SDK
Go to this file Source\cmake\OptionsQt.cmake and change this
From this CHECK_QT5_PRIVATE_INCLUDE_DIRS(Gui private/qhexstring_p.h)
to this below
CHECK_QT5_PRIVATE_INCLUDE_DIRS(Gui
C:/SDK/qt5-5.7.0-vs2015/qt5-x86-static-release/include/QtGui/5.7.0/QtGui/private/qhexstring_p.h)
The path here must match the path to your Qt installation and to the exact location the missing file is located. This ensures the test to look for the private director for the Qt installation is successful.
Then locate the file Qt5GuiConfig.cmake in your Qt installation directory and set the variable Qt5Gui_PRIVATE_INCLUDE_DIRS to the location were you private headers are found with this below.
set(Qt5Gui_PRIVATE_INCLUDE_DIRS "${_qt5Gui_install_prefix}/include/QtGui/${Qt5Gui_VERSION_STRING}/QtGui" "${_qt5Gui_install_prefix}/include/QtCore/${Qt5Gui_VERSION_STRING}/QtCore")
And note this version QtWebKit (5.212) of is known to have several
bugs, so its best you go for those stable ones.
The Save and run
perl Tools\Scripts\build-webkit --qt --release --only-webkit --no-ninja --cmakeargs="-Thost=x64 -DCMAKE_GENERATOR_PLATFORM=x64 -DCMAKE_PREFIX_PATH=c:\Qt\Qt5.6.0\5.6\msvc2015" -G \"Visual Studio 14 2015 Win64\" --prefix=E:\Qt-5.10.1\QtWebKitBin -v
As you wanted, that should be able to run as expected.
I've found the lightweight DSP c library - Soundpipe.
I want to use some filters from it. I do not really need binary files, but the problem is that the repository doesn't have its main header file - soundpipe.h. As I understand, this is because the library uses specific modules ported from Csound and FAUST languages. Also the repository's readme doesn't have installation guide for Windows. It says:
By default, Soundpipe needs libsndfile, and a standard build
environment. Other modules that use other external libraries will need
to be explicitly compiled by modifying config.mk (note: but the Makefile's folder doesn't contain config.mk, there is only config.def.mk)
To compile:
make
sudo make install
Ok, I've downloaded and installed libsndfile.
Then I have tried to use MSVC's nmake - it doesn't work:
makefile(7) : fatal error U1036: syntax error : too many names to left of '='
Stop.
Here is the beginning of the makefile:
> .PHONY: all clean install docs bootstrap
>
> default: all
>
> VERSION = 1.5.0
>
> INTERMEDIATES_PREFIX ?= . PREFIX ?= /usr/local
> ...
After that I've downloaded MinGW, mingw32-make result:
config.mk: No such file or directory
mingw32-make: *** No rule to make target 'config.def.mk', needed by 'config.mk'. Stop.
Ok, when I try to run the configure command, it doesn't work on my Win7 x 64 (sh: ./configure: No such file or directory, etc...)
I have the paths in mt system path variable:
C:\MinGW\bin;C:\MinGW\msys\1.0\bin
Links that I've read:
How Do I Run ./configure with MinGW?
Getting mingw-get to install correctly - mingw/msys path missing plus more!
MinGW's configure doesn't work after reinstalling Git for Windows and GCC_TDM too (No idea how to run configure).
Any ideas how to build the library or at least find missing source files (or make through CSound, Faust, ...) ?
The Soundpipe build system is designed to be used with POSIX environments, of which there are a few to choose from on Windows.
I've been able to build Soundpipe using both MSYS2 and Windows Bash on Windows 10.
I'm trying (for a few days now) to build a DLL generated from C++ code with boost/python to be used by python. I am a Student from Germany and had mostly to do with Java until now (I wrote some basic OpenGL and gimp filter stuff before in C++). So pardon me in advance for bad english or C++ beginner mistakes. I mean, programming with Java really is a lot more comfortable in comparison to C++. But enough of the skirmish.
The error:
LINK : fatal error LNK1104: File "boost_python-vc110-mt-gd-1_53.lib" could not be openend
My presets:
-using MS Visual Studio 2012 (11.0)
-using boost_1_53_0
-using python2.7 (I heard 3.3 may cause some Problems)
What I did:
Installed python and added it to PATH. Then created a new empty project in VS and a class file "Test.cpp" with following content as described on the boost tutorial page:
char const* greet()
{
return "hello world";
}
#include <boost/python.hpp>
BOOST_PYTHON_MODULE(Test)
{
using namespace boost::python
def("greet", greet);
}
Then came the new part for me, in VS Project Properties:
Configuration Properties > General > Configurationtype > Dynamic Library (.dll)
C/C++ > General > Addition Includedirectories > C:[..]\boost_1_53_0
Linker > General > Additional Library Directories > C:[..]boost_1_53_0\stage\lib
From the error I am assuming i did something wrong with Linker or Include. I also changed the Linker > General > Additional Library Directories to boost_1_53_0\libs because i wasn't sure, but the same error occured. And yes, I correctly included python. I am also not sure if i have to put something else beside python into Linker > Input for boost.
Then I build boost with bjam with no options except msvc-11.0 to be sure to have everything i need (though I read that boost/python doesn't need an extra build) and still got the same error. Can someone help me? I would love to have a step by step description of what to do. I am really despairing of this.
Btw.: I had the same error as this guy a few days before Linker error LNK1104 with 'libboost_filesystem-vc100-mt-s-1_49.lib' then stopped working on it and as I started again I got my brand new error (I can't tell you how this happened).
Since it is looking for a static library, add BOOST_PYTHON_STATIC_LIB flag, go to VS properties -> Preprocessor -> Processor definition, add BOOST_PYTHON_STATIC_LIB flag.
You need to create a "user-config.jam" file that indicates where the python headers and libs can be found by Boost.Build. You can create it in your boost_1_53_0/ directory with the following contents:
# Configure specific Python version.
using python : 2.7
: C:/Python27/python.exe
: C:/Python27/include #directory that contains pyconfig.h
: C:/Python27/libs #directory that contains python27.lib
: <toolset>msvc ;
Then from that boost_1_53_0/ directory you need to invoke b2 like this in order to build the missing library:
b2 toolset=msvc-11.0 --with-python variant=debug runtime-debugging=on link=shared --user-config=user-config.jam stage
(although I would recommend b2 toolset=msvc-11.0 --with-python --user-config=user-config.jam --build-type=complete stage so you can get in one step all the configurations that you might need in the future)
Once you have the libraries you need to add the directories to Visual Studio ( both to boost and to python).
Once you have successfully built the module you need to rename it to Test.pyd (exact name you used in BOOST_PYTHON_MODULE. If you have the python and Boost.Python libraries in your PATH or in your current directory you will be able to use the script in the tutorial:
import Test
print Test.greet()
and get the familiar "hello world".
Note that I'm very thankful for your tries but none of your answers helped. A fellow student then gave the hint for the right answer to me and some steps are really easy, others I don't understand, but it works now.
First Problem was: The new boost 1.53.0 does not work with Python27 or older. I then linked it with Python33 and had the build error removed.
But of course the build version didn't work without an error. As I tried to start my helloboost.py which imports from the .pyd built by VisualStudio and invokes the greet method, the following error occured:
ImportError: DLL load failed: The specified module could not be found.
As i checked the hello_ext.pyd with the dependency walker and wildly copy pasted around, I found out it needs the boost_python-vc110-mt-gd-1_53.dll (probably depending on what you need and built with bjam before) in the same folder. It worked then. Maybe someone can explain why nowhere was explained that I need this dll in the same folder as the pyd (or did I miss something? Is it just because I made a mistake before?)
Anyhow, I'm very glad it works now and hope it helps other people.
You probably will have worked this out by now - however:
When a .exe looks for a .dll to load no path is specified. Therefore a .dll must be in the search path for the file.
Also: I was trying to build 1.49 libs for Visual Studio 2013 - and kept getting the LNK error from my project. I don't know who suggested it on stackoverflow but someone\something gave me the idea to copy build system from a more recent boost which knows how to make .libs for more recent environments. (thank you)
I had to copy the boost build system from a 1.58 after running bootstrap in 1.58, copy b2, bjam and boost-build.jam to the earlier boost folder root to replace the same named files there. Also you will need to copy the later tools\build folder to support the build system.
Noting here in the hope it might help someone else in a similar cituation I found myself in.
See: Search Path Used by Windows to Locate a DLL
I tried to build Boost from source for 64bit using MinGW (x64) but failed when creating the bjam.exe. Any pointer to help is appreciated. Thanks.
Package: Boost 1.52.0 (download from sourceforge, C:\BoostSrc)
Package: MinGW-w64 (4.7.2-x64 rubenvb, C:\MinGW\rubenvb-4.7.2-64)
I created the following batch file to ensure repeatable building, but things got wrong. I cannot build the bjam.exe with supplied batch file. I'm not using the supplied "bootstrap.bat" as the non-standard installation path of MinGW (I have multiple mingw sets), and I have no MSVC installed in my machine
SET BOOST_VER=boost_1_52_0
SET PATH_MINGW=C:\MinGW\rubenvb-4.7.2-64
SET PATH_BJAM=%~dp0\%BOOST_VER%\tools\build\v2\engine
SET PATH="%PATH_MINGW%\bin"
PUSHD "%PATH_BJAM%"
REM check path
mingw32-make -version
REM error below
build.bat mingw --toolset-root=%PATH_MINGW% --show-locate-target
SET PATH=%OPATH%
POPD
REM ... some more ...
Error message
gcc: error: CreateProcess: No such file or directory
When I type the command directly from command prompt (set the path, go to location and invoke build.bat), it goes smoothly (with warnings which i think can be ignored)
This may solve your issue, but even if it doesn't it's a good idea to change it anyways.
Use a different variable name other than PATH as this is a built in and important windows environment variable, which MINGW may be relying on.
After digging into build.bat located at BOOST_ROOT\tools\build\v2\engine, when supplying "mingw" as the toolset, the script by-passed the "guessing toolset" step and failed to define the variable "BOOST_JAM_TOOLSET_ROOT", leaving calls to gcc-related executables failed.
Now I changed the batch as follow
PUSHD "%PATH_BJAM%"
SET "PATH=%PATH_MINGW%\bin"
REM add the line below
SET "BOOST_JAM_TOOLSET_ROOT=%PATH_MINGW%\"
build.bat mingw --show-locate-target
SET PATH=%OPATH%
I manually set the BOOST_JAM_TOOLSET_ROOT variable from external batch file and this worked fine. Beware of the ending "\" character, as the build.bat inside append the path variable as this:
set "PATH=%BOOST_JAM_TOOLSET_ROOT%bin;%PATH%"
Thanks very much for any comments and suggestions.
I'm trying to build the Boost 1_52 library with VS2012. Everything is building fine except for the Date Time dll (boost_date_time-vc110-mt-1_52.dll).
I'm using B2.exe as shown below
b2.exe toolset=msvc-11.0 --build-type=complete stage debug-symbols=on debug-store=database --abbreviate-paths
I've tried using cxxflags="/Y- " because I get other out of date PDB errors, this didn't change anything. I've tried setting Zm100, again no change.
When it gets to the gregorian section, I get a number of failures like shown below
common.mkdir bin.v2\libs\date_time\build\msvc-11.0\debug\debug-store-database\threading-multi
common.mkdir bin.v2\libs\date_time\build\msvc-11.0\debug\debug-store-database\threading-multi\gregorian
compile-c-c++ bin.v2\libs\date_time\build\msvc-11.0\debug\debug-store-database\threading-multi\gregorian\greg_month.obj
greg_month.cpp
libs\date_time\src\gregorian\greg_month.cpp : fatal error C1033: cannot open program database 'd:\boost\source\boost_1_52_0\gregorian\greg_month.pdb'
call "C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\vcvarsall.bat" x86 >nul
cl /Zm800 -nologo #"bin.v2\libs\date_time\build\msvc-11.0\debug\debug-store-database\threading-multi\gregorian\greg_month.obj.rsp"
The problem is that the build is trying to place the .pdb files for some object files of the date_time library in a non-existent directory.
You can work around the problem by doing:
md gregorian
before performing the build so the directory exists.
I'm not sure yet what the real fix is since the boost build system is more or less a black box to me.