[Qt-interest] C code in QT use queue in Class
Pavel Koshevoy
pavel at aragog.com
Wed Aug 5 17:01:06 CEST 2009
Mic J wrote:
>> We still need to see some code. Show us the header file you are
>> including. Global variables and extern declarations have been around
>> for a while. Perhaps you don't need to include the header at all (in
>> the C++ header), but instead make an extern "C" declaration for the
>> variable that you need from the C header.
>>
>
> c++ file using it(the DR_Data type):
> chartinfo.h (chartinfo.cpp need it too)
> Chartinfo is a collection of records of the type DR_Data
>
I've attached modified chartinfo.h (and a made up chartinfo.cpp) to
illustrate how you can work around the problem you've encountered using
a forward declaration. You have to make sure you include s_57_defs.h
only once, in a C/C++ source file (not header) so that you wouldn't have
multiply defined global variables.
Pavel.
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: chartinfo.cpp
Url: http://lists.qt-project.org/pipermail/qt-interest-old/attachments/20090805/e97683c3/attachment.pl
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: chartinfo.h
Url: http://lists.qt-project.org/pipermail/qt-interest-old/attachments/20090805/e97683c3/attachment.h
More information about the Qt-interest-old
mailing list