<!DOCTYPE html><html><head><title></title><style type="text/css">p.MsoNormal,p.MsoNoSpacing{margin:0}</style></head><body><div>This is something I experienced a couple weeks ago. The solution is to link your final executable against the 'contrib' libraries that ECL has compiled.<br></div><div><br></div><div>You need to add something like this to your compiler step: <code><span class="o"><span class="font" style="font-family:menlo, consolas, monospace, sans-serif;">-</span></span><span class="nv"><span class="font" style="font-family:menlo, consolas, monospace, sans-serif;">L/path/to/ecl</span></span><span class="font" style="font-family:menlo, consolas, monospace, sans-serif;"> </span><span class="o"><span class="font" style="font-family:menlo, consolas, monospace, sans-serif;">-</span></span><span class="ss"><span class="font" style="font-family:menlo, consolas, monospace, sans-serif;">lasdf</span></span></code><br></div><div><br></div><div>This email from last month's mailing list archives has more details/links to (Qt) examples: <a href="https://mailman.common-lisp.net/pipermail/ecl-devel/2020-November/011527.html">https://mailman.common-lisp.net/pipermail/ecl-devel/2020-November/011527.html</a><br></div><div><br></div><div>-Ava<br></div><div><br></div><div>On Wed, Dec 16, 2020, at 17:01, Иван Трусков wrote:<br></div><blockquote type="cite" id="qt" style=""><div>As far as i can tell, my central registry isn't set up. After starting<br></div><div>ECL and loading ASDF, when I check asdf:*central-registry*, it is<br></div><div>empty.<br></div><div><br></div><div>It must be noted, however, that to get to :str package that I want to<br></div><div>use, I must load :ecl-quicklisp, which adds path ~/quicklisp/quicklisp<br></div><div>to the central registry. In any way, it doesn't seem that there is<br></div><div>code of uiop in there.<br></div><div><br></div><div>I have tried compiling with listing "asdf", "uiop" as dependencies to<br></div><div>no success. The problem still persists.<br></div><div><br></div><div><br></div><div>> Do you have the source code of uiop available in the central registry? Quicklisp won't<br></div><div>> download it, because asdf considers it being preloaded. Also, if so, do you have uiop<br></div><div>> listed as a dependency?<br></div><div><br></div><div>> Alternatively you may add asdf as a dependency to your system.<br></div><div><br></div><div>>Regards,<br></div><div>>Daniel<br></div><div>><br></div><div>>--<br></div><div>>Daniel Kochmański ;; aka jackdaniel | Przemyśl, Poland<br></div><div>>TurtleWare - Daniel Kochmański | <a href="http://www.turtleware.eu">www.turtleware.eu</a><br></div><div>><br></div><div>>"Be the change that you wish to see in the world." - Mahatma Gandhi<br></div><div>><br></div><div>>‐‐‐‐‐‐‐ Original Message ‐‐‐‐‐‐‐<br></div><div>>On Tuesday, 1 December 2020 22:01, Иван Трусков <trus19 at gmail.com> wrote:<br></div><div>><br></div><div>>> Thank you very much. After rebuilding with newer version of ecl and with :init-name supplied compilation was a success.<br></div><div>>><br></div><div>>> However, when i try to run the resulting executable, i get this error:<br></div><div>>><br></div><div>>> Condition of type: SIMPLE-ERROR<br></div><div>>> Package ((UIOP/STREAM . #<UIOP/STREAM package>)) referenced in compiled file<br></div><div>>> NIL<br></div><div>>> but has not been created<br></div><div>>><br></div><div>>> Available restarts:<br></div><div>>><br></div><div>>> 1. (IGNORE) Ignore the error, and try the operation again<br></div><div>>><br></div><div>>> What should be done in this situation and how can i avoid it? Searching internet with this message did not yield any meaningful results (except for one Stackoverflow post that tells about having the same mistake).<br></div><div>>><br></div><div>>> вт, 1 дек. 2020 г. в 22:15, Marius Gerbershagen <marius.gerbershagen at gmail.com>:<br></div><div>>><br></div><div>>>> The generated library does indeed contain all systems that your library<br></div><div>>>> contains on. The undefined references are init functions, which need to<br></div><div>>>> be called via ecl_init_module after cl_boot to initialize the compiled<br></div><div>>>> libraries (see<br></div><div>>>> <a href="https://common-lisp.net/project/ecl/static/manual/System-building.html#Build-it-as-shared-library-and-use-in-C">https://common-lisp.net/project/ecl/static/manual/System-building.html#Build-it-as-shared-library-and-use-in-C</a><br></div><div>>>> for more details).<br></div><div>>>><br></div><div>>>> Since you didn't specify an explicit init name yourself, init functions<br></div><div>>>> are automatically generated for each system contained in the final<br></div><div>>>> library. When compiling a monolithic library, it is preferable to<br></div><div>>>> specify an explicit init name yourself, for example as<br></div><div>>>><br></div><div>>>> (asdf:make-build :embedded-console :type :static-library :move-here<br></div><div>>>> #P"/my/output/dir" :monolithic t :init-name "init_lib_embedded_console")<br></div><div>>>><br></div><div>>>> and then invoke it using<br></div><div>>>><br></div><div>>>> extern void init_lib_embedded_console(cl_object);<br></div><div>>>> /* ... */<br></div><div>>>> cl_boot(argc, argv);<br></div><div>>>> ecl_init_module(NULL, init_lib_embedded_console);<br></div><div>>>><br></div><div>>>> Am 29.11.20 um 13:17 schrieb Иван Трусков:<br></div><div>>>>> Hello. I am trying to make a library that makes use of 'STR' package and<br></div><div>>>>> link it into my C program.<br></div><div>>>>> I presumed that using :monolithic t flag would result in the static<br></div><div>>>>> library that contained all systems my library depends on. However it<br></div><div>>>>> seems that is not the case.<br></div><div>>>>><br></div><div>>>>> Here is my .asd file:<br></div><div>>>>><br></div><div>>>>> (defsystem "embedded-console"<br></div><div>>>>> :description "embedded console - ECL functions for smart snake game"<br></div><div>>>>> :author "Ivan Truskov <trus19 at gmail.com <mailto:trus19 at gmail.com>>"<br></div><div>>>>> :components ((:file "embedded-console"))<br></div><div>>>>> :depends-on ("str"))<br></div><div>>>>><br></div><div>>>>> I am compiling the library with command:<br></div><div>>>>><br></div><div>>>>> ecl -norc -eval '(require :ecl-quicklisp)'<br></div><div>>>>> -eval '(push \"/my/src/dir/\" asdf:*central-registry*)'<br></div><div>>>>> -eval '(asdf:make-build :embedded-console :type<br></div><div>>>>> :static-library :move-here \#P\"/my/output/dir}\" :monolithic t )'<br></div><div>>>>> -eval '(quit)'<br></div><div>>>>><br></div><div>>>>> However, when i try to link with resulting library, this is what i get:<br></div><div>>>>><br></div><div>>>>> ... undefined reference to `init_lib_CL_PPCRE'<br></div><div>>>>> ... undefined reference to `init_lib_BASE'<br></div><div>>>>> ... undefined reference to `init_lib_CL_UNICODE'<br></div><div>>>>> ... undefined reference to `init_lib_CL_PPCRE_UNICODE'<br></div><div>>>>> ... undefined reference to `init_lib_CL_CHANGE_CASE'<br></div><div>>>>> ... undefined reference to `init_lib_STR'<br></div><div>>>>> ... undefined reference to `init_lib_EMBEDDED_CONSOLE'<br></div><div>>>>><br></div><div>>>>> And indeed, when i run nm over the built file<br></div><div>>>>> embedded-console--all-systems.a, this is output:<br></div><div>>>>><br></div><div>>>>> eclinitVtJU9J.o:<br></div><div>>>>> 0000000000000000 b Cblock.10857<br></div><div>>>>> U cl_boot<br></div><div>>>>> U cl_symbols<br></div><div>>>>> U _ecl_frs_push<br></div><div>>>>> U ecl_init_module<br></div><div>>>>> U ecl_make_codeblock<br></div><div>>>>> U ecl_process_env<br></div><div>>>>> U _GLOBAL_OFFSET_TABLE_<br></div><div>>>>> U init_lib_BASE<br></div><div>>>>> U init_lib_CL_CHANGE_CASE<br></div><div>>>>> U init_lib_CL_PPCRE<br></div><div>>>>> U init_lib_CL_PPCRE_UNICODE<br></div><div>>>>> U init_lib_CL_UNICODE<br></div><div>>>>> U init_lib_EMBEDDED_CONSOLE<br></div><div>>>>> 0000000000000000 T init_lib_EMBEDDED_CONSOLE__ALL_SYSTEMS<br></div><div>>>>> U init_lib_STR<br></div><div>>>>> 0000000000000110 T main_lib_EMBEDDED_CONSOLE__ALL_SYSTEMS<br></div><div>>>>> U _setjmp<br></div><div>>>>> nm: cl-ppcre.a: File format not recognized<br></div><div>>>>> nm: base.a: File format not recognized<br></div><div>>>>> nm: cl-unicode.a: File format not recognized<br></div><div>>>>> nm: cl-ppcre-unicode.a: File format not recognized<br></div><div>>>>> nm: cl-change-case.a: File format not recognized<br></div><div>>>>> nm: str.a: File format not recognized<br></div><div>>>>> nm: embedded-console.a: File format not recognized<br></div><div>>>>><br></div><div>>>>> What am i doing wrong? What should i change to get static library<br></div><div>>>>> containing all systems i am intending to use (and maybe only them, if<br></div><div>>>>> possible)?<br></div><div><br></div><div><br></div></blockquote><div><br></div></body></html>