Hey @Jeffrey Liu
Hey @Thusal Ranawaka, how's it going?
Sorry, I didn't get your first tag for some reason.
Working on LibreCAD.
The final 3 days.
Cool, have you compiled it successfully?
No. I can't understand it shows errors.
The final 3 days.
Yeah, honestly the past 1 1/2 months have just flown by...
I finally make a soltuion for the error and click on compile another error shows up.
What's the error? I haven't compiled it myself but I might be able to help out.
Be careful not to make too many drastic changes though, if your fixes are what is causing new errors, you might be straying a little too far.
It shows a lot of errors showing these kind Severity Code Description Project File Line Source Suppression State
Error LNK2001 unresolved external symbol lua_gettop C:\Users\Asus\LibreCAD_3\out\build\x64-Debug\LibreCAD_3 C:\Users\Asus\LibreCAD_3\out\build\x64-Debug\lc_entity.cpp.obj 1 Build
pasted image Look
I think those generally mean that something isn't linking properly (lua related) - perhaps some Lua lib?
Sending the whole output build would help
The most important error is usually the first error in the list. The succeeding ones are often consequences of this first error.
For example, if there is an error in the compilation of the Lua library, everything which depends on this library can't be compiled too.
Have you read the build instructions? (There is a link in the task's description.) There is a list of required libraries. Do you installed/build them? Lua is one of them.
Make sure that you read the "Windows" section in the build instructions.
@Daniel Rossberg Yeah. I did I have been working on it for weeks with @Feragon . I enter the build instructions.
Hi @Jeffrey Liu Thank you for helping me out and waste your a lot of time for me. The output log is really long. So, I will send you the last outputs of it. [154/281] C:\PROGRA~2\MICROS~1\2019\COMMUN~1\VC\Tools\MSVC\1424~1.283\bin\HostX64\x64\cl.exe /nologo /TP -DBOOST_ALL_DYN_LINK -DKAGUYA_SUPPORT_MULTIPLE_SHARED_LIBRARY=1 -DUSE_PERSISTENCE=1 -Dlcviewernoqt_EXPORTS -I..\..\..\third_party\msvc_dirent -IC:\Users\Asus\Documents\glew-2.1.0-win32\glew-2.1.0\include -IC:\Users\Asus\Documents\glm-0.9.9.6\glm -IC:\Users\Asus\Documents\boost_1_71_0-msvc-14.2-64 -IC:\Users\Asus\Documents\ft2101\freetype-2.10.1\include -IC:\Users\Asus\Documents\eigen-3.3.7\eigen-3.3.7 -I..\..\..\lckernel -I..\..\..\third_party -I..\..\..\lcviewernoqt /DWIN32 /D_WINDOWS /W3 /GR /EHsc /MDd /Zi /Ob0 /Od /RTC1 /bigobj -std:c++14 /showIncludes /Folcviewernoqt\CMakeFiles\lcviewernoqt.dir\drawables\lccursor.cpp.obj /Fdlcviewernoqt\CMakeFiles\lcviewernoqt.dir\ /FS -c ..\..\..\lcviewernoqt\drawables\lccursor.cpp
[155/281] C:\PROGRA~2\MICROS~1\2019\COMMUN~1\VC\Tools\MSVC\1424~1.283\bin\HostX64\x64\cl.exe /nologo /TP -DBOOST_ALL_DYN_LINK -DKAGUYA_SUPPORT_MULTIPLE_SHARED_LIBRARY=1 -DUSE_PERSISTENCE=1 -Dlcviewernoqt_EXPORTS -I..\..\..\third_party\msvc_dirent -IC:\Users\Asus\Documents\glew-2.1.0-win32\glew-2.1.0\include -IC:\Users\Asus\Documents\glm-0.9.9.6\glm -IC:\Users\Asus\Documents\boost_1_71_0-msvc-14.2-64 -IC:\Users\Asus\Documents\ft2101\freetype-2.10.1\include -IC:\Users\Asus\Documents\eigen-3.3.7\eigen-3.3.7 -I..\..\..\lckernel -I..\..\..\third_party -I..\..\..\lcviewernoqt /DWIN32 /D_WINDOWS /W3 /GR /EHsc /MDd /Zi /Ob0 /Od /RTC1 /bigobj -std:c++14 /showIncludes /Folcviewernoqt\CMakeFiles\lcviewernoqt.dir\managers\dragmanager.cpp.obj /Fdlcviewernoqt\CMakeFiles\lcviewernoqt.dir\ /FS -c ..\..\..\lcviewernoqt\managers\dragmanager.cpp
[156/281] C:\PROGRA~2\MICROS~1\2019\COMMUN~1\VC\Tools\MSVC\1424~1.283\bin\HostX64\x64\cl.exe /nologo /TP -DBOOST_ALL_DYN_LINK -DKAGUYA_SUPPORT_MULTIPLE_SHARED_LIBRARY=1 -DUSE_PERSISTENCE=1 -Dlcviewernoqt_EXPORTS -I..\..\..\third_party\msvc_dirent -IC:\Users\Asus\Documents\glew-2.1.0-win32\glew-2.1.0\include -IC:\Users\Asus\Documents\glm-0.9.9.6\glm -IC:\Users\Asus\Documents\boost_1_71_0-msvc-14.2-64 -IC:\Users\Asus\Documents\ft2101\freetype-2.10.1\include -IC:\Users\Asus\Documents\eigen-3.3.7\eigen-3.3.7 -I..\..\..\lckernel -I..\..\..\third_party -I..\..\..\lcviewernoqt /DWIN32 /D_WINDOWS /W3 /GR /EHsc /MDd /Zi /Ob0 /Od /RTC1 /bigobj -std:c++14 /showIncludes /Folcviewernoqt\CMakeFiles\lcviewernoqt.dir\drawitems\lclwpolyline.cpp.obj /Fdlcviewernoqt\CMakeFiles\lcviewernoqt.dir\ /FS -c ..\..\..\lcviewernoqt\drawitems\lclwpolyline.cpp
[157/281] C:\PROGRA~2\MICROS~1\2019\COMMUN~1\VC\Tools\MSVC\1424~1.283\bin\HostX64\x64\cl.exe /nologo /TP -DBOOST_ALL_DYN_LINK -DKAGUYA_SUPPORT_MULTIPLE_SHARED_LIBRARY=1 -DUSE_PERSISTENCE=1 -Dlcviewernoqt_EXPORTS -I..\..\..\third_party\msvc_dirent -IC:\Users\Asus\Documents\glew-2.1.0-win32\glew-2.1.0\include -IC:\Users\Asus\Documents\glm-0.9.9.6\glm -IC:\Users\Asus\Documents\boost_1_71_0-msvc-14.2-64 -IC:\Users\Asus\Documents\ft2101\freetype-2.10.1\include -IC:\Users\Asus\Documents\eigen-3.3.7\eigen-3.3.7 -I..\..\..\lckernel -I..\..\..\third_party -I..\..\..\lcviewernoqt /DWIN32 /D_WINDOWS /W3 /GR /EHsc /MDd /Zi /Ob0 /Od /RTC1 /bigobj -std:c++14 /showIncludes /Folcviewernoqt\CMakeFiles\lcviewernoqt.dir\documentcanvas.cpp.obj /Fdlcviewernoqt\CMakeFiles\lcviewernoqt.dir\ /FS -c ..\..\..\lcviewernoqt\documentcanvas.cpp
C:\Users\Asus\LibreCAD_3\lcviewernoqt\documentcanvas.cpp(374): warning C4267: 'argument': conversion from 'size_t' to 'const int', possible loss of data
C:\Users\Asus\LibreCAD_3\lcviewernoqt\documentcanvas.cpp(466): warning C4267: 'argument': conversion from 'size_t' to 'const int', possible loss of data
[158/281] C:\PROGRA~2\MICROS~1\2019\COMMUN~1\VC\Tools\MSVC\1424~1.283\bin\HostX64\x64\cl.exe /nologo /TP -DBOOST_ALL_DYN_LINK -DKAGUYA_SUPPORT_MULTIPLE_SHARED_LIBRARY=1 -DUSE_PERSISTENCE=1 -Dlcviewernoqt_EXPORTS -I..\..\..\third_party\msvc_dirent -IC:\Users\Asus\Documents\glew-2.1.0-win32\glew-2.1.0\include -IC:\Users\Asus\Documents\glm-0.9.9.6\glm -IC:\Users\Asus\Documents\boost_1_71_0-msvc-14.2-64 -IC:\Users\Asus\Documents\ft2101\freetype-2.10.1\include -IC:\Users\Asus\Documents\eigen-3.3.7\eigen-3.3.7 -I..\..\..\lckernel -I..\..\..\third_party -I..\..\..\lcviewernoqt /DWIN32 /D_WINDOWS /W3 /GR /EHsc /MDd /Zi /Ob0 /Od /RTC1 /bigobj -std:c++14 /showIncludes /Folcviewernoqt\CMakeFiles\lcviewernoqt.dir\managers\snapmanagerimpl.cpp.obj /Fdlcviewernoqt\CMakeFiles\lcviewernoqt.dir\ /FS -c ..\..\..\lcviewernoqt\managers\snapmanagerimpl.cpp
ninja: build stopped: subcommand failed.
Build All failed.
In your screen shot there are errors regarding an unresolved external "lua_rawseti". This indicates that the Lua library is missing.
So
No, I enter the libraries correctly.
The first errors are the important ones.
And, you can upload files here.
The lua libraries???
No, I enter the libraries correctly.
Visual Studio says no, and this is the instance you have to satisfy ;)
The lua libraries???
No, the Visual Studio build log.
But the build log is half a mile long.
Copy it to a file and attach this file here to your post.
@Daniel Rossberg Here, Build-All-started.docx
However, maybe we should start with the CMake configuration. For example, with CMakeOutput.log (in the CMakeFiles directory of your build directory (where the Visual Studio solution (.sln) file is)).
CMakeOutput.log Here is it. @Daniel Rossberg
Daniel Rossberg Here, Build-All-started.docx
Okay, the first error is a Lua ink error:
C:\Users\Asus\LibreCAD_3\out\build\x64-Debug\pluginmanager.cpp.obj : error LNK2019: unresolved external symbol lua_close referenced in function "public: __cdecl kaguya::State::~State(void)" (??1State@kaguya@@QEAA@XZ)
This can mean that it couldn't find the Lua library or the library version is to old. lua_close
was formerly luaL_close
.
But as far as I know version 5.3.5 id the latest version of lua.
CMakeOutput.log Here is it. Daniel Rossberg
Okay ...
CMakeCache.txt in your build directory?
CMakeCache.txt Here is it but it doesn't located on the build directory of the repo file but it present when I open the repo folder.
Daniel Rossberg Here, Build-All-started.docx
Okay, the first error is a Lua ink error:
C:\Users\Asus\LibreCAD_3\out\build\x64-Debug\pluginmanager.cpp.obj : error LNK2019: unresolved external symbol lua_close referenced in function "public: __cdecl kaguya::State::~State(void)" (??1State@kaguya@@QEAA@XZ)
This can mean that it couldn't find the Lua library or the library version is to old. `lua_close` was formerly `luaL_close`.
But the lua library is present when the lua folder is open. @Daniel Rossberg
According to the logs, your Lua installation should be at C:/Users/Asus/Documents/lua-5.3.5_Win64_dll14_lib
. Where are the files ending on ".lib" there?
Yes. The library present on that path.
Exactly there or in a subdirectory? How is the library called?
lua53.lib This library is present at the exact location
Okay...
Among the Visual Studio projects there is a "lcadluascript". Building this should produce he link errors.
So what should I do?
Okay, try the following:
Do again the CMake configuration. Give there the LUA_LIBRARY
variable the value C:/Users/Asus/Documents/lua-5.3.5_Win64_dll14_lib/lua53.lib
. Then, hit Configure and Generate, and then try again to build LibreCAD 3.
That reduce 510 errors to 45 errors. That means the lua case is solved but the glew case. Severity Code Description Project File Line Source Suppression State
Error LNK2001 unresolved external symbol __imp___glewBindBuffer C:\Users\Asus\LibreCAD_3\out\build\x64-Debug\LibreCAD_3 C:\Users\Asus\LibreCAD_3\out\build\x64-Debug\vertexbuffer.cpp.obj 1 Build @Daniel Rossberg
There are some NOTFOUND entries regarding GLEW in CMake.
You can try the following: Open the CMake GUI. Filter for GLEW there (type "GLEW" in the Search field). Look for bad (NOTFOUND) entries there. Start with GLEW_DIR
. Set them appropriate and hit Configure after each change (changing one entry can result in chaging others too).
BTW, the right directory for GLEW_DIR is probable C:/Users/Asus/Documents/glew-2.1.0-win32/glew-2.1.0.
It's not Configuring because the CMakeLists.txt is not appearing in that folder. @Daniel Rossberg pasted image
No, I'm talking about the LibreCAD CMake configuration.
The one you already worked with.
I'm working on MSVC 2019
@Daniel Rossberg When I enter the LibreCAD_3 folder in CMake it shows CMakeLists.txt does not appear.
Then, how did you set LUA_LIBRARY to C:/Users/Asus/Documents/lua-5.3.5_Win64_dll14_lib/lua53.lib? I'm talking about the same CMake configuration.
I do it in Microsoft Visual Studio 2019 not in CMake.
I downloaded the CMake and C++ workload for Visual Studio.
Maybe you can set GLEW_DIR in Visual Studio too, if it has CMake integrated. I don't have Visual Studio here.
In the CMake GUI you had to set the build directory only. It should find the rest automatically.
Yeah. But the some of the functions does not work on it.
There are some NOTFOUND entries regarding GLEW in CMake.
You can try the following: Open the CMake GUI. Filter for GLEW there (type "GLEW" in the Search field). Look for bad (NOTFOUND) entries there. Start withGLEW_DIR
. Set them appropriate and hit Configure after each change (changing one entry can result in chaging others too).BTW, the right directory for GLEW_DIR is probable C:/Users/Asus/Documents/glew-2.1.0-win32/glew-2.1.0.
When I enter GLEW_DIR so should I have to remove the GLEW_INCLUDE_DIR @Daniel Rossberg
Maybe, it should generate it again with the information from GLEW_DIR. But, GLEW_INCLUDE_DIR looks good. It should be save to keep it.
I generate the Cache with both environment variables but the errors are the same. @Daniel Rossberg
Did you checked all of the GLEW variables? E.g. GLEW_ROOT too?
And GLEW_SHARED_LIBRARY_DEBUG and GLEW_STATIC_LIBRARY_DEBUG?
And GLEW_SHARED_LIBRARY_DEBUG and GLEW_STATIC_LIBRARY_DEBUG?
I never entered those. They don't need to enter and GLEW_ROOT variable is defined as a windows environment variable not Cmake.
Looking at the files provided by you, it looks like GLEW is at C:/Users/Asus/Documents/glew-2.1.0-win32/glew-2.1.0, but the Windows envoronment variable points to C:\Users\Asus\Documents\glew.
I would think that GLEW_SHARED_LIBRARY_DEBUG and GLEW_STATIC_LIBRARY_DEBUG will be used for the debug build.
How does it build if you switch to release in Visual Studio?
First you have to generate the Cache and build the files
?
In Visual Studio, at the top, in the middle, you have "x64-Debug". You should be able to switch to Release there.
I tried but there are 45 errors Severity Code Description Project File Line Source Suppression State
Error LNK2019 unresolved external symbol __imp___glewBindBuffer referenced in function "public: void __cdecl lc::viewer::opengl::VertexBuffer::bind(void)const " (?bind@VertexBuffer@opengl@viewer@lc@@QEBAXXZ) C:\Users\Asus\LibreCAD_3\out\build\x64-Release\LibreCAD_3 C:\Users\Asus\LibreCAD_3\out\build\x64-Release\vertexbuffer.cpp.obj 1 Build @Daniel Rossberg
This means that there are the GLEW errors too.
The problem is why is it happens.
Where you able to open the CMake GUI with the LibreCAD project? I.e., setting the build directory to C:\Users\Asus\LibreCAD_3\out\build in this GUI. The other values should be set automatically then.
(I hope this is the root of your build directory.)
But it doesn't configure because there are no CMakeLists.txt files in it.
That's right. CMakeLists.txt is in the source directory. But, if you write a valid build directory in the second(!) line of CMake, the first line with the sorce directory should be automatically set.
Therefore, not "Where is the source code" but "Where to build the binaries".
So what should I do?
Put C:\Users\Asus\LibreCAD_3\out\build (or whatever is the directory with the CMakeCache.txt) into the "Where to build the binaries" field of the CMake GUI.
But it show this error pasted image
This looks unusual. Did Visual Studio generated two distinct configurations for Debug and Release?
No. only release
I don't think so, because there is the C:\Users\Asus\LibreCAD_3\out\build\x64-Debug directory with the debug configuration too.
Should I remove it?
I personally would try to get a clean CMake configuration:
Should I remove it?
No.
And, if you set GLEW_DIR and hit Configure, it will reset to NOTFOUND?
@Daniel Rossberg Yes. It happens as you said.
Here, pasted image
According to this image, CMake is missing GLW_INCLUDE_DIRS
. You can set it by hitting the Add Entry Button. It has to be a path.
Last updated: Jan 09 2025 at 00:46 UTC