TIP: Click on subject to list as thread! ANSI
echo: fidosoft.husky
to: MICHAEL DUKELSKY
from: WILFRED VAN VELZEN
date: 2020-12-05 21:52:00
subject: Re: Compiling htick

Hi Michael,

On 2020-12-05 21:47:38, you wrote to me:

 WV>> FYI: I had to make 1 change to the CMakeLists.txt file for huskylib
 WV>> to
 WV>> be able to compile htick on my new system:

 WV>> ======================================================================
 WV>> ===== diff --git a/CMakeLists.txt b/CMakeLists.txt index
 WV>> df5c00e..b0fbe1e 100644 -+- a/CMakeLists.txt
 WV>> +++ b/CMakeLists.txt
 WV>> @@ -36,6 +36,7 @@ if (MSVC)
 WV>>    ADD_DEFINITIONS(-DWIN32 -D_WINDOWS -D_CONSOLE
 WV>> -D_CRT_SECURE_NO_WARNINGS) else ()
 WV>>    ADD_DEFINITIONS(-Wall -DUNIX)
 WV>> +  ADD_DEFINITIONS(-fPIC)
 WV>>  endif (MSVC)

 WV>>  message("-------------------------")
 WV>> ======================================================================
 WV>> =====

 WV>> Otherwise I get linker errors when compiling smapi (and probably the
 WV>> other modules too):

 WV>> ======================================================================
 WV>> =====
 WV>> ...
 WV>> [ 87%] Building C object CMakeFiles/smapi.dir/src/sq_write.c.o
 WV>> [ 93%] Building C object CMakeFiles/smapi.dir/src/structrw.c.o
 WV>> [100%] Linking C shared library libsmapi.so
 MD>                                      ^^^^^^^^^^^
 WV>> /usr/lib64/gcc/x86_64-suse-linux/7/../../../../x86_64-suse-linux/bin/l
 WV>> d: /usr/local/lib64/libhusky.a(cvtdate.c.o): relocation R_X86_64_32S
 MD>                          ^^^^^^^^^^
 MD> I forwarded your message to Alexander Skovpen who wrote CMakeLists.txt for
 MD> htick. He answered that you tried to link shared (i.e. dynamic) library
 MD> libsmapi.so to the static library libhusky.a. This was incorrect. Either
 MD> you build everything statically or you build everything dynamically.

Well then maybe the INSTALL.md for huskylib should be changed. It now states:

$ cmake -H. -Bbuild -DBUILD_SHARED_LIBS=OFF

See: https://github.com/huskyproject/huskylib/blob/master/INSTALL.md

The INSTALL.ms for the other modules don't include the
"-DBUILD_SHARED_LIBS=OFF"


Bye, Wilfred.

--- FMail-lnx64 2.1.0.18-B20170815
* Origin: FMail development HQ (2:280/464)

SOURCE: echomail via QWK@docsplace.org

Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.