Environment
Windows 10 version 1903, 64bit
Eigen 3.3.7
freeglut 3.2.1
Visual Studio 2015 Update 3
When I run the following cmake command to build Eigen3:
cmake -DCMAKE_CONFIGURATION_TYPES=Release -DPKG_CONFIG_EXECUTABLE=D:\3rd-parties\pkg-config.exe -DGLUT_glut_LIBRARY=D:\3rd-parties\freeglut-3.2.1\install\lib\freeglut.lib -G"Visual Studio 14 2015 Win64" ..
, Eigen3 always complains:
-- Could NOT find GLUT (missing: GLUT_glut_LIBRARY)
even though I have correctly set the GLUT_glut_LIBRARY variable. I'm sure freeglut 3.2.1 was correctly built under Release mode in VS2015 and the path is specified without any problem. So, how to have Eigen3 work with freeglut, or Eigen3 does not work with freeglut at all, but only with the old legacy GLUT? Besides, does Eigen use or depend on GLUT? If not, I may just safely ignore this error. Thank you.
Related
I have multiple versions of MSVC C++ build tools for the same toolset(v142) installed using Visual studio build tools. How can I set the default or preferred version of the MSVC compiler. Is there a registry or environment variable for setting this in Windows or with Cmake?
Cmake picks up the latest version and I want it to use older version for some builds. CMake does seem to have a -T parameter for toolset but in my case both versions are for toolset v142.
Please note that I do not have or intend to use Visual Studio IDE for this since I am dealing with command line builds for CI purposes.
You can pass the required version via CLI:
$ cmake ... -T v142,version=14.24
See also CMAKE_GENERATOR_TOOLSET variable.
Is there a way to use the cmake gui to specify a x64 build, since by default cmake on windows creates a 32-bit Visual Studio solution.
From the command line, folks say to do this:
C:\projectx\build> cmake ..\make -G "Visual Studio 10 Win64"
but how do I get to the command line arguments from the cmake windows gui?
see:
http://www.saoe.net/blog/778/
How to build x86 and/or x64 on Windows from command line with CMAKE?
cmake -G Ninja on windows specify x64
The only way I have found to do this, is to wipe the output folder, and then it lets you select Visual Studio 10 Win64 when you first configure the cmake project. Make sure you choose the correct item in the dropdown.
You can specify it during the first configure process.
After that, if you want to change the machine type you need to delete the cache with the "Delete Cache" command in the "File" menu and start the configure process again.
This will happen if you run cmake in a x64 Native Tools Command Prompt for VS 2019 for the first time (otherwise delete build folder).
I use cmake to generate a NMake file, everything goes fine.
I use the x64 toolsets (without Visual Studio, only the SDK), so I type nmake, but it generate a x86 build and not a x64 build.
Do you know why ? and how to force nmake to target x64 ?
Thanks
Just to share, use the following to force the x64 platform. Use this command prompt command.
VsDevCmd.bat -host_arch=amd64 -arch=amd64
Both -host_arch and -arch are mandatory !
I understand that CMAKE_BUILD_TYPE only works for single-configuration generators like Unix Makefiles. There are also multi-configuration generators like Visual Studio or Xcode where CMAKE_BUILD_TYPE does not works. (see this and this question for further info). I've generated Visual Studio 2013 x86 project with cmake-gui for libharu and there is not possible to switch from win32 to x64 in Visual Studio. I'm wondering why in multi-configurations it is need to specify architecture (x86 or x64) in cmake? Why it is not possible in Visual Studio directly? Is there some limitation or benefit or something that I should be aware of?
Thanks
Because this switch between 32 and 64 bit is not available in all environments cmake follows the philosophy to use out-of-source builds and have each compiler in their own directory. So a 32 bit and a 64 bit build can be seen as a a different compilation environment so they each generate their own folders.
So while this is a cmake limitation it is also intentional.
This answer also mentions this: https://stackoverflow.com/a/5359191/152359
I am trying to create a 64bit Gtk GUI with the GTK# library and am not having much luck. I'm using Visual Studio 2008, version 3.5 of C#. I obtained version 2.8.5 of the GTK# source and modified the makefiles to compile 64bit. I compiled this source against the 64bit version of GTK+ v2.22. The source compiled and I was able to import the "sharp" DLLs into my VS project.
When I try to run my app, it complains that it's trying to load a 32 bit GTK assembly. I altered the makefiles to use the 64bit versions of MinGW compiler and dllwrap and added the /platform:x64 directive to calls to CSC.exe. I am at a loss. I must be missing another flag/directive for 64bit somewhere.
Has anyone else tried to compile GTK# for 64bit? Does anyone know of a place to download precompiled 64bit versions?
I'm pulling my hair out trying to make this work. I would greatly appreciate any help on this.
Steve---