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.
Related
I have a pretty large software library using CMake to be compiled. We use Linux mostly, but now a new colleague wants to use Visual Studio.
Is there any way to create a new VS 2017 project from the existing source codes with CMake structure?
I know, it's possible to do it with CLion, but I have no idea about VS, as I have a very little experience with it.
Other questions seem to focus on creating an empty project, which will use CMake, but not on creating a project from already existing source files.
Creating a cmake project with visual studio
Creating a project with visual studio 2017
I'm not sure why you asked for details but...
Assuming you are using cmake 3.13 then you can do the following in a command shell:
cmake -G "Visual Studio 15 2017" -S path_to_source -B path_to_build
This will then create a solution file. Actually it creates a solution file for every project() command that is issued in CMakeLists.txt.
You can then open the solution file in Visual Studio, and build the project as usual.
You don't even need to do this in the Visual Studio GUI. After creating the initial project you can also issue the command:
cmake --build path_to_build
Which will kick off the build at the command line.
Now if your CMakeLists.txt in path_to_source is using Linux specific libraries or gcc specific compiler settings then the CMakeLists.txt will have to get updated to the Windows equivalent.
The alternative is to start Visual Studio and then use File->Open->CMake and open the CMakeLists.txt file in path_to_source. It'll then start to generate the project. But I prefer using the command line method.
I don't know how to do this with msvc.
I succeeded when I used mingw.
I have to use make and make install in the command line because I want to use QtXlsxWriter which is a module.
I installed visual studio 2013 and Qt 5.5.1 VS 2013 only
Visual Studio has nmake instead of make. You also need Perl. Strawberry Perl may be used here:
Start Visual Studio command prompt
Set the PATH variable to point to Perl and Qt binary folders, for example: PATH=c:\Strawberry\perl\bin;c:\Qt5.5.1\5.5\msvc2013_64\bin;%PATH%
go to QtXlsxWriter folder
qmake
nmake
nmake install
Assuming you have a .pro Qt project file.
You can generate a makefile with qmake and compile it with nmake:
qmake
nmake
You can open it in QtCreator IDE and build from there directly.
You can generate Visual Studio IDE project file (.vcxproj):
qmake -tp vc
and
either open it in Visual Studio and build from there
or
build it from command line with msbuild:
msbuild projectname.vcxproj
qmake: Creates Makefile from qtxlsx.pro
make: Builds Makefile
Bullsit, sorry. There is no make in the Windows build system.
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.
I am open to either a Visual Studio answer or a MinGW answer. I just finished building LLVM 3.2 using CMake and Visual Studio 2010. Everything went smoothly, but I have no llvm-config. Do I need it? Every example I see on the intertubes makes use of that tool. If I don't need it, how do I configure my project to make use of LLVM?
To be clear, I am not trying to use LLVM tools/compilers (like clang and whatnot). I am trying to write C++ code that uses the LLVM libraries to produce LLVM IR and even compile that stuff. I setup my include and lib folders. I ran llvm-config in Linux and saw a long list of macros and libraries.
I have a wonderful folder full of goodies. It just has no llvm-config in there: C:\Program Files (x86)\LLVM\
llvm-config does not exist in windows prebuilt binaries. You need to compile from the source code to get it.
Grab CMAKE > 3.5 , install it and make sure you add it to PATH.
Download Visual Studio 2019
Donwload the source code (9.0.1 is the latest as I'm writing this)
Extract the source code
Cd into the root of the llvm source-code
In cmd, type cmake . this will generate Visual Studio 2019 sln.
open sln file(LLVM.sln), change the build type to Rlease, build the whole project
navigate to your Rlease\bin, and there you have your llvm-config.exe
If you have built the LLVM in debug version all the executables (including llvm-config) have been placed in your build directory (containing Visual Studio project and solution files) in bin/Debug/ subdirectory. In case of release build replace Debug with Release.
If you are interested in using LLVM on Windows more than building it, check out Windows snapshot builds.
I have installed and built (successfully as far as I can tell), boost 1_47_0. I am now trying to get the sample program (the regex one) with their install guide to run and it is giving me the following link error:
LNK2019: unresolved external symbol "private: class boost::basic_regex ....
I suspect that the problem is that the libraries were built as vc100 using b2 and the Platform Toolset is Windows7.1SDK. I cannot change the Platform Toolset to v100 or it generates a kernel32.lib missing error. And I cannot seem to figure out how to build boost so that it is sdk7. I am using Visual C++ Express 2010 and have also tried building from the Windows7.1SDK command line prompt.
Any ideas?
I meet the same issue when I install boost with installer from "BoostPro Computing". And I solve it by compiling boost lib from source code.
Here is the steps:
enter Visual Studio 2010 Express Command Prompt
cd to the unzipped boost dir
bootstrap.bat
.\b2
Done.
Here is my environment:
Win7 64bit
Visual Studio 2010 Express
boost 1_52_0
I build boost using a batch file that calls bjam, and I have not had any problems using the regex library in my projects. I am using VS2010 Pro. Here are the lines from my batch file, the extra library locations might not be important to you, I'm just putting them here for completeness:
call "C:\Program Files\Microsoft Visual Studio 10.0\VC\bin\vcvars32.bat"
SET ZLIB_SOURCE=%LIBS%\zlib
SET ZLIB_INCLUDE=%LIBS%\zlib
SET BZIP2_SOURCE=%LIBS%\bzip2-1.0.5
SET BZIP2_INCLUDE=%LIBS%\bzip2-1.0.5
SET BZIP2_BINARY=libbz2
SET ZLIB_BINARY=zdll
SET EXPAT_INCLUDE=%LIBS%\Expat\Source\lib
SET EXPAT_LIBPATH=%LIBS%\Expat\Bin
SET EXPAT_BIN=%LIBS%\Expat\Bin
bjam.exe --disable-filesystem2 --build-type=complete --user-config=%UTILS%\user-config.jam
Of course the path to your libraries and your user-config.jam will be different, and the only one line in user-config.jam that is really important is:
using msvc : 10.0 ;
After a successful build you will want to add the path to the stage/lib directory to you additional libraries settings for the project so the linker is satisfied. Also since this is an express build you may have to fiddle with the include path to pick up the platform SDK. I run this batch file from the top level Boost directory.