Mahe dll but not make lib

Discuss anything related to product development
Post Reply
Navadvipa Chandra d
Posts: 34
Joined: Sun Apr 19 2020 7:02 pm

Mahe dll but not make lib

Post by Navadvipa Chandra d »

Hello, All!

I'm trying to make a library NNPrabhupada and NNPrabhupadaDB.

A dynamic library is being built with the file name NNPrabhupada1.9.dll , but the static library with the file name NNPrabhupada1.9.lib is not being built.

In file D:\CopperSpice\Release\Build\.ninja_log :

5111008 5111912 7645523918890618 bin/NNPrabhupada1.9.dll d27bf83f2f4b6232
5111008 5111912 7645523918890618 lib/NNPrabhupada1.9.lib d27bf83f2f4b6232

303 437 7645523957280014 bin/NNPrabhupada1.9.dll d27bf83f2f4b6232
303 437 7645523957280014 lib/NNPrabhupada1.9.lib d27bf83f2f4b6232


In file D:\CopperSpice\Release\Build\build.ninja :

#############################################
# Link the shared library bin\NNPrabhupada1.9.dll

build bin\NNPrabhupada1.9.dll lib\NNPrabhupada1.9.lib: CXX_SHARED_LIBRARY_LINKER__NNPrabhupada_Release src\Prabhupada\CMakeFiles\NNPrabhupada.dir\core\QPrabhupada.cpp.obj | lib\CsNetwork1.9.lib lib\CsOpenGL1.9.lib lib\CsGui1.9.lib lib\CsCore1.9.lib || bin\CsCore1.9.dll bin\CsGui1.9.dll bin\CsNetwork1.9.dll bin\CsOpenGL1.9.dll
LANGUAGE_COMPILE_FLAGS = /DWIN32 /D_WINDOWS /GR /EHsc /O2 /Ob2 /DNDEBUG -MD
LINK_FLAGS = /machine:x64 /INCREMENTAL:NO /OPT:REF,NOICF
LINK_LIBRARIES = winmm.lib lib\CsNetwork1.9.lib lib\CsOpenGL1.9.lib lib\CsGui1.9.lib lib\CsCore1.9.lib opengl32.lib gdi32.lib kernel32.lib user32.lib kernel32.lib user32.lib gdi32.lib winspool.lib shell32.lib ole32.lib oleaut32.lib uuid.lib comdlg32.lib advapi32.lib
OBJECT_DIR = src\Prabhupada\CMakeFiles\NNPrabhupada.dir
POST_BUILD = cd .
PRE_LINK = cd .
RESTAT = 1
TARGET_COMPILE_PDB = src\Prabhupada\CMakeFiles\NNPrabhupada.dir\
TARGET_FILE = bin\NNPrabhupada1.9.dll
TARGET_IMPLIB = lib\NNPrabhupada1.9.lib
TARGET_PDB = bin\NNPrabhupada1.9.pdb
RSP_FILE = CMakeFiles\NNPrabhupada.rsp


In file D:\CopperSpice\Release\Build\src\Prabhupada\cmake_install.cmake :

if(CMAKE_INSTALL_COMPONENT STREQUAL "Unspecified" OR NOT CMAKE_INSTALL_COMPONENT)
file(INSTALL DESTINATION "${CMAKE_INSTALL_PREFIX}/lib" TYPE STATIC_LIBRARY OPTIONAL FILES "D:/CopperSpice/Release/Build/lib/NNPrabhupada1.9.lib")
endif()

if(CMAKE_INSTALL_COMPONENT STREQUAL "Unspecified" OR NOT CMAKE_INSTALL_COMPONENT)
file(INSTALL DESTINATION "${CMAKE_INSTALL_PREFIX}/bin" TYPE SHARED_LIBRARY FILES "D:/CopperSpice/Release/Build/bin/NNPrabhupada1.9.dll")
if(EXISTS "$ENV{DESTDIR}${CMAKE_INSTALL_PREFIX}/bin/NNPrabhupada1.9.dll" AND
NOT IS_SYMLINK "$ENV{DESTDIR}${CMAKE_INSTALL_PREFIX}/bin/NNPrabhupada1.9.dll")
if(CMAKE_INSTALL_DO_STRIP)
execute_process(COMMAND "CMAKE_STRIP-NOTFOUND" "$ENV{DESTDIR}${CMAKE_INSTALL_PREFIX}/bin/NNPrabhupada1.9.dll")
endif()
endif()
endif()

And in the catalog D:\CopperSpice\Release\Lib\lib \ there is no NNPrabhupada1.9.lib file
Why is this happening? I took the CsMultimedia library as a sample, corrected it to the names I needed, and got cmake files.
What did I do wrong?

Thanks!
Sincerely, Navadvipa Chandra das.
barbara
Posts: 492
Joined: Sat Apr 04 2015 2:32 am
Contact:

Re: Mahe dll but not make lib

Post by barbara »

>> (1) I'm trying to make a library NNPrabhupada and NNPrabhupadaDB.

Based on this information you actually want to build two libraries, not make something. For readability it would be better to use shorter and simplier names like NNP_A and NNP_B.


>> (2) I took the CsMultimedia library as a sample.

Why did you choose this CS library as your starting point? Not a bad choice but you should have a good reason.


>> (3) Why is this happening? What did I do wrong?

In order to actually help you should provide only the relevant information. Provide a short description of what you want, what you did, and what you expect.


a) What did you want to do is the very first thing to explain.

It appears you wanted to build two libraries. I am guessing but I believe we know this is your want.


b) Then you should tell us, exactly what you expected.

Like, I expected to build my personal project and have the files NNP_A.DLL and NNP_A.dll.a.


c) The last part is what result do you currently have.

I built my application and currently have file X and file Y is missing.

Since you know our CopperSpice CsMultimedia library builds correctly, the problem must be changes you made to our build system files.

Barbara
Navadvipa Chandra d
Posts: 34
Joined: Sun Apr 19 2020 7:02 pm

Re: Mahe dll but not make lib

Post by Navadvipa Chandra d »

Hello, Barbara and All!

a) I want to make two libraries because the first one is without databases and the second one requires a database. And there are users who won't want to use databases.
b) I've tried the CsSql library before as a starting point, or rather its cmake files, but I got the same problem. The dll was successfully created, but the static library was not created. That's why I chose another library, CsMultimedia. But the result is the same. There is no good reason to choose CsMultimedia as a model. But something has to be a pattern.

I want to make a program called Shrila Prabhupada's Dictionary. I decided to add things that might be useful in other programs to these two libraries. I plan to add more interesting things to them. Maybe I'll create a PR on Github. But for now, I just want to create libraries.

Here are the CopperSpice configuration directories:

CopperSpice configured to run on: Windows 64 bit, Release Mode
CopperSpice will be built in: D:/CopperSpice/Release/Build
CopperSpice will be installed in: D:/CopperSpice/Release/Lib

I want to create such files:

D:\CopperSpice\Release\Lib\bin\NNPrabhupada1.9.dll
D:\CopperSpice\Release\Lib\lib\NNPrabhupada1.9.lib
D:\CopperSpice\Release\Lib\bin\NNPrabhupadaDB1.9.dll
D:\CopperSpice\Release\Lib\lib\NNPrabhupadaDB1.9.lib

In practice, I can only get one file when enabling the build of only one library.:
set(CS_OPTIONAL_COMPONENTS Gui Multimedia Network OpenGL Sql Svg Vulkan WebKit XmlPatterns Prabhupada)

D:\CopperSpice\Release\Lib\bin\NNPrabhupada1.9.dll

When I enable the build of the second library also using the command:
set(CS_OPTIONAL_COMPONENTS Gui Multimedia Network OpenGL Sql Svg Vulkan WebKit XmlPatterns Prabhupada PrabhupadaDB)

then I get an error

Code: Select all

D:\CopperSpice\Bat>set BUILD_DIR=D:/CopperSpice 

D:\CopperSpice\Bat>cd D:/CopperSpice/Release/Build 

D:\CopperSpice\Release\Build>cmake -G "Ninja"   -DCMAKE_BUILD_TYPE=Release   -DCMAKE_INSTALL_PREFIX=D:/CopperSpice/Release/Lib   -DOPENSSL_ROOT_DIR=C:/Prg/OpenSSL/3.4.0   -DPostgreSQL_ROOT=C:\Prg\PostgreSQL\17   D:/CopperSpice/Source 
-- CsLibGuarded was not found, bundled library will be used

-- CsString was not found, bundled library will be used

-- CsSignal was not found, bundled library will be used

-- OpenSSL was found 
 * Version: 3.4.0
 * Path: C:/Prg/OpenSSL/3.4.0/lib/libcrypto.lib

-- ZLIB was not found, bundled library will be used

-- libjpeg was not found, bundled library will be used

-- PostgreSQL was found, CopperSpice plugin will be built

-- MySQL was not found, CopperSpice plugin will not be built

-- ODBC SQL Driver was found, CopperSpice plugin will be built

-- The following packages have been found:

 * OpenSSL (required version >= 1.0), Support for SSL and TLS, <https://openssl.org>
   Required for HTTPS support
 * Vulkan (required version >= 1.2.170), The Vulkan SDK, <https://www.lunarg.com/>
   Required for Vulkan support

-- Configuring done (1.4s)
-- Generating done (1.2s)
-- Build files have been written to: D:/CopperSpice/Release/Build

D:\CopperSpice\Release\Build>ninja
[1/3] Linking CXX shared library bin\NNPrabhupada1.9.dll
[2/3] Building CXX object src\PrabhupadaDB\CMakeFiles\NNPrabhupadaDB.dir\core\QPrabhupadaDB.cpp.obj
[3/3] Linking CXX shared library bin\NNPrabhupadaDB1.9.dll
FAILED: bin/NNPrabhupadaDB1.9.dll lib/NNPrabhupadaDB1.9.lib 
C:\Windows\system32\cmd.exe /C "cd . && C:\Prg\cmake-3.31.4-windows-x86_64\bin\cmake.exe -E vs_link_dll --msvc-ver=1943 --intdir=src\PrabhupadaDB\CMakeFiles\NNPrabhupadaDB.dir --rc=C:\PROGRA~2\WI3CF2~1\10\bin\100261~1.0\x64\rc.exe --mt=C:\PROGRA~2\WI3CF2~1\10\bin\100261~1.0\x64\mt.exe --manifests  -- C:\PROGRA~1\MICROS~3\2022\COMMUN~1\VC\Tools\MSVC\1443~1.348\bin\Hostx64\x64\link.exe /nologo @CMakeFiles\NNPrabhupadaDB.rsp  /out:bin\NNPrabhupadaDB1.9.dll /implib:lib\NNPrabhupadaDB1.9.lib /pdb:bin\NNPrabhupadaDB1.9.pdb /dll /version:0.0 /machine:x64 /INCREMENTAL:NO    /OPT:REF,NOICF && cd ."
LINK: command "C:\PROGRA~1\MICROS~3\2022\COMMUN~1\VC\Tools\MSVC\1443~1.348\bin\Hostx64\x64\link.exe /nologo @CMakeFiles\NNPrabhupadaDB.rsp /out:bin\NNPrabhupadaDB1.9.dll /implib:lib\NNPrabhupadaDB1.9.lib /pdb:bin\NNPrabhupadaDB1.9.pdb /dll /version:0.0 /machine:x64 /INCREMENTAL:NO /OPT:REF,NOICF /MANIFEST:EMBED,ID=2" failed (exit code 1181) with the following output:
LINK : fatal error LNK1181: не удается открыть входной файл "lib\NNPrabhupada1.9.lib"

ninja: build stopped: subcommand failed.

D:\CopperSpice\Release\Build>ninja install 
[1/3] Linking CXX shared library bin\NNPrabhupada1.9.dll
[2/3] Linking CXX shared library bin\NNPrabhupadaDB1.9.dll
FAILED: bin/NNPrabhupadaDB1.9.dll lib/NNPrabhupadaDB1.9.lib 
C:\Windows\system32\cmd.exe /C "cd . && C:\Prg\cmake-3.31.4-windows-x86_64\bin\cmake.exe -E vs_link_dll --msvc-ver=1943 --intdir=src\PrabhupadaDB\CMakeFiles\NNPrabhupadaDB.dir --rc=C:\PROGRA~2\WI3CF2~1\10\bin\100261~1.0\x64\rc.exe --mt=C:\PROGRA~2\WI3CF2~1\10\bin\100261~1.0\x64\mt.exe --manifests  -- C:\PROGRA~1\MICROS~3\2022\COMMUN~1\VC\Tools\MSVC\1443~1.348\bin\Hostx64\x64\link.exe /nologo @CMakeFiles\NNPrabhupadaDB.rsp  /out:bin\NNPrabhupadaDB1.9.dll /implib:lib\NNPrabhupadaDB1.9.lib /pdb:bin\NNPrabhupadaDB1.9.pdb /dll /version:0.0 /machine:x64 /INCREMENTAL:NO    /OPT:REF,NOICF && cd ."
LINK: command "C:\PROGRA~1\MICROS~3\2022\COMMUN~1\VC\Tools\MSVC\1443~1.348\bin\Hostx64\x64\link.exe /nologo @CMakeFiles\NNPrabhupadaDB.rsp /out:bin\NNPrabhupadaDB1.9.dll /implib:lib\NNPrabhupadaDB1.9.lib /pdb:bin\NNPrabhupadaDB1.9.pdb /dll /version:0.0 /machine:x64 /INCREMENTAL:NO /OPT:REF,NOICF /MANIFEST:EMBED,ID=2" failed (exit code 1181) with the following output:
LINK : fatal error LNK1181: не удается открыть входной файл "lib\NNPrabhupada1.9.lib"

ninja: build stopped: subcommand failed.
Sincerelly, Navadvipa Chandra das.
Navadvipa Chandra d
Posts: 34
Joined: Sun Apr 19 2020 7:02 pm

Re: Mahe dll but not make lib

Post by Navadvipa Chandra d »

Hello, Barbara and All!

I have converted to the CopperSpice 2.0 version. This time I took the Kssvg library as a sample, the result is the same.,
Although, as before, you can find the line "NNPrabhupada2.0.lib" in the file.

D:\CopperSpice\Release\Build\.ninja_log

But only the CsSvg2.0.lib file occurs only once, and the NNPrabhupada2.0.lib file occurs twice. Maybe his destruction is being recorded for the second time?

3068019 3070555 7652270278268275 bin/CsSvg2.0.dll 88f12371688ec042
3068019 3070555 7652270278268275 lib/CsSvg2.0.lib 88f12371688ec042

5108058 5108537 7652290661013801 bin/NNPrabhupada2.0.dll 685a78933e47740e
5108058 5108537 7652290661013801 lib/NNPrabhupada2.0.lib 685a78933e47740e

374 525 7652290697983971 bin/NNPrabhupada2.0.dll 685a78933e47740e
374 525 7652290697983971 lib/NNPrabhupada2.0.lib 685a78933e47740e


And the NNPrabhupada2.0.lib library itself cannot be found.

I hope for help! Thanks!
With respect, Navadvipa Chandra das.
barbara
Posts: 492
Joined: Sat Apr 04 2015 2:32 am
Contact:

Re: Mahe dll but not make lib

Post by barbara »

It seems like you might be trying to change CopperSpice and this is not a normal approach for adding personal features and functionality.

A much better alternative is to take all the functionality you want for your project and create a personal library. Simply link your library with CopperSpice and leave CS as it is. Then link your applications with your personal library and CopperSpice. This will work perfectly. If you want to publish your personal library for others to use, this would be awesome and very generous.

If you want to change CopperSpice you will need to learn CMake and then review all of our build files. There are approximately 150 CMake files in CopperSpice.

Debugging build files for your project is beyond the scope of our free community support. We are happy to discuss paid consulting options at any time.

Barbara
Post Reply