Re: Linking a C++ library to a C program.



"a2x" <add_aaron_2_x@xxxxxxxxxxx> wrote
>
> I am writing a C program which interfaces with a C++ library. The C++
> library works fine with C. I was wondering if I need to use a C++
> compiler (g++ in my case) to compile the C program or can I use a C
> compiler (gcc).
>
If you want to call a function written in C++ from a C file your best bet is
to write the C code in the common subset of the two languages and run it
through a C++ compiler. The alternative is to mess about with C++ name
mangling and linkage conventions.


.



Relevant Pages

  • Using shared library within VS .NET 2003
    ... also had to add the preprocessor definition "EXPORTING_pso." ... 2003 compiler can't find the implementation of this function. ... I supposed to fix this error? ... Prev by Date: ...
    (comp.soft-sys.matlab)
  • Re: Can you write code directly in CIL ???
    ... anyway if it's true I would suggest you to file a bug report ... I can prove that the newest C++ compiler produces equal or better ... code than VC6. ... Prev by Date: ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: newbie needs help
    ... Look in MSDN library - the help system that came with your VC++ ... compiler - for the Scribble tutorial. ... Tim Slattery ... Prev by Date: ...
    (microsoft.public.vc.ide_general)
  • Re: My FIRST Class!! But it doesnt work as expected - please HELP!
    ... Just put Option Strict On and the compiler will correct some extra issues ... Reporting tool: http://www.neodatatype.net ... Prev by Date: ...
    (microsoft.public.dotnet.languages.vb)
  • Re: Mongrel HTTP Library 0.2.0 (Fast And RubyForgified)
    ... C conditionally dependent on whether or not a compiler is available. ... Charlie ... Prev by Date: ...
    (comp.lang.ruby)