c++ function can not call c routine or access c global variable. Why?
rj45rt at hotmail.com
Thu Mar 23 18:07:59 MST 2006
Yes, I compiled both parts of codes with the same compiler. But I did not
use extern "c" definition.
>From: Dave Smith <dave at thesmithfam.org>
>Reply-To: Provo Linux Users Group Mailing List <plug at plug.org>
>To: Provo Linux Users Group Mailing List <plug at plug.org>
>Subject: Re: c++ function can not call c routine or access c global
>Date: Thu, 23 Mar 2006 06:42:22 -0700
>Laurent R wrote:
>> There are two parts of codes in my project. One is implemented with C++,
>>the other is C. I compiled them repectively and link together. But I found
>>the problem. The function in C++ can not call the routine coded with c. It
>>will crash the system. And also the function in C++ can not access the
>>global variable defined in C. It will get the un-initialized value from
>>the global variable.
>> Have u met this kind of problem? Who can help me to explain this kind of
>Did you compile both parts of the code with the same C++ compiler? Did you
>use extern "C" where necessary?
>PLUG: http://plug.org, #utah on irc.freenode.net
>Don't fear the penguin.
Don't just search. Find. Check out the new MSN Search!
More information about the PLUG