[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
OBJ C dynamic library not work
From: |
Matvii Jarosh |
Subject: |
OBJ C dynamic library not work |
Date: |
Sat, 2 Nov 2024 20:42:41 +0200 |
User-agent: |
Mozilla Thunderbird |
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"
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- OBJ C dynamic library not work,
Matvii Jarosh <=