LNK1104: cannot open file 'boost_thread-vc100-mt-gd-1_55.lib' - boost

I'm facing difficulty to build qpid cpp solution on windows xp
I have installed Boost 1.55.0, Python 2.7, Ruby 2.0.0 and CMake 2.8
Then I have added Environment variable paths for Python, Ruby and CMake, and then Boost variables are
set as followed
BOOST_ROOT C:\Boost
BOOST_LIBRARYDIR C:\Boost\lib
BOOST_INCLUDEDIR C:\Boost\include
I build Boost with following commands from command prompt
bootstrap
.\b2
I have downloaded qpid-cpp-0.26, Then I build qpid with following command from command prompt
cmake -i -G "Visual Studio 10"
Executing the above command have generated solution file for qpid
Then I opened qpid from solution file to build in Visual Studio 2010, when I tried to build the solution it
gave me following error in qpidCommon
cannot open file 'boost_thread-vc100-mt-gd-1_55.lib'
After bit of searching, I came up with solutions like
Adding “BOOST_ALL_DYN_LINK” in Preprocessor definations
Adding Library path in Linker – General - Additional Library Directories
but above solutions didn't work for me
Any Ideas?

I got a workaround, from command prompt run following command
bjam --build-type=complete
Add lib path in Project Properties - Configuration Properties - VC++ Directories
- Library Directories - here add library path(one which is in stage - lib)
This worked for me.

Related

Use vcpkg on WSL 1 with Visual Studio

I'm adventuring myself into compiling a CMake project using Visual Studio, targeting WSL 1.
Following Microsoft's tutorial to setup a CMake project in Visual Studio and debugging on WSL works fine. Things break when I try to install and use packages using Microsoft's vcpkg package manager after installing vcpkg into a separate Windows directory and integrating it into Visual Studio.
A simple example that fails:
# CMakeLists.txt
cmake_minimum_required(VERSION 3.0)
project(test)
find_package(protobuf CONFIG REQUIRED)
with the following error message:
CMake Error at C:\test\CMakeLists.txt:5 (find_package):
Could not find a package configuration file provided by
"protobuf" with any of the following names
protobufConfig.cmake
protobuf-config.cmake
Add the installation prefix of "unofficial-sqlite3" to CMAKE_PREFIX_PATH or
set "protobuf_DIR" to a directory containing one of the above
files. If "protobuf" provides a separate development package or
SDK, be sure it has been installed.
I'm getting Intellisense to recognize find_package and suggesting to install the package or copying the vcpkg command to clipboard.
The CMake toolchain file is pointing to the "C:/vcpkg/scripts/buildsystems/vcpkg.cmake" file in the WSL-GCC-Debug configuration settings. Installing vcpkg on the Linux system and setting the CMake toolchain file to the corresponding path creates the exact same error output.
Running the "vcpkg install protobuf:x64-linux" command in the terminal creates the following output:
Computing installation plan...
The following packages will be built and installed:
protobuf[core]:x64-linux -> 3.14.0#1
Detecting compiler hash for triplet x64-linux...
Error: while detecting compiler information:
The log content at C:\vcpkg\buildtrees\detect_compiler\stdout-x64-linux.log is:
-- Configuring x64-linux
CMake Error at scripts/cmake/vcpkg_execute_required_process.cmake:108 (message):
Command failed: ninja -v
Working Directory: C:/vcpkg/buildtrees/detect_compiler/x64-linux-rel/vcpkg-parallel-configure
Error code: 1
See logs for more information:
C:\vcpkg\buildtrees\detect_compiler\config-x64-linux-out.log
Call Stack (most recent call first):
scripts/cmake/vcpkg_configure_cmake.cmake:319 (vcpkg_execute_required_process)
scripts/detect_compiler/portfile.cmake:18 (vcpkg_configure_cmake)
scripts/ports.cmake:128 (include)
Error: vcpkg was unable to detect the active compiler's information. See above for the CMake failure output.
This is not a surprise as I don't expect it to be able to build packages targeting Linux on my Windows machine.
I'm new to cross-platform development and I find documentation on vcpkg + WSL rather sparse. Am I right in assuming that the packages should be installed by vcpkg running on the Linux system? Or do I need to have CMake setup on Windows to make vcpkg work on the Windows side?
Setup:
Windows 10 Build 19041
Visual Studio 2019 (16.8.5) with Visual C++ for Linux Development
Ubuntu 20.04 LTS as WSL
vcpkg commit f226416d2
It seems that I was a bit off track.
vcpkg installed on the Windows machine is accessible on the Linux system the same way as the actual CMake project is accessible. Setting the "CMAKE_TOOLCHAIN_FILE" variable to the absolute "C:/vcpkg/scripts/buildsystems/vcpkg.cmake" path gets translated into "/mnt/c/vcpkg/scripts/buildsystems/vcpkg.cmake".
The missing step was to run the ./bootstrap-vcpkg.sh script on the Linux system to make sure packages can be installed by vcpkg on the Linux system.
I also learned that packages have to be installed manually by running the vcpkg install command since there is no "build in" way to do this via CMake.

Installing and using IPopt with Cygwin - or even better alternative?

I am new to the optimization field. Did some projects with fmincon though, and am now looking for an alternative usable in OpenSource, preferrably somehow usable in Python. Therefore I found IPopt. Any other suggestions which are equally good as fmincon?
I tried to install IPopt by compiling it. And I must say, it seems like a mess. I tried all version and ended up with the most promising one "Installation with Cygwin using the MSVC++ compiler " from the Manual. Therefore I have to install CYGwin and change the make.exe. Done.
Add the cl.exe from Visual Studio (Visual Studio 1 in my case) to the Apth environment. Done.
add "call "call "C:\Program Files (x86)\Microsoft Visual Studio 14\VC\vcvarsall.bat" " to the cygwin.bat. Done.
Now two things. When I do "./configure" with the downloaded IPopt sources I get: "configure: error: /bin/sh './configure' failed for Ipopt"
Also like suggested in the manual calling "./configure -enable-doscompile=msvc" to tell cygwin to use the windows compiler gives me "configure: error: --enable-doscompile=mscv not supported anymore."
So. Basically I am not able to install Ipopt. Using it seem like impossible, as all other methods to build it also failed on my Win10 64bit. It seems that the manual is outdated or I am not finding the corect way to do it, hope some of u guys probably can help. Compiling is something rather new and I am happy to learn.
Tahnks in advance.
Ensure that you have the following packages installed in Cygwin.
Devel: gcc
Devel: gfortran
Devel: pkg-config
Devel: subversion
Archive: unzip
Utils: patch
Web: wget
Utils: dos2unix
Assuming you are building for 64-bit, add path to cl.exe in Cygwin.bat (located in root directory of location where Cygwin was installed) so that msvc can be used from Cygwin –
call "C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\bin\amd64\vcvars64.bat" (vcvarsall needs you to specify architecture version)
You will need the Intel Fortran Compiler. It comes along with Parallel Studio. Free for students, faculty, open source contributors.
In .bash_profile (located in pathto/cygwin64/home/username/) add this line so that ifort recognizes msvc linker (path given above should be to link.exe of msvc) –
alias ifort='ifort -Qlocation,link,"C:/Program Files (x86)/Microsoft Visual Studio 12.0/VC/bin/amd64"'
Intel Fortran gets integrated to a visual studio shell. Run this shell. Execute cygwin.bat from this shell. Check the version of link (link --version). If it is not the microsoft linker, you may have to remove the Cygwin link.exe file from Cygwin folder.
Note that any other bash terminals (e.g. Git Bash) might interfere. You will come to know only while running the configure script. It tries to access packages from those bash terminals. You may have to place them elsewhere temporarily, so cygwin does not find them.
I understand you have read the manual, so you must have downloaded the required third-party tools for Ipopt (asl, lapck, blas and one linear solver) .
You can now run (in Ipopt root folder):
mkdir build
cd build
../configure --enable-msvc=MD
make
make install

CMake and Visual Studio with not default installation folder

I am trying to build something using CMake and VS 2012. The problem is I have my VS installation on D:\Pliki programów (x86)\Microsoft Visual Studio 11.0. I have no free space on my C drive.
CMake have problem with finding my VS. I tried to specify VS compiler cl.exe but it was asking for dll in the same folder anyway. I also tried to use specified toolchaing with vcvarsall.bat. But I am not sure if I am doing those things right.
I guess that I need to add VS location to CMake, but how? I tried setting PATH but it did not work.
And searching about that problem is difficult, all search engines think that I want to change installation path for my program that I want to build.
UPDATE
I've added variable_watch(CMAKE_MAKE_PROGRAM).
CMake Debug Log at CMakeLists.txt:3 (project):
Variable "CMAKE_MAKE_PROGRAM" was accessed using UNKNOWN_READ_ACCESS with
value .
CMake Debug Log at CMakeLists.txt:3 (project):
Variable "CMAKE_MAKE_PROGRAM" was accessed using MODIFIED_ACCESS with value
C:/Windows/Microsoft.NET/Framework/v4.0.30319/MSBuild.exe.
The C compiler identification is unknown
The CXX compiler identification is unknown
CMake Error at CMakeLists.txt:3 (project):
No CMAKE_C_COMPILER could be found.
In output file:
LINK : fatal error LNK1104: cannot open file 'MSVCRTD.lib'
Is CMake looking for libs in VS 11 installation folder? The thing is that VS installer put libs in C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\lib\amd64.
For cases like this (and similar), I keep a VCEnvCmd.bat in my source trees:
call "%VS110COMNTOOLS%\..\..\VC\vcvarsall.bat" amd64 & %*
Executing that .bat without parameters will find and run vcvarsall.bat, setting up the environment for the amd64 target in the current shell (which you could change or parameterize according to your needs, like the version number embedded in that environment variable).
The nice trick is, for those Nightly / Continuous builds, you can use the .bat as a "prefix" for setting up the environment, e.g. in the task manager:
VCEnvCmd.bat ctest -S CTestScript.cmake,Nightly
The advantage is that you use what MSVC already gives you (the VS...COMNTOOLS variable), without having to clutter your environment further with persistent changes to PATH etc.

Cmake not finding Visual Studios 2012 in Generators list

I'm trying to run through the Firebreath tutorial, but I cannot get Cmake to work. Cmake does not register any version of Visual Studios under the Generators list. This is the list when running cmake --help:
Generators
The following generators are available on this platform:
Unix Makefiles = Generates standard UNIX makefiles.
Ninja = Generates build.ninja files (experimental).
CodeBlocks - Ninja = Generates CodeBlocks project files.
CodeBlocks - Unix Makefiles = Generates CodeBlocks project files.
Eclipse CDT4 - Ninja = Generates Eclipse CDT 4.0 project files.
Eclipse CDT4 - Unix Makefiles
= Generates Eclipse CDT 4.0 project files.
KDevelop3 = Generates KDevelop 3 project files.
KDevelop3 - Unix Makefiles = Generates KDevelop 3 project files.
Sublime Text 2 - Ninja = Generates Sublime Text 2 project files.
Sublime Text 2 - Unix Makefiles
= Generates Sublime Text 2 project files.
I have re-installed CMake, installing Visual Studios 2010 and 2012 (Express and Professional editions), and even uninstalled and re-installed .NET 4.0 to 4.5 (from here). It works fine on my personal computer, as I got it running on the first go. However, my work laptop is just not registering Visual Studios.
I'm running it both on Windows 7 Enterprise SP1. Any help is appreciated.
Here is the exact error I am getting:
C:\code\tutorial2\TutorialTestPlugin>firebreath\prep2012.cmd . build
A subdirectory or file build already exists.
Using projects in: "C:\code\tutorial2\TutorialTestPlugin"
Generating build files in: "C:\code\tutorial2\TutorialTestPlugin\build"
NOTE: The build files in "C:\code\tutorial2\TutorialTestPlugin\build" should *NE
VER* be modified directly.
When needed, make project changes in cmake files and re-run this script.
Project-specific cmake files are found in [plugin dir]\CMakeLists.txt and
[plugin dir]\Win\projectDef.cmake.
Note that parameters for cmake should be enclosed in double quotes, e.g. "-DVERB
OSE=1"
CMAKE parameters:
C:\code\tutorial2\TutorialTestPlugin\build>cmake -G "Visual Studio 11" -DFB_PROJ
ECTS_DIR="C:\code\tutorial2\TutorialTestPlugin" "C:\code\tutorial2\TutorialTest
Plugin\firebreath"
CMake Error: Could not create named generator Visual Studio 11
cygwin warning:
MS-DOS style path detected: C:\code\tutorial2\TutorialTestPlugin\firebreath
Preferred POSIX equivalent is: /cygdrive/c/code/tutorial2/TutorialTestPlugin/f
irebreath
CYGWIN environment variable option "nodosfilewarning" turns off this warning.
Consult the user's guide for more details about POSIX paths:
http://cygwin.com/cygwin-ug-net/using.html#using-pathnames
The problem is you are using the cmake that is included in cygwin instead of the windows version of cmake. It appears that the current cygwin version is compiled without the generators for Visual Studio while the windows version has these.
In your case a simple way to get windows to use the windows version of cmake is to uninstall the cygwin cmake since it does not appear that you need that anyways.
An alternate method would have been adjusting your system path so that c:\cygwin\bin is after C:\Program Files (x86)\CMake 2.8\bin.

Trouble building Boost Libraries

OS: Win7
IDE: Visual Studio 2010 Professional
Boost Lib Version: 1.47
Downloaded "boost_1_47_setup.exe" installer from http://www.boostpro.com/download/
Initially installed everything for VS 10, then just checked every box (5+ GB install!)
Added the "boost\boost_1_47" path into "Additional Include Directories" in C++->General
Copy/Pasted code from "Getting Started on Windows: 4 - Build a Simple Program Using Boost"
Compiled without issue
Included boost/regex.hpp and re-compiled
Received Error:
LINK : fatal error LNK1104: cannot open file 'libboost_regex-vc100-mt-gd-1_47.lib'
Expected, haven't built the binaries yet.
Ran "Visual Studio Command Prompt" from tools folder in my VS 10 installation as admin
cd'ed to boost root
Ran bootstrap.bat from command line
Received Error:
Building Boost.Build engine
The system cannot find the path specified.
'.\build.bat' is not recognized as an internal or external command,
operable program or batch file.
Failed to build Boost.Build engine.
Please consult bootstrap.log for furter diagnostics.
Everything I did came from the Getting Started page on Boost.org. Not sure if its just dated or if I'm doing something wrong.
Came here looking for answers, found some similar issues, namely the following:
Problem with C++ Boost installation (can't find file) in VC++ 2010
Problem with C++ Boost installation (can't find file) in VC++ 2010
Boost C++ Libraries linker error libboost_serialization-vc100-mt-gd-1_47.lib
Boost C++ Libraries linker error libboost_serialization-vc100-mt-gd-1_47.lib
No dice. Any help would be appreciated. Thanks
The compiler cannot find the BOOST's library file. To fix the issue you have to find on your computer the libboost_regex-vc100-mt-gd-1_47.lib file and add its folder path to the Project->YourProjectName Properties (Alt+F7)->Configuration Properties->Linker->General->Additional Library Directories. After recompile your project.
This is the answer to the above comment of #Johnny 5....thousand. In VS10 the compiler-wide additional libraries are deprecated. I solved the problem by adding a new project property sheet to all my projects. It is possible to do it by calling the Property Manager Tab (View->Property Manager). In the Property Manager Tab is necessary to click right mouse button on the project, select Add New Project Property Sheet, Save the sheet to a well-known place. After to define a new User Macro - Name:BOOST, Value: Your Boost Path, for example c:\boost_1_47_0\, also add the $(BOOST) to the Additional Include Directories and ad the $(BOOST)\lib to the Additional Library Directories. That's all. For all other projects is required to add existing property sheet.

Resources