CGAL Polygonal_surface_reconstruction_Examples do not compile - c++

I am new to CGAL and C++ and I am running into compile errors when setting up the CGAL Polygonal_surface_reconstruction_Examples as described in the manual.
I have installed glpk-4.65 (https://sourceforge.net/projects/winglpk/) and then had to manually point CMake to the directory.
CMake made the VisualStudio2022 SLN file but when I try compiling I am getting the error below. I assume that there is something not set up correctly with GLPK but I am not sure how to resolve this.
Severity Code Description Project File Line Suppression State
Error LNK2019 unresolved external symbol glp_create_prob referenced in function "public: virtual bool __cdecl CGAL::GLPK_mixed_integer_program_traits<double>::solve(void)" (?solve#?$GLPK_mixed_integer_program_traits#N#CGAL##UEAA_NXZ) polyfit_example_user_provided_planes C:\dev\CGAL-5.4-examples\CGAL-5.4\examples\Polygonal_surface_reconstruction\sln\polyfit_example_user_provided_planes.obj 1

Related

Unresolved external symbol symbol __imp_get_function_ptr when compiling a C++ MEX MATLAB API

I am trying to run one of the example codes from the CPP Mex Repository of Matlab R2021a in the VS2017 IDE. Specifically, I am running the phonebook.cpp one. I previously ran with no problems when compiling other solutions in VS2017 with the C Mex API following this guide. However, I get the following message when compiling phonebook.cpp:
Severity Code Description Project File Line Suppression State
Error LNK2019 unresolved external symbol __imp_get_function_ptr referenced in function "int (__cdecl*__cdecl matlab::data::detail::resolveFunction<int (__cdecl*)(int,int,bool *)>(enum matlab::data::detail::FunctionType))(int,int,bool *)" (??$resolveFunction#P6AHHHPEA_N#Z#detail#data#matlab##YAP6AHHHPEA_N#ZW4FunctionType#012##Z) test C:\Users\DuuMushishi\Documents\test.obj 1
I am not sure what library needs to be added or if the error is due to something else
I fixed the issue. Turns out I had to include in additional dependencies "libMatlabDataArray.lib" (in my case, located in C:\Program Files\MATLAB\R2021a\extern\lib\win64\microsoft)

VS2017: Linker errors after enabling MASM in C++ project

So I'm trying to create a .dll wrapper (32 bit x86) in C++ and I need to write assembler wrapper functions. I've tried to use inline assembler in combination with __declspec(naked) but that didn't seem to work for C++ constructors (the compiler still generated code).
I've tried to work around that by writing with raw assembler files directly.
Before doing anything with MASM (and invoking any of my assembler functions) my project compiles and links fine.
In order to be able to use MASM I went into the "Build Customizations" and enabled MASM. After doing that I now get a bunch of linker errors with seemingly unrelated functions:
Error LNK2001 unresolved external symbol _memset SoundEngine D:\Home\Documents\Git\SoundEngine\SoundEngine\MSVCRT.lib(utility_desktop.obj) 1
Severity Code Description Project File Line Suppression State
Error LNK2001 unresolved external symbol _free SoundEngine D:\Home\Documents\Git\SoundEngine\SoundEngine\MSVCRT.lib(delete_scalar.obj) 1
Severity Code Description Project File Line Suppression State
Error LNK2001 unresolved external symbol __cexit SoundEngine D:\Home\Documents\Git\SoundEngine\SoundEngine\MSVCRT.lib(utility.obj) 1
Severity Code Description Project File Line Suppression State
Error LNK2001 unresolved external symbol __CxxThrowException#8 SoundEngine D:\Home\Documents\Git\SoundEngine\SoundEngine\MSVCRT.lib(throw_bad_alloc.obj) 1
Since those aren't even in refrenced (at least directly) in my code, how do I make this error go away?
Does VS change any name mangling or linker options after enabling MASM?

Installing Glog linking error

I am new to programming. I want to install Glog on my Windows 10 system. I have followed the instructions found in a Stack Overflow thread with the same name.
I used cmake and Visual Studio 2015 to build the project.
First anomaly of the built file: I noticed that in the glog directory the header file "log_severity.h" was missing. To alleviate this problem, I copied the "log_severity.h" from the GitHub repository and pasted it.
http://imgur.com/QeLTnat
I then created a sample program that just initializes the logger by only using
google::InitGoogleLogging(argv[0]);
in the main.
Before compiling I direct the linker to include an additional include directory. This include directory is the one with the header files as in the second image (with the log_severity.h etc.):
http://imgur.com/yrjOIot
Yet I still receive a linking error when compiling the code:
1>Source.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) void __cdecl google::InitGoogleLogging(char const *)" (__imp_?InitGoogleLogging#google##YAXPEBD#Z) referenced in function main
1>D:\Documents\Programming\C++\Programme\GLogTest\GlogTest\x64\Debug\GlogTest.exe : fatal error LNK1120: 1 unresolved externals
What am I doing wrong?
Thanks a lot of any answers.
I solved it. When you build the project in visual studio, there is also an "Installation" folder inside the MS project. I forgot to build that as well!

Including Lua in VS2015 C++ Project

I would like to integrate Lua into my current C++ application I build with VisualStudio 2015 (x64 mode).
I grabbed a simple Lua wrapper from here, and the Lua binaries for windows x64 from here (the lua-5.1.5_Win32_dll14_lib.zip one).
Next, I added the include and library path to the project preferences. Works so far in the IDE. However, when I try to compile the code it throws 24 errors (like these first two):
1>LuaScript.obj : error LNK2019: unresolved external symbol "lua_close" referenced in function ""public: __cdecl LuaScript::~LuaScript(void)" (??1LuaScript##QEAA#XZ)".
1>LuaScript.obj : error LNK2019: unresolved external symbol "lua_gettop" referenced in function ""public: void __cdecl LuaScript::clean(void)" (?clean#LuaScript##QEAAXXZ)".
which tells me next to nothing. Seems that the linker is unable to find the library but the includes are working and the path to library is set, too. Any suggestions what I might have missed or should look into? Any hint would be appreciated!

Installing GLFW 3.0 not working Visual Studio

I'm trying to create a GLFW project, but I'm getting LNK2019 errors with the basic setup.
I've downloaded the latest binary (glfw-3.0.bin.WIN32.zip) to a folder.
I've created a new, empty console project.
Within VC++ Directories, I've added the following line to include directories:
C:\C++Libraries\glfw-3.0.bin.WIN32\include
I've added the following line to the Library Directories:
C:\C++Libraries\glfw-3.0.bin.WIN32\lib-msvc110
I've linked the following libraries:
opengl32.lib, glfw3.lib, glfw3dll.lib
From the latest tutorial, I paste into my project (no visible syntax errors) to test, but I get four LNK2019 errors after trying to run it.
Here are the errors:
Error 2 error LNK2019: unresolved external symbol __imp__joyGetPosEx#8
referenced in function __glfwPlatformGetJoystickAxes
c:\Users\Spicy Weenie\documents\visual studio 2012\
Projects\Beta\Beta\glfw3.lib(win32_joystick.obj)
Error 3 error LNK2019: unresolved external symbol __imp__joyGetDevCapsW#12
referenced in function __glfwPlatformGetJoystickAxes
c:\Users\Spicy Weenie\documents\visual studio
2012\Projects\Beta\Beta\glfw3.lib(win32_joystick.obj)
Error 4 error LNK2019: unresolved external symbol __imp__joyGetPos#8
referenced in function __glfwPlatformJoystickPresent
c:\Users\Spicy Weenie\documents\visual studio
2012\Projects\Beta\Beta\glfw3.lib(win32_joystick.obj)
Error 1 error LNK2019: unresolved external symbol __imp__timeGetTime#0
referenced in function __glfwInitTimer c:\Users\Spicy Weenie\documents\visual
studio 2012\Projects\Beta\Beta\glfw3.lib(win32_time.obj)
You need to link in at least winmm.lib for timeGetTime. The joystick code is probably in there to.