I recently install CGAL but it does't work.
I follow some steps:
1) Install visual 2013 ultimate.
2) Install boost 1_56_0 (successfully, I have tested it on visual)
3) Install Cmake 3.0.2 and CGAL 4.5 .exe and restart the windows
4) Make project CGAL by CMake and it said: configuring done, generating done.
5) I open project and run file .sln but it shows some errors
I do what you said, #user2942203, here what I got:
note: you can zoom your browser to see it clearly.
please help me, I hope it doesn't bore you much.
By default, on Windows, CGAL libraries will want to use the dynamic libraries (.lib/.dll) of Boost, instead of static libraries. The unresolved symbols that you copy-pasted have ""__declspec(dllimport)" in their name, showing that you are using the default.
It might be that you have installed only the static libraries of Boost, and not the dynamic libraries. Two solutions:
You can try to toggle the Boolean CGAL_Boost_USE_STATIC_LIBS, in the advanced configuration of CGAL, in CMake. That will configure CGAL libraries to search for Boost static libraries, instead of dynamic libraries.
You can reinstall/recompile Boost libraries, to include dynamic libraries as well.
Related
I am trying to create static program in Visual Studio, where I end up with a single executable that I can deploy to other PCs.
I am using VCPKG to static download libraries, as per the instructions here:
https://devblogs.microsoft.com/cppblog/vcpkg-updates-static-linking-is-now-available/
In the following post, the answer to the question is to use VCPKG and then CMAKE
Using Cmake to build ssh.dll with Visual Studio 2017
My question is with regards Cmake. If VCPKG downloads and creates folders that my project links to. What's Cmake for and why would I need to use it?
What's Cmake for and why would I need to use it?
https://cmake.org/ read the text below the logo.
It can be used to generate a project files for different build system, like make, msbuild, ninja etc.
It also can be used as a general scripting language.
You don't need to use it but it is highly encouraged for consuming other dependencies.
vcpkg however will download cmake since it is used as a scripting language within vcpkg.
I have a project in visual studios where I have used the properties options to link tesseract and leptonica libraries. However, in CLION using cmake I can include the headers fine, but when I try and link the .lib's I get undefined reference errors for every single related function. I have scoured the internet and cannot figure out how to set up tesseract-ocr with clion. I just want to be able to run the https://tesseract-ocr.github.io/tessdoc/Examples_C++.html examples in CLION.
I'm using several libraries built through vcpkg (such as civet-web and prometheus-cpp), against my Visual C++ projects. When building x86 all is perfect, in x64 I get a bunch of linker errors:
error LNK2001: unresolved external symbol __CxxFrameHandler4
Searching online all references to this symbol/error are about specific projects, I cannot find what __CxxFrameHandler4 is and what problem this error is highlighting. I don't know if it's a problem with the way vcpkg is building the library, or a problem in my project or how to start looking for a solution.
I did find this blog article but it is in reference to a preview of VS2019, I cannot find any settings related to it: https://devblogs.microsoft.com/cppblog/making-cpp-exception-handling-smaller-x64/
If anyone can explain what this is all about it would be a big help.
I faced the same issues when trying to install and use cpr with vcpkg. I wanted to use cpr library in a VS2015 project.
Reason: I had VS2019 installed. vcpkg uses latest version of toolset Visual Studio.
Resolution: Add your own triplet or change existing such a way that your specified toolset is used. Adding did not work in my case so I changed existing "triplet" files in triplet folder in vcpkg. I wanted vcpkg to use toolset that comes with VS2015 (It's V140)
Content of x86-windows.cmake file
set(VCPKG_TARGET_ARCHITECTURE x86)
set(VCPKG_CRT_LINKAGE dynamic)
set(VCPKG_LIBRARY_LINKAGE dynamic)
set(VCPKG_PLATFORM_TOOLSET "v140")
set(VCPKG_DEP_INFO_OVERRIDE_VARS "v140")
Content of x64-windows.cmake file
set(VCPKG_TARGET_ARCHITECTURE x64)
set(VCPKG_CRT_LINKAGE dynamic)
set(VCPKG_LIBRARY_LINKAGE dynamic)
set(VCPKG_PLATFORM_TOOLSET "v140")
set(VCPKG_DEP_INFO_OVERRIDE_VARS "v140")
A more general answer is that this happens if you are mixing objects that were built with different platform toolsets, e.g.,
Visual C++ 2015 (v140)
Visual C++ 2017 (v141)
Typically, you (or someone else) may have built a dependency of your project with a different compiler version (platform toolset), and the fix it to change the platform toolset of either your project or the dependency (or use the correct build of the dependency, if you used a pre-built package)
I think you pointed out the right article which is
https://devblogs.microsoft.com/cppblog/making-cpp-exception-handling-smaller-x64/
I faced a similar issue in linking 64-bit library built with VC143 toolset with a 64-bit Application built with VC141 toolset.
After adding the following properties to VC143 built static library project, I was able to build the application. This disables the new feature mentioned in the above article (Exception Handling Smaller)
VS2019->Properties->C/C++->Command Line add '-d2FH4-'
VS2019->Properties->Linker->Command Line add '-d2:-FH4-'
I'm new at boost library.
I have question if it is possible to build boost library right before my visual studio project is built(using something like prebuild script)
More specifically, my project is using socket.io-client-cpp. it uses boost library and demands to install boost before build for itself. It's so so so annoying to novice like me. So I want to automate that process. I think using cmake can be the solution maybe.
[https://sourceforge.net/projects/boost/?source=directory][1]
download the windows version boost.
is it possible to generate Visual Studio projects that are redistributable with CMake?
The project file in question are examples/demos of our library. We don't want that our customers have to install cmake (and learn what to do with it) just to compile a few examples.
The problem with CMake generated project files is that they contain absolute paths (relativeliy easy to fix with string replacement) and references to CMake files (e.g. in prelin step. This is not easy to automatically change).
Does CMake provide an easy way to solve this problem?
Thank in advance
Yes,
you can have a cMake project, and generate Visual project on windows, XCode or makefile for other plateforms.
You use it for development, and after use install package makers like iceberg on mac, or scripts based installers on linux, or other installer creator on PC.(inno setup I think could be a solution)
Good luck