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

tjc103 at ecs.soton.ac.uk tjc103 at ecs.soton.ac.uk
Mon Jul 24 01:15:19 PDT 2006


I managed to do it under Linux using GCC and G++ by having an extra C file
that calls the C++ functions, adding the line :

    extern int cpp_function_i_want(void);

after all of the includes.

Then in a seperate cpp file I had the C++ code required. I then changed the
function description for the functions I wanted C to have access to :

    extern "C" int cpp_function_i_want(){

This worked for everything I needed to do, I hope you have simliar success.
I also found this url usefull:

    http://geneura.ugr.es/~jmerelo/c++-faq/mixing-c-and-cpp.html




Quoting Rodrigo Weymar <weymar at ibr.cs.tu-bs.de>:

> 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
>






More information about the live-devel mailing list