From: Matvii Jarosh <matviijarosh@gmail.com>
To: guile-user@gnu.org
Subject: OBJ C dynamic library not work
Date: Sat, 2 Nov 2024 20:42:41 +0200 [thread overview]
Message-ID: <67ca922c-951d-4063-87c0-16050f6ba5e0@gmail.com> (raw)
today i test obj c dynamic library with file:
GNUmakefile:
GNUSTEP_MAKEFILES=/usr/share/GNUstep/Makefiles
SRCDIR = ./lib
include $(GNUSTEP_MAKEFILES)/common.make
LIBRARY_NAME = libgstep_guile
libgstep_guile_OBJC_FILES = $(SRCDIR)/test.m
libgstep_guile_HEADER_FILES =
libgstep_guile_CPPFLAGS = $(shell pkg-config --cflags guile-3.0) -fPIC
libgstep_guile_OBJC_FLAGS = $(shell pkg-config --cflags guile-3.0) -fPIC
libgstep_guile_LINKFLAGS = $(shell gnustep-config --base-libs)
-lgnustep-base
-include GNUmakefile.preamble
include $(GNUSTEP_MAKEFILES)/library.make
-include GNUmakefile.postamble
lib/test.m:
#include <stdio.h>
#include <Foundation/Foundation.h>
#include <libguile.h>
SCM
gsg_nslog_wrapper (SCM message)
{
NSString *nsMessage = [NSString
stringWithUTF8String:scm_to_utf8_string(message)];
NSLog(@"%@", nsMessage);
return SCM_UNSPECIFIED;
}
void
init_gsg ()
{
scm_c_define_gsubr ("gsg-nslog", 1, 0, 0, gsg_nslog_wrapper);
}
test.scm:
(load-extension "./obj/libgstep_guile.so" "init_gsg")
(gsg-nslog "test")
but i got an error:
Backtrace:
In ice-9/boot-9.scm:
1755:12 9 (with-exception-handler _ _ #:unwind? _ # _)
In unknown file:
8 (apply-smob/0 #<thunk 7e0d6b70f300>)
In ice-9/boot-9.scm:
724:2 7 (call-with-prompt _ _ #<procedure default-prompt-handle…>)
In ice-9/eval.scm:
619:8 6 (_ #(#(#<directory (guile-user) 7e0d6b712c80>)))
In ice-9/boot-9.scm:
2858:4 5 (save-module-excursion _)
4408:12 4 (_)
In /home/matvii/Desktop/libgstep_guile/test.scm:
1:0 3 (_)
In unknown file:
2 (load-extension "./obj/libgstep_guile.so" "init_gsg")
In system/foreign-library.scm:
190:25 1 (load-foreign-library _ #:extensions _ # _ #:search-path …)
In unknown file:
0 (dlopen "./obj/libgstep_guile.so" 1)
In procedure dlopen:
In procedure dlopen: file "./obj/libgstep_guile.so", message
"./obj/libgstep_guile.so: undefined symbol:
__objc_class_name_NSConstantString"
reply other threads:[~2024-11-02 18:42 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/guile/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=67ca922c-951d-4063-87c0-16050f6ba5e0@gmail.com \
--to=matviijarosh@gmail.com \
--cc=guile-user@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).