[Live-devel] calling Live555 libraries from a C app under Embedded Visual C++ 4.0

Rodrigo Weymar weymar at ibr.cs.tu-bs.de
Wed Aug 2 05:37:05 PDT 2006


Hi Bertram,

thank you for your help. Basically I want to use the complete openRTSP
program from inside a C app. To run the openRTSP.exe under WinCE is not a
problem. Also to buid the Live555 libs (groupsock, liveMedia,
UsageEnvironment and BasicUsageEnvironment) to WinCE is not a problem.

The problem is to get the C++ classes working from inside the C app I am
working on. I am able to compile and link the classes without errors, but
not to get they working. Probably I am using the C++ classes in a wrong
way.  Anyway I will keep trying.

Best regards,
Rodrigo


> Hi Rodrigo,
>
> my application is written in C++. I have renamed the main() function of
> the Test-Application playSIP in playCommon.cpp from
> 	main(int argc, char** argv)
> to
> 	mainplayCommon(int argc, char** argv)
>
> and then in my own application I declare
> 	extern int mainplayCommon(int, char**);
>
> So I can call later in my application the complete testProgramm playSIP
> like this:
>
> 	char *progName = "playSIP";
> 	const int argc = 12;
> 	char *argOne	= "-V";
> 	char *argTwo	= "-M";
> 	char *argThree	= "-A";
> 	char *argFour	= "8";
> 	char *argFive	= "-e";
> 	char *argSix	= "10";
> 	char *argSeven	= "-P";
> 	char *argEight	= "49211";
> 	char *argNine	= "-W";
> 	char *argTen	= "0";
> 	char *argEleven  = "172.16.1.100";
>
> 	char * argv[argc];
> 	argv[ 0] = progName;
> 	argv[ 1] = argOne;
> 	argv[ 2] = argTwo;
> 	argv[ 3] = argThree;
> 	argv[ 4] = argFour;
> 	argv[ 5] = argFive;
> 	argv[ 6] = argSix;
> 	argv[ 7] = argSeven;
> 	argv[ 8] = argEight;
> 	argv[ 9] = argNine;
> 	argv[10] = argTen;
> 	argv[11] = argEleven;
>
> 	mainplayCommon(argc,argv, this->m_frame);
>
> Did this help you?
>
> For an easier way to build my programm for Win32 and WinCE with one GUI
> and one Code my programm is build-on the minimalSample from wxWidgets. I
> don't know if this is realy intersting for your problem. But this sample
> has one base code and you could build the same code with the same GUI
> for Win32 and WinCE. In this sample if have include the code above.
>
> Best regard,
>
>     Bertram
>
>
> Rodrigo Weymar schrieb:
>
>> Hi Bertram,
>>
>>
>> is your application written in C or C++ ? Were you able to mix C and C++
>> code and to declare C++ functions as extern "C" under EVC++ without
>> using
>> #ifdef __cplusplus ?
>>
>> If I try to use extern "C" under EVC++ without using #ifdef __cplusplus,
>> I
>> get a
>>
>> error C2059: syntax error : 'string'
>>
>> as explained in http://www.kbalertz.com/kb_133070.aspx
>>
>>
>> regards,
>> Rodrigo
>>
>>
>>
>>
>>>Hi Rodrigo,
>>>
>>>i have written an SIP phone with RTP Stack from LIVE555 for Pocket PC /
>>>Windows CE with EVC++ 4.0. Unfortunately I'm not able to solve your
>>>problem but I can ensure you, that LIVE555 works fine under EVC++.
>>>Further, I remember me fine, I have not set up any preprocessor
>>> directive.
>>>
>>>Best regards,
>>>
>>>    Bertram
>>>
>>>
>>>
>>>>Hi all,
>>>>
>>>>probably this is not the right mailing list to ask, since my question
>>>> is
>>>>not directly concerning the Live555 libraries. But maybe someone can
>>>>help
>>>>me or give me an advice.
>>>>
>>>>I am trying to integrate the Live555 libs (I am interested in the RTSP
>>>>support provided by these libs) into an C app, more exactly a streaming
>>>>player for Pocket PC/WinCE420, which is written in C.
>>>>
>>>>I use Embedded Visual C++ 4.0 as IDE.
>>>>
>>>>I don't get any compilation errors, since from the C source code I am
>>>>using the following preprocessor directive:
>>>>
>>>>#ifdef __cplusplus
>>>>extern "C" {
>>>>
>>>>here I put the Live555 C++ classes
>>>>
>>>>}
>>>>#endif
>>>>
>>>>
>>>>What happens is that, when I run the app, the Live555 classes don't
>>>> take
>>>>any effect. That is, the Embedded Visual C++  C/C++ compiler seems to
>>>>just
>>>>ignore what is in between the preprocessor directives. It seems to have
>>>>not linked the C++ classes to the C objs.
>>>>
>>>>The document in [1] says that the C++ runtime libraries should be
>>>>explicitly
>>>>linked to the app. The problem is that I can not figure out how
>>>> Embedded
>>>>Visual C++ manages that. I was not able to find any option in "Project
>>>>Settings" or in "Tools -> Options" concerning that.
>>>>
>>>>I also googled for solutions, but was not able to find one.
>>>>
>>>>Would someone have previous experience with that? Could someone give me
>>>>help, please ?
>>>>
>>>>
>>>>Thanks a lot!
>>>>
>>>>Rodrigo
>>>>
>>>>
>>>>[1] http://developers.sun.com/prodtech/cc/articles/mixing.html#linking
>>>>
>>>>_______________________________________________
>>>>live-devel mailing list
>>>>live-devel at lists.live555.com
>>>>http://lists.live555.com/mailman/listinfo/live-devel
>>>>
>>>
>>>
>>>_______________________________________________
>>>live-devel mailing list
>>>live-devel at lists.live555.com
>>>http://lists.live555.com/mailman/listinfo/live-devel
>>>
>>
>>
>>
>> _______________________________________________
>> live-devel mailing list
>> live-devel at lists.live555.com
>> http://lists.live555.com/mailman/listinfo/live-devel
>>
>
>
> _______________________________________________
> live-devel mailing list
> live-devel at lists.live555.com
> http://lists.live555.com/mailman/listinfo/live-devel
>




More information about the live-devel mailing list