Developer Forums relocated!

Need help with Apple Developer tools and technologies? Want to share information with other developers and Apple engineers? Visit Developer Forums at Apple.

Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

Undefined symbols: "_NewSpeechChannel", referenced from...

Hello.

I'm an absolute beginner in developing for OSX and C programming in general.

I'm following the instructions step-by-step to writing a very simple program that makes use of the OSX Speech Synthesizer.

However the program won't compile and instead it lanuches this error:



> Undefined symbols:

> "_NewSpeechChannel", referenced from:

> > _main in ccRRVBTR.o

> ld: symbol(s) not found

> collect2: ld returned 1 exit status



I'm aware that the problem arises from the lack of proper linking to the actual implementation of the NewSpeechChannel function.

However it is a system function and I guess it should be linked by default. In any case, what should I do next to make it compile properly?



The simple program is this (so far):



#include<stdio.h>

#include<ApplicationServices/ApplicationServices.h>

int main(int argc, char **argv, char **envp, char **apple) {

SpeechChannel speechchannel;

NewSpeechChannel( NULL, &speechchannel );

}



The reference of the Speech Synthesis Manager (the C API for speech synthesis) sits here:

https://developer.apple.com/library/mac/#documentation/Carbon/Reference/Speech_S ynthesis_Manager/Reference/reference.html

None of the functions listed in the reference compile, along with NewSpeechChannel.



I know it is a very basic question by any help is welcome, as I'm stuck at the very beginning of my project.

Thanks!


PS: I tried it on both OS X 10.6.8 and 10.7.5

Mac OS X (10.6.8)

Posted on Jul 3, 2013 6:15 AM

Reply
Question marked as Best reply

Posted on Jul 3, 2013 8:42 AM

Add the Application Services framework to your project.

User uploaded file

2 replies

Undefined symbols: "_NewSpeechChannel", referenced from...

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple ID.