J'ai un petit probleme de compilation, je me remets a la prog et j'ai le cerveau rouillé!:
g++ --thread -o bin.debug.Linux.i686/mediaServer obj.debug.Linux.i686/mediaServer.o obj.debug.Linux.i686/OpAnnounce.o obj.debug.Linux.i686/OpDescribe.o obj.debug.Linux.i686/OpSetup.o obj.debug.Linux.i686/OpSetupInvalid.o obj.debug.Linux.i686/OpPlay.o obj.debug.Linux.i686/OpPlayInvalid.o obj.debug.Linux.i686/OpRecord.o obj.debug.Linux.i686/OpRecordInvalid.o obj.debug.Linux.i686/OpPause.o obj.debug.Linux.i686/OpPauseOk.o obj.debug.Linux.i686/OpPauseInvalid.o obj.debug.Linux.i686/OpTeardown.o obj.debug.Linux.i686/OpTeardownOk.o obj.debug.Linux.i686/OpOptions.o obj.debug.Linux.i686/OpSetParameter.o obj.debug.Linux.i686/StateMachine.o obj.debug.Linux.i686/State.o obj.debug.Linux.i686/RtpFileTypes.o obj.debug.Linux.i686/RtspCommandLine.o obj.debug.Linux.i686/RtspConfiguration.o obj.debug.Linux.i686/RtspFileHandler.o obj.debug.Linux.i686/RtspFileManager.o obj.debug.Linux.i686/RtspFile.o obj.debug.Linux.i686/RtspFileAu.o obj.debug.Linux.i686/RtspFileRaw.o obj.debug.Linux.i686/RtspFileRtp.o obj.debug.Linux.i686/RtspFileWav.o obj.debug.Linux.i686/RtspRtpProcessor.o obj.debug.Linux.i686/RtspSession.o obj.debug.Linux.i686/RtspSessionManager.o obj.debug.Linux.i686/RtspServer.o obj.debug.Linux.i686/RtspServerStats.o obj.debug.Linux.i686/RtspSessionStats.o obj.debug.Linux.i686/RtspAsynchronous.o obj.debug.Linux.i686/Event.o -L../../build/../contrib/libsndfile.Linux.i686/src/.libs -L../../build/../../Syc-3.0A/bin/ -L../../build/../rtsp/rtspif/obj.debug.Linux.i686 -L../../build/../rtsp/rtspstack/obj.debug.Linux.i686 -L../../build/../rtp/obj.debug.Linux.i686 -L../../build/../sdp/obj.debug.Linux.i686 -L../../build/../../TtsServerMrcp/obj.debug.Linux.i686 -L../../build/../../StackMrcp/obj.debug.Linux.i686 -L../../build/../http/obj.debug.Linux.i686 -L../../build/../util/obj.debug.Linux.i686 -L../../build/../../TtsCvox/ -lcvox -lrtspif -lrtsp -lrtp -lsdp -lpthread -lmrcpserver -lmrcpstack -lhttp -lutil -lttscvox -Wl,-Bstatic -lstdc++ -Wl,-Bdynamic -Wl,-Bstatic -lsndfile -Wl,-Bdynamic
/usr/bin/ld: ne peut trouver -lcvox
collect2: ld a retourné 1 code d'état d'exécution
make[1]: *** [bin.debug.Linux.i686/mediaServer] Erreur 1
une idée?
Merci
# bibliotheque manquante
Posté par hervé^3527 . Évalué à 1.
1) la bibliotheque cvox n'est pas dans un des répertoires de LD_LIBRARY_PATH
-> test avec "echo $LD_LIBRARY_PATH" pour regarder les répertoires
si le répertoire contenant la bibliotheque n'y est pas, édite le fichier /etc/ld.so.conf, ajoute le chemin de ton répertoire et ensuite execute ldconfig pour mettre a jour le cache des bibliotheques...
2) elle n'a pas été encore compilée (auquel cas ton makefile ne compile pas dans le bon ordre tes bibliotheques)
sinon je ne sait pas (PS: tu aurais pu tout mettre dans le meme thread du forum)
[^] # Re: bibliotheque manquante
Posté par Roulious . Évalué à 1.
[^] # Re: bibliotheque manquante
Posté par moule2005 . Évalué à 1.
vpath %.cpp ./src
vpath %.h ./include
CC=gcc-2
CXX=G++-2
CFLAGS+= -mno-cygwin -l ./include -l ../Syc-3.0A/include -Wall
CXXFLAGS+= -mno-cygwin -l ./include -l ../Syc-3.0A/include -Wall
ALL: libttscvox.dll
CTTSCvox.o : CTTSCvox.cpp CTTSAbstract.h CTTSCvox.h
libttscvox.dll : CTTSCvox.o
$(CXX) -shared $(CXXFLAGS) $< -o $@ -l../Syc-3.0A/lib/ -lcvox
------------------------------------------------------------------
voila ce que j'obtiens:
G++-2 -mno-cygwin -l ./include -l ../Syc-3.0A/include -Wall -c -o CTTSCvox.o ./src/CTTSCvox.cpp
make: G++-2 : Commande introuvable
make: *** [CTTSCvox.o] Erreur 127
------------------------------------------------------------
pour un cpp:
/*
* $Id$
*
* $Log$
*
*/
#include "CTTSCvox.h"
#include <iostream.h>
#include <stdlib.h>
extern "C" PCTTSAbstract NewCTTSAbstract(PCVoiceAppInfo info)
{
return new TTSCVOX(info) ;
}
extern "C" void DeleteCTTSAbstract(PCTTSAbstract ptr)
{
delete ptr;
}
extern "C" int ConfigureCTTSAbstract(PCVoiceAppInfo)
{
return 1;
}
extern "C" int InitCTTSAbstract(PCVoiceAppInfo)
{
return 1;
}
extern "C" int ShutdownCTTSAbstract(PCVoiceAppInfo)
{
return 1;
}
static void
callback_buffer(CVOX_ENGINE engine, cvox_int32 position, void *arg,
cvox_bool begin, cvox_int32 bufferNumber) {
TTSCVOX* ptr = (TTSCVOX* ) arg;
ptr->callback_buffer(engine,position, begin, bufferNumber) ;
}
static cvox_uint16
callback_out (CVOX_ENGINE engine,void *arg, void* address,
cvox_int32 length, void **nextbuffer, cvox_int32 *nextsize) {
TTSCVOX* ptr = (TTSCVOX* ) arg;
return ptr->callback_out(engine, address, length, nextbuffer, nextsize) ;
}
static void run_cvox_engine(void* eng)
{
CVOX_ENGINE *engine = (CVOX_ENGINE*) eng ;
cvox_Execute(*engine);
}
TTSCVOX::TTSCVOX(PCVoiceAppInfo PAppInfo) : CTTSAbstract( PAppInfo)
{
isSpeaking = false;
isRunning = false;
tabStruct = NULL;
}
TTSCVOX::~TTSCVOX()
{
if (isRunning)
{
cvox_Stop(engine);
ret = cvox_DeleteEngine(engine);
TestReturnCode("cvox_Delete()", ret);
//for (int i = 0 ; i < nbVoice ; i++) {
//tabStruct[i];
//}
delete tabStruct;
}
}
int
TTSCVOX::SetTTSClalback(TTSCallback func, void* ptUser)
{
m_func = func;
m_ptUser = ptUser;
return 1;
}
int
TTSCVOX::UnsetTTSCallback()
{
m_func = NULL;
m_ptUser = NULL;
return 1;
}
int
TTSCVOX::Init(const char* szInitString ) {
//There are nothing here to szInitString
memset(&data_in, 0, sizeof(CVOX_IO_DATA));
memset(&data_out, 0, sizeof(CVOX_IO_DATA));
data_out.writeRawCB = ::callback_out;
data_out.arg = this;
data_out.synchro.bufferCB = ::callback_buffer;
data_out.synchro.arg = this;
data_out.coding = CVOX_PCM_SWAP;
data_in.parsing = CVOX_SSML_20;
ret = cvox_NewEngine((char*)szInitString, "", &engine);
TestReturnCode("cvox_NewEngine()", ret);
ret = cvox_Connect(engine,CVOX_INPUT, CVOX_FUNCTIONAL_IO, &data_in) ;
TestReturnCode("cvox_Connect(IN)", ret);
ret = cvox_Connect(engine,CVOX_OUTPUT, CVOX_RAW_IO,&data_out) ;
TestReturnCode("cvox_Connect(OUT)", ret);
xthr_run(&inputTHR,::run_cvox_engine, &engine);
/** add its number to fifo */
cvox_WaitRunning(engine);
isRunning = true;
CVOX_ENGINE_INFO info;
ret = cvox_GetEngineInfo(engine,&info);
nbVoice = info.numberOfVoice;
tabStruct = new CVOX_VOICE_INFO[nbVoice] ;
CVOX_VOICE_INFO voiceInfo;
for (int rank = 0 ; rank < nbVoice ;rank++) {
cvox_GetVoiceInfo(engine,rank,&voiceInfo) ;
tabStruct[rank] = voiceInfo;
}
return 1;
}
int
TTSCVOX::Shutdown()
{
return 1;
}
cvox_uint16
TTSCVOX::callback_out (CVOX_ENGINE engine, void* address,
cvox_int32 length, void **nextbuffer, cvox_int32 *nextsize) {
m_func (m_ptUser, (char*) address, (size_t)length);
return (CVOX_CB_OK);
}
void
TTSCVOX::callback_buffer(CVOX_ENGINE engine, cvox_int32 position, cvox_bool begin, cvox_int32 bufferNumber) {
static unsigned char max = 170, min = 42;
if (begin) {
m_func (m_ptUser, (char*) &max, 1);
}
else
{
m_func (m_ptUser, (char*) &min, 1);
m_func (m_ptUser, (char*) &min, 0);
isSpeaking = false;
}
}
void
TTSCVOX::TestReturnCode(char *function, cvox_uint16 ret)
{
char *code = 0;
switch (ret) {
case CVOX_OK:
break;
case CVOX_BAD_ENGINE:
code = "bad engine";
break;
case CVOX_FORBIDDEN_CALL:
code = "forbidden call";
break;
case CVOX_BAD_PARAMETER:
code = "bad parameter";
break;
case CVOX_INTERNAL_ERROR:
code = "internal error";
break;
case CVOX_PARSING_ERROR:
code = "parsing error";
break;
}
if (code) {
fprintf(stderr, "Error. %s returned \"%s\"\n", function, code);
exit(1);
}
}
int
TTSCVOX::GetSpeed(int &Speed) {
CVOX_ENGINE_INFO* voiceInfo;
cvox_GetEngineInfo(engine,voiceInfo);
Speed = (int) (voiceInfo->rate_info).rate;
return 1;
}
int
TTSCVOX::GetSpeed(TTSSpeed &Speed) {
CVOX_ENGINE_INFO* voiceInfo;
cvox_GetEngineInfo(engine,voiceInfo);
int speed = (int) (voiceInfo->rate_info).rate;
if (speed <= 100) {
Speed = SPEED_LOW;
return 1;
}
if (speed <= 180) {
Speed = SPEED_MEDIUM;
return 1;
}
if (speed > 180) {
Speed = SPEED_HIGHT;
return 1;
}
return 0;
}
int
TTSCVOX::GetPitch(int &Pitch) {
CVOX_ENGINE_INFO* voiceInfo;
cvox_GetEngineInfo(engine,voiceInfo);
Pitch = (int) (voiceInfo->pitch_info).range;
return 1;
}
int
TTSCVOX::GetPitch(TTSPitch &Pitch) {
CVOX_ENGINE_INFO* voiceInfo;
cvox_GetEngineInfo(engine,voiceInfo);
int pitch = (int) (voiceInfo->pitch_info).range;
if (pitch <= 80) {
Pitch = PITCH_LOW;
return 1;
}
if (pitch <= 160) {
Pitch = PITCH_MEDIUM;
return 1;
}
if (pitch > 160) {
Pitch = PITCH_HIGHT;
return 1;
}
return 0;
}
int
TTSCVOX::GetVolume(int &Volume) {
CVOX_ENGINE_INFO* voiceInfo;
cvox_GetEngineInfo(engine,voiceInfo);
Volume = (int) voiceInfo->gain;
return 1;
}
int
TTSCVOX::GetVolume(TTSVolume &Volume) {
CVOX_ENGINE_INFO* voiceInfo;
cvox_GetEngineInfo(engine,voiceInfo);
int volume = (int) voiceInfo->gain;
if (volume == -24) {
Volume = VOLUME_SILENT;
return 1;
}
if (volume <= 3) {
Volume = VOLUME_SOFT;
return 1;
}
if (volume <= 9) {
Volume = VOLUME_MEDIUM;
return 1;
}
if (volume > 9) {
Volume = VOLUME_LOUD;
return 1;
}
return 0;
}
int
TTSCVOX::GetSex(TTSSex &Sex) {
CVOX_ENGINE_INFO* engineInfo;
cvox_GetEngineInfo(engine,engineInfo);
int rank = (int) engineInfo->currentVoice;
CVOX_VOICE_INFO* voiceInfo;
cvox_GetVoiceInfo(engine,rank,voiceInfo);
int sex = (int) voiceInfo->sex;
if (sex == 0) {
Sex = SEX_MALE;
return 1;
}
if (sex == 1) {
Sex = SEX_FEMALE;
return 1;
}
if (sex == 2) {
Sex = SEX_NEUTRAL;
return 1;
}
return 0;
}
int
TTSCVOX::GetVoice(char* Buffer, size_t MaxLen) {
CVOX_ENGINE_INFO* engineInfo;
cvox_GetEngineInfo(engine,engineInfo);
int rank = (int) engineInfo->currentVoice;
CVOX_VOICE_INFO* voiceInfo;
cvox_GetVoiceInfo(engine,rank,voiceInfo);
Buffer = voiceInfo->name;
return 1;
}
int
TTSCVOX::SetSpeed(int NewSpeed) {
if (NewSpeed >= 0 && NewSpeed < 3000) {
cvox_SetParam(engine,CVOX_RATE_PARAM,NewSpeed,0);
return 1;
}
return 0;
}
int
TTSCVOX::SetSpeed(TTSSpeed NewSpeed) {
switch (NewSpeed) {
case SPEED_DEFAULT:
cvox_SetParam(engine,CVOX_RATE_PARAM,CVOX_RESET_PARAM,0);
break;
case SPEED_LOW:
cvox_SetParam(engine,CVOX_RATE_PARAM,50,0);
break;
case SPEED_MEDIUM:
cvox_SetParam(engine,CVOX_RATE_PARAM,135,0);
break;
case SPEED_HIGHT:
cvox_SetParam(engine,CVOX_RATE_PARAM,200,0);
break;
default: return 0;
}
return 1;
}
int
TTSCVOX::SetPitch(int NewPitch) {
if ( NewPitch >= 0 && NewPitch < 300) {
cvox_SetParam(engine,CVOX_PITCH_MIN_PARAM,NewPitch,0);
return 1;
}
return 0;
}
int
TTSCVOX::SetPitch(TTSPitch NewPitch) {
switch ( NewPitch ) {
case PITCH_DEFAULT:
cvox_SetParam(engine,CVOX_PITCH_RANGE_PARAM,CVOX_RESET_PARAM,0);
break;
case PITCH_LOW:
cvox_SetParam(engine,CVOX_PITCH_RANGE_PARAM,50,0);
break;
case PITCH_MEDIUM:
cvox_SetParam(engine,CVOX_PITCH_RANGE_PARAM,135,0);
break;
case PITCH_HIGHT:
cvox_SetParam(engine,CVOX_PITCH_RANGE_PARAM,200,0);
break;
default: return 0;
}
return 1;
}
int
TTSCVOX::SetVolume(int NewVolume) {
if (NewVolume >= -24 && NewVolume < 12) {
cvox_SetParam(engine,CVOX_VOLUME_PARAM,NewVolume,0);
return 1;
}
return 0;
}
int
TTSCVOX::SetVolume(TTSVolume NewVolume) {
switch(NewVolume) {
case VOLUME_DEFAULT:
cvox_SetParam(engine,CVOX_VOLUME_PARAM,CVOX_RESET_PARAM,0);
break;
case VOLUME_SILENT:
cvox_SetParam(engine,CVOX_VOLUME_PARAM,-24,0);
break;
case VOLUME_SOFT:
cvox_SetParam(engine,CVOX_VOLUME_PARAM,0,0);
break;
case VOLUME_MEDIUM:
cvox_SetParam(engine,CVOX_VOLUME_PARAM,6,0);
break;
case VOLUME_LOUD:
cvox_SetParam(engine,CVOX_VOLUME_PARAM,12,0);
break;
default: return 0;
}
return 1;
}
int
TTSCVOX::SetLanguage(TTSLanguage NewLanguage)
{
switch(NewLanguage) {
case LANGUAGE_FRENCH:
for (int i = 0; i < nbVoice ; i++)
{
CVOX_VOICE_INFO voiceInfo;
voiceInfo = tabStruct[i];
if (CVOX_FRENCH == voiceInfo.language) cvox_SetParam(engine,CVOX_VOICE_ID_PARAM,i,0);
}
break;
case LANGUAGE_GERMAN:
for (int i = 0; i < nbVoice ; i++)
{
CVOX_VOICE_INFO voiceInfo;
voiceInfo = tabStruct[i];
if (CVOX_GERMAN == voiceInfo.language) cvox_SetParam(engine,CVOX_VOICE_ID_PARAM,i,0);
}
break;
case LANGUAGE_SPANISH:
for (int i = 0; i < nbVoice ; i++)
{
CVOX_VOICE_INFO voiceInfo;
voiceInfo = tabStruct[i];
if (CVOX_SPANISH == voiceInfo.language) cvox_SetParam(engine,CVOX_VOICE_ID_PARAM,i,0);
}
break;
case LANGUAGE_RUSSIAN:
for (int i = 0; i < nbVoice ; i++)
{
CVOX_VOICE_INFO voiceInfo;
voiceInfo = tabStruct[i];
if (CVOX_RUSSIAN == voiceInfo.language) cvox_SetParam(engine,CVOX_VOICE_ID_PARAM,i,0);
}
break;
default: return 0;
}
return 1;
}
int
TTSCVOX::SetSex(TTSSex NewSex)
{
switch ( NewSex ) {
case SEX_MALE:
for (int i = 0; i < nbVoice ; i++)
{
CVOX_VOICE_INFO voiceInfo;
voiceInfo = tabStruct[i];
if (CVOX_MALE == voiceInfo.sex) cvox_SetParam(engine,CVOX_VOICE_ID_PARAM,i,0);
}
break;
case SEX_FEMALE:
for (int i = 0; i < nbVoice ; i++)
{
CVOX_VOICE_INFO voiceInfo;
voiceInfo = tabStruct[i];
if (CVOX_FEMALE == voiceInfo.sex) cvox_SetParam(engine,CVOX_VOICE_ID_PARAM,i,0);
}
break;
case SEX_NEUTRAL:
for (int i = 0; i < nbVoice ; i++)
{
CVOX_VOICE_INFO voiceInfo;
voiceInfo = tabStruct[i];
if (CVOX_UNKNOWN_SEX == voiceInfo.sex) cvox_SetParam(engine,CVOX_VOICE_ID_PARAM,i,0);
}
break;
default: return 0;
}
return 1;
}
int
TTSCVOX::SetVoice(const char* szNewVoice) {
//V?ifier que la voix existe
for (int i = 0; i < nbVoice ; i++)
{
CVOX_VOICE_INFO voiceInfo;
voiceInfo = tabStruct[i];
if (strcmp(szNewVoice,voiceInfo.name) == 0) {
cvox_SetParam(engine,CVOX_VOICE_NAME_PARAM,0,szNewVoice);
return 1;
}
}
return 0;
}
bool
TTSCVOX::IsSpeaking() {
return (isSpeaking);
}
int
TTSCVOX::Speak2Wave(const char* szPhrase, char* szFileName, TTSTextType Type = TT_Text) {
cvox_GiveText( engine, szPhrase, strlen(szPhrase) );
cvox_Flush(engine);
return 1;
}
int
TTSCVOX::translateSex(const char* sex)
{
if (sex == 0) return -1;
if (strcmp(sex,"male") == 0) return CVOX_MALE;
if (strcmp(sex,"female") == 0) return CVOX_FEMALE;
return -1;
}
int
TTSCVOX::translateMedian(const char* median)
{
int medianInt = atoi(median);
if (medianInt < 0 ) return 0;
if (medianInt > 100) return 100;
return medianInt;
}
voila........!
[^] # Re: bibliotheque manquante
Posté par moule2005 . Évalué à 1.
[^] # Re: bibliotheque manquante
Posté par Roulious . Évalué à 1.
LDFLAGS=-L /mon/chemin/
Profites-en pour changer la ligne
CXX=G++-2
en
CXX=g++-2
ça t'évitera l'erreur de compilation que tu montres dans ton post précédent.
[^] # Re: bibliotheque manquante
Posté par moule2005 . Évalué à 1.
[^] # Re: bibliotheque manquante
Posté par moule2005 . Évalué à 1.
je recupere ca en compilant un cxx:
"
src/TtsSimpleClientMrcp.cxx:643: argument par défaut donné pour le paramètre
3 de «int TtsSimpleClientMrcp::Speak2Wave(const char*, char*, TTSTextType =
TT_Text)»
include/TtsSimpleClientMrcp.hxx:117: après la déclaration précédente dans
«int TtsSimpleClientMrcp::Speak2Wave(const char*, char*, TTSTextType =
TT_Text)»
make: *** [obj.debug.Linux.i686/TtsSimpleClientMrcp.o] Erreur 1
"
nota, a l'origine je l'avais ecrit et dev sous win (cygwin) est ce que cela pourrait poser probleme, je ne vois pas de probleme de portage
Merci
[^] # Re: bibliotheque manquante
Posté par Roulious . Évalué à 1.
en
[^] # Re: bibliotheque manquante
Posté par moule2005 . Évalué à 1.
ca ressemble a une precedente mais au final je n'arrive pas a resoudre le probleme avec la methode!!!!
"
g++ --thread -o bin.debug.Linux.i686/MrcpClient obj.debug.Linux.i686/MrcpClient.o obj.debug.Linux.i686/CTTSAbstract.o obj.debug.Linux.i686/CircularBuffer.o obj.debug.Linux.i686/TtsSimpleClientMrcp.o -L../vocal-1.4.0/build/../../TtsSimpleClientMrcp/wave/bin/ -L../vocal-1.4.0/build/../rtsp/rtspstack/obj.debug.Linux.i686 -L../vocal-1.4.0/build/../rtp/obj.debug.Linux.i686 -L../vocal-1.4.0/build/../sdp/obj.debug.Linux.i686 -L../vocal-1.4.0/build/../util/obj.debug.Linux.i686 -L../vocal-1.4.0/build/../../StackMrcp/obj.debug.Linux.i686 -lwave -lrtsp -lrtp -lsdp -lpthread -lutil -lmrcpstack -Wl,-Bstatic -lstdc++ -Wl,-Bdynamic
/usr/bin/ld: ne peut trouver -lwave
collect2: ld a retourné 1 code d'état d'exécution
make: *** [bin.debug.Linux.i686/MrcpClient] Erreur 1
"
voila voila
Suivre le flux des commentaires
Note : les commentaires appartiennent à celles et ceux qui les ont postés. Nous n’en sommes pas responsables.