* OBJ C dynamic library not work
@ 2024-11-02 18:42 Matvii Jarosh
0 siblings, 0 replies; only message in thread
From: Matvii Jarosh @ 2024-11-02 18:42 UTC (permalink / raw)
To: guile-user
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"
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2024-11-02 18:42 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-11-02 18:42 OBJ C dynamic library not work Matvii Jarosh
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).