Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

could not load libgtk-3.0.dylib #162

Open
whitebm2024 opened this issue Jan 12, 2023 · 3 comments
Open

could not load libgtk-3.0.dylib #162

whitebm2024 opened this issue Jan 12, 2023 · 3 comments

Comments

@whitebm2024
Copy link

On a m2 mac air it compiles fine but this is the error it gives when ran

dlopen(libgtk-3.0.dylib, 0x0002): tried: 'libgtk-3.0.dylib' (no such file), '/System/Volumes/Preboot/Cryptexes/OSlibgtk-3.0.dylib' (no such file), '/usr/lib/libgtk-3.0.dylib' (no such file, not in dyld cache), 'libgtk-3.0.dylib' (no such file), '/usr/local/lib/libgtk-3.0.dylib' (no such file), '/usr/lib/libgtk-3.0.dylib' (no such file, not in dyld cache) could not load: libgtk-3.0.dylib

I've tried a bunch of things including brew install gtk+3 and putting it in an app bundle and other things mentioned in #63 but it still does not work. A similar thing also happens with nimx so I'm not sure what the problem is.

@simonkrauter
Copy link
Owner

I have no knowledge about macOS, but maybe you could search for the files on your system and compare the file names. Maybe it's a higher Gtk version or another reason for a different file name.

@whitebm2024
Copy link
Author

I realized when running the file command on the dylib and on NiCalc executable that their architectures were arm64 and x86_64 respectively and I'm pretty sure that's no good so I tried to compile with the --cpu:arm option and it gives me this nice error which seems to be saying the nim and c compiler disagree on the size of a pointer. I have no idea how to fix something like this.

In file included from /Users/brandonwhite/.cache/nim/NiCalc_d/@m..@s..@s..@s..@s.choosenim@stoolchains@snim-1.6.10@slib@spure@salgorithm.nim.cIn file included from :8:
/Users/brandonwhite/.choosenim/toolchains/nim-1.6.10/lib/nimbase.h/Users/brandonwhite/.cache/nim/NiCalc_d/@m..@s..@s..@s..@s.choosenim@stoolchains@snim-1.6.10@slib@ssystem@sassertions.nim.c:In file included from 8/Users/brandonwhite/.cache/nim/NiCalc_d/@m..@s..@s..@s..@s.choosenim@stoolchains@snim-1.6.10@slib@sstd@sprivate@sdigitsutils.nim.c:
:8:
In file included from /Users/brandonwhite/.cache/nim/NiCalc_d/@m..@s..@s..@s..@s.choosenim@stoolchains@snim-1.6.10@slib@ssystem@sdollars.nim.c:8:
/Users/brandonwhite/.choosenim/toolchains/nim-1.6.10/lib/nimbase.h:550:1:/Users/brandonwhite/.choosenim/toolchains/nim-1.6.10/lib/nimbase.h: 550In file included from /Users/brandonwhite/.cache/nim/NiCalc_d/@m..@s..@s..@s..@s.choosenim@stoolchains@snim-1.6.10@slib@ssystem@sio.nim.c::8:1: 550In file included from error: In file included from error: static_assert failed due to requirement 'sizeof(int) == sizeof(void *) && 32 == sizeof(int) * 8' "":
/Users/brandonwhite/.cache/nim/NiCalc_d/@m..@s..@s..@s..@s.choosenim@stoolchains@snim-1.6.10@slib@spure@smath.nim.c::8:
/Users/brandonwhite/.cache/nim/NiCalc_d/@m..@s..@s..@s..@s.choosenim@stoolchains@snim-1.6.10@slib@spure@sparseutils.n1: error: static_assert failed due to requirement 'sizeof(int) == sizeof(void *) && 32 == sizeof(int) * 8' ""
im.c:8:
static_assert failed due to requirement 'sizeof(int) == sizeof(void *) && 32 == sizeof(int) * 8' ""
/Users/brandonwhite/.choosenim/toolchains/nim-1.6.10/lib/nimbase.h
In file included from /Users/brandonwhite/.choosenim/toolchains/nim-1.6.10/lib/nimbase.h:/Users/brandonwhite/.cache/nim/NiCalc_d/@m..@s..@s..@s..@s.choosenim@stoolchains@snim-1.6.10@slib@ssystem.nim.c:550:/Users/brandonwhite/.choosenim/toolchains/nim-1.6.10/lib/nimbase.h550:8:550:
:1: /Users/brandonwhite/.choosenim/toolchains/nim-1.6.10/lib/nimbase.herror: static_assert failed due to requirement 'sizeof(int) == sizeof(void *) && 32 == sizeof(int) * 8' "":1:1 :/Users/brandonwhite/.choosenim/toolchains/nim-1.6.10/lib/nimbase.h :550:550error: ::1
error: 1static_assert failed due to requirement 'sizeof(int) == sizeof(void *) && 32 == sizeof(int) * 8' ""::  error: static_assert failed due to requirement 'sizeof(int) == sizeof(void *) && 32 == sizeof(int) * 8' ""error: 
static_assert failed due to requirement 'sizeof(int) == sizeof(void *) && 32 == sizeof(int) * 8' ""

static_assert failed due to requirement 'sizeof(int) == sizeof(void *) && 32 == sizeof(int) * 8' ""
NIM_STATIC_ASSERT(sizeof(NI) == sizeof(void*) && NIM_INTBITS == sizeof(NI)*8, "");
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Users/brandonwhite/.choosenim/toolchains/nim-1.6.10/lib/nimbase.h:276:35: note: expanded from macro 'NIM_STATIC_ASSERT'
#define NIM_STATIC_ASSERT(x, msg) _Static_assert((x), msg)
                                  ^               ~
NIM_STATIC_ASSERT(sizeof(NI) == sizeof(void*) && NIM_INTBITS == sizeof(NI)*8, "");
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Users/brandonwhite/.choosenim/toolchains/nim-1.6.10/lib/nimbase.h:276:35: note: NIM_STATIC_ASSERT(sizeof(NI) == sizeof(void*) && NIM_INTBITS == sizeof(NI)*8, "");
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
NIM_STATIC_ASSERT(sizeof(NI) == sizeof(void*) && NIM_INTBITS == sizeof(NI)*8, "");
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Users/brandonwhite/.choosenim/toolchains/nim-1.6.10/lib/nimbase.h:276:35: note: expanded from macro 'NIM_STATIC_ASSERT'
#define NIM_STATIC_ASSERT(x, msg) _Static_assert((x), msg)
                                  ^               ~
NIM_STATIC_ASSERT(sizeof(NI) == sizeof(void*) && NIM_INTBITS == sizeof(NI)*8, "");
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Users/brandonwhite/.choosenim/toolchains/nim-1.6.10/lib/nimbase.h:276:35: note: expanded from macro 'NIM_STATIC_ASSERT'
#define NIM_STATIC_ASSERT(x, msg) _Static_assert((x), msg)
                                  ^               ~
NIM_STATIC_ASSERT(sizeof(NI) == sizeof(void*) && NIM_INTBITS == sizeof(NI)*8, "");
NIM_STATIC_ASSERT(sizeof(NI) == sizeof(void*) && NIM_INTBITS == sizeof(NI)*8, "");
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Users/brandonwhite/.choosenim/toolchains/nim-1.6.10/lib/nimbase.h:276:35: note: expanded from macro 'NIM_STATIC_ASSERT'
NIM_STATIC_ASSERT(sizeof(NI) == sizeof(void*) && NIM_INTBITS == sizeof(NI)*8, "");#define NIM_STATIC_ASSERT(x, msg) _Static_assert((x), msg)

                                  ^               ~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Users/brandonwhite/.choosenim/toolchains/nim-1.6.10/lib/nimbase.h:276:35: note: expanded from macro 'NIM_STATIC_ASSERT'
#define NIM_STATIC_ASSERT(x, msg) _Static_assert((x), msg)
                                  ^               ~
/Users/brandonwhite/.choosenim/toolchains/nim-1.6.10/lib/nimbase.hexpanded from macro 'NIM_STATIC_ASSERT':276:35:

^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Users/brandonwhite/.choosenim/toolchains/nim-1.6.10/lib/nimbase.h:276:35: note: expanded from macro 'NIM_STATIC_ASSERT'
#define NIM_STATIC_ASSERT(x, msg) _Static_assert((x), msg)
                                  ^               ~
#define NIM_STATIC_ASSERT(x, msg) _Static_assert((x), msg)
                                  ^               ~
 note: expanded from macro 'NIM_STATIC_ASSERT'
#define NIM_STATIC_ASSERT(x, msg) _Static_assert((x), msg)
                                  ^               ~
1 error generated.
1 error generated1 error generated.
1 error generated.
.
1 error generated.
1 error generated.
Error: execution of an external compiler program 'clang -c  -w -ferror-limit=3   -I/Users/brandonwhite/.choosenim/toolchains/nim-1.6.10/lib -I'/Users/brandonwhite/Documents/code projects/NiCalc/src' -o /Users/brandonwhite/.cache/nim/NiCalc_d/@m..@s..@s..@s..@s.choosenim@stoolchains@snim-1.6.10@slib@ssystem@sdollars.nim.c.o /Users/brandonwhite/.cache/nim/NiCalc_d/@m..@s..@s..@s..@s.choosenim@stoolchains@snim-1.6.10@slib@ssystem@sdollars.nim.c' failed with exit code: 1


1 error generated.                                                                                                                                          
brandonwhite@Brandons-MacBook-Air NiCalc % 1 error generated.

@simonkrauter
Copy link
Owner

Oh yes, the M2 is an Arm CPU. I think you should look for information how to compile Nim code for this CPU in general, not related to NiGui or Gtk. I don't have any device with Arm CPU to test.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants