-
Notifications
You must be signed in to change notification settings - Fork 59
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
Can't compile on MacOS #58
Comments
Hmm, I wouldn't really know as the makefile for Mac has been submitted by an user (@nCore ), but - from your errors - it seems that the Mac SDK you're using provides the function that was unavailable earlier and mach.c is trying to replace. Could you edit mach.c and replace
with
and try building again? Perhaps the hack and the separate Mac makefile is not needed any more. |
Looks like it may work, please do try the fix above and report back if it worked, so I can fix the build for everyone |
Hi, thanks for the quick response! I made the change you recommended and received a new error, but I managed to compile it anyway. I did the following steps:
I don't know how to fix the default Makefile by myself, but I think the problem is only in the linker command. |
Glad it worked for you! The makefile for Mac has been missing the tox_bootstrap.h generator, that's why it worked after you ran the main Makefile. If you have some time, would you mind testing if my fix worked? On a clean git checkout, preferably:
It should also use toxcore.pc now, but you said you copied/linked that, so it should work anyway. |
Okay, I tested it and got the same first error on mach.c, so I made the manual fix again and compiled it without any other problems. |
Aargh, mach.c and mach.h were supposed to be deleted. If it's not a problem: would you mind checking again if it compiles when they're gone? |
It did not compile because I made this patch, so it will work without problems now: diff --git a/.gitignore b/.gitignore
index 272c4eb..6f2d3a4 100644
--- a/.gitignore
+++ b/.gitignore
@@ -28,5 +28,8 @@
*.x86_64
*.hex
+# OS generated files
+.DS_Store
+
# tuntox related, not needed in repo
tuntox
diff --git a/mach.h b/mach.h
new file mode 100644
index 0000000..7955c65
--- /dev/null
+++ b/mach.h
@@ -0,0 +1,7 @@
+#ifndef _MACH_H
+#define _MACH_H
+
+// MacOS doesn't support the flag MSG_NOSIGNAL
+#define MSG_NOSIGNAL SO_NOSIGPIPE
+
+#endif
\ No newline at end of file (I also removed the .DS_Store file because it was bothering me) |
Right! Thanks for the patch. Do you want to make a pull request to see your name in the commit log or should I just merge it? |
Ah, no need, but thanks! |
Hi, I'm having some problems trying to compile for MacOS.
First of all, I have almost zero experience with MacOS, I'm a Linux user and I'm trying to compile for MacOS using a VM (QEMU) to be able to share this tool with a friend of mine who uses MacOS. If there is a precompiled version for MacOS, I would like to know, so I don't need to compile it myself.
So, I compiled
TokTok/c-toxcore
and installed it without any problems.I had to copy/link the .pc file because pkg-config did not find it (toxcore.pc -> libtoxcore.pc).
Then I ran the
make -f Makefile.mac
command and got the following output:That's it. Sorry if the problem is too stupid, I don't really know how things work on MacOS yet.
The text was updated successfully, but these errors were encountered: