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

Problem compiling on MacOS #9

Open
glocq opened this issue Jan 30, 2019 · 4 comments
Open

Problem compiling on MacOS #9

glocq opened this issue Jan 30, 2019 · 4 comments

Comments

@glocq
Copy link

glocq commented Jan 30, 2019

Trying to compile on MacOS High Sierra 10.13.6 using make results in an error:

In file included from Standalone/synth.c:41:
Misc/common.h:70:6: error: conflicting types for 'swab'
void swab( const char *from, char *to, int nbytes);
     ^
/usr/include/unistd.h:600:10: note: previous declaration is here
void     swab(const void * __restrict, void * __restrict, ssize_t);
         ^

I did uncomment CFLAGS += -DTARGET_OS_MAC as specified in README_Makefile.md.

@GHPS
Copy link
Contributor

GHPS commented Apr 17, 2019

Strange - chengdu was able to compile mbrola on MacOS 64 Bit (see #3 (comment)_ )

  1. The cause of the warning is that the swab function is defined twice.
    What happens if you comment out the swab function in Misc/common.h?
    Do you still get the compile error?
  2. I checked the parts of the code where the compiler directive TARGET_OS_MAC is
    used. It's only reason is to enable the swab-function. So simply commenting the CFLAGS
    line out - again - should do the job.

@setrar
Copy link

setrar commented May 17, 2020

  1. The cause of the warning is that the swab function is defined twice.
    What happens if you comment out the swab function in Misc/common.h?
    Do you still get the compile error?

No, it's going through 🎉

% git diff Misc/common.h
diff --git a/Misc/common.h b/Misc/common.h
index 0357db4..e32b898 100644
--- a/Misc/common.h
+++ b/Misc/common.h
@@ -71,7 +71,7 @@
 
 /* For beboxes and Mac use a hand-made version of swab */
 #if defined(TARGET_OS_VMS) || defined(TARGET_OS_BEOS) || defined(TARGET_OS_MAC) || defined(__STRICT_ANSI__)
-void swab( const char *from, char *to, int nbytes);
+//void swab( const char *from, char *to, int nbytes);
 #endif
 
 #if defined(__GLIBC__)
  1. I checked the parts of the code where the compiler directive TARGET_OS_MAC is
    used. It's only reason is to enable the swab-function. So simply commenting the CFLAGS
    line out - again - should do the job.

No, I didn't comment it out otherwise I get an error in common.c

Misc/common.c:32:6: error: conflicting types for 'swab'
void swab( const char *from, char *to, int nbytes)

@setrar
Copy link

setrar commented May 17, 2020

A bit frustrated, I tried to compile the project under Multipass with Ubuntu Linux on MacOS.

I was able to compile following the documentation and was also able to create my first wave file.

$ Bin/mbrola -i ../MBROLA-voices/data/ca1/ca1 \
                          ../MBROLA-voices/data/ca1/test/merci.pho merci.wav

I then copied the file back onto the Mac

% sudo scp -i /var/root/Library/Application\ Support/multipassd/ssh-keys/id_rsa \
             multipass@192.168.64.4:MBROLA/merci.wav .

And it played only with Audacity and Garage Band but iTunes Music coudn't play the sound file, same noise issue.

Great projet! 🎉

@valdisvi
Copy link
Collaborator

Check out, if this fixes issue.

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

No branches or pull requests

4 participants