Форум программистов, компьютерный форум, киберфорум
C++
Войти
Регистрация
Восстановить пароль
Блоги Сообщество Поиск Заказать работу  
 
Рейтинг 4.91/11: Рейтинг темы: голосов - 11, средняя оценка - 4.91
 Аватар для artem78
6 / 8 / 2
Регистрация: 20.12.2012
Сообщений: 729

Illegal use of incomplete struct/union/class

14.09.2018, 21:13. Показов 2223. Ответов 1

Студворк — интернет-сервис помощи студентам
Почему выходит эта ошибка?
illegal use of incomplete struct/union/class 'MLbsPositionListener' GPSDemoContainer.h /GPSDemo/inc line 38
LbsPositionListener.h
C++
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
/*
* ==============================================================================
*  Name        : LbsPositionListener.h
*  Part of     : LBSReference example application
*  Interface   : 
*  Description : Position listener interface
*  Version     : 1.0
*
*  Copyright (c) 2005-2006 Nokia Corporation.
*  This material, including documentation and any related 
*  computer programs, is protected by copyright controlled by 
*  Nokia Corporation.
* ==============================================================================
*/
 
#ifndef LBSPOSITIONLISTENER_H
#define LBSPOSITIONLISTENER_H
 
#include <lbsSatellite.h>
 
class TPositionInfo;
class TPositionSatelliteInfo;
 
/**
*   Position data listener interface listens position information.
*   It can also be used to transfer error messages and codes.
*/
class MLbsPositionListener
    {
    public:
 
        /**
        * PositionInfoUpdatedL informs the listener about new location information
        * @param aModulename The name of the module which provided this information
        * @param aPosInfo Position information class
        */
        virtual void PositionInfoUpdatedL(TPositionInfoBase& aPosInfo,
            const TDesC& aModulename) = 0;
 
        /**
        * ShowErrorL informs the listener about occurred error during position 
        * request process
        * @param aErrorString The error in string format
        */
        virtual void ShowErrorL(const TDesC& aErrorString) = 0;
        
        /**
        * ShowMessageL informs the listener about occurred event during position 
        * request process
        * @param aMessage The message in string format
        */
        virtual void ShowMessageL(const TDesC& aMessage) = 0;
        
    };
 
#endif //LBSPOSITIONLISTENER_H
 
 
// End of File
GPSDemoContainer.h
C++
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
/*
========================================================================
 Name        : GPSDemoContainer.h
 Author      : 
 Copyright   : Your copyright notice
 Description : 
========================================================================
*/
#ifndef GPSDEMOCONTAINER_H
#define GPSDEMOCONTAINER_H
 
// [[[ begin generated region: do not modify [Generated Includes]
#include <coecntrl.h>       
// ]]] end generated region [Generated Includes]
 
 
// [[[ begin [Event Handler Includes]
// ]]] end [Event Handler Includes]
 
// [[[ begin generated region: do not modify [Generated Forward Declarations]
class MEikCommandObserver;      
class CAknSingleHeadingStyleListBox;
class CEikTextListBox;
// ]]] end generated region [Generated Forward Declarations]
 
 
 
//#include <lbs.h>
#include "LBSPositionRequestor.h"
 
 
 
/**
 * Container class for GPSDemoContainer
 * 
 * @class   CGPSDemoContainer GPSDemoContainer.h
 */
class CGPSDemoContainer : public CCoeControl, public MLbsPositionListener
    {
public:
    // constructors and destructor
    CGPSDemoContainer();
    static CGPSDemoContainer* NewL( 
        const TRect& aRect, 
        const CCoeControl* aParent, 
        MEikCommandObserver* aCommandObserver );
    static CGPSDemoContainer* NewLC( 
        const TRect& aRect, 
        const CCoeControl* aParent, 
        MEikCommandObserver* aCommandObserver );
    void ConstructL( 
        const TRect& aRect, 
        const CCoeControl* aParent, 
        MEikCommandObserver* aCommandObserver );
    virtual ~CGPSDemoContainer();
 
public:
    // from base class CCoeControl
    TInt CountComponentControls() const;
    CCoeControl* ComponentControl( TInt aIndex ) const;
    TKeyResponse OfferKeyEventL( 
            const TKeyEvent& aKeyEvent, 
            TEventCode aType );
    void HandleResourceChange( TInt aType );
    
protected:
    // from base class CCoeControl
    void SizeChanged();
 
private:
    // from base class CCoeControl
    void Draw( const TRect& aRect ) const;
 
private:
    void InitializeControlsL();
    void LayoutControls();
    CCoeControl* iFocusControl;
    MEikCommandObserver* iCommandObserver;
    // [[[ begin generated region: do not modify [Generated Methods]
public: 
    static void AddListBoxItemL( 
            CEikTextListBox* aListBox,
            const TDesC& aString );
    static RArray< TInt >* GetSelectedListBoxItemsLC( CEikTextListBox* aListBox );
    static void DeleteSelectedListBoxItemsL( CEikTextListBox* aListBox );
    CAknSingleHeadingStyleListBox* ListBox();
    static void CreateListBoxItemL( TDes& aBuffer, 
            const TDesC& aHeadingText,
            const TDesC& aMainText );
    void AddListBoxResourceArrayItemL( TInt aResourceId );
    void SetupListBoxIconsL();
    TBool HandleMarkableListCommandL( TInt aCommand );
    // ]]] end generated region [Generated Methods]
    
    // [[[ begin generated region: do not modify [Generated Type Declarations]
public: 
    // ]]] end generated region [Generated Type Declarations]
    
    // [[[ begin generated region: do not modify [Generated Instance Variables]
private: 
    CAknSingleHeadingStyleListBox* iListBox;
    // ]]] end generated region [Generated Instance Variables]
    
    
    // [[[ begin [Overridden Methods]
protected: 
    // ]]] end [Overridden Methods]
    
    
    // [[[ begin [User Handlers]
protected: 
    // ]]] end [User Handlers]
    
public: 
    enum TControls
        {
        // [[[ begin generated region: do not modify [Generated Contents]
        EListBox,
        
        // ]]] end generated region [Generated Contents]
        
        // add any user-defined entries here...
        
        ELastControl
        };
    enum TListBoxImages
        {
        // [[[ begin generated region: do not modify [Generated Enums]
        EListBoxFirstUserImageIndex
        
        // ]]] end generated region [Generated Enums]
        
        };
 
 
/*private:
    
    RPositionServer iPosServer;
    RPositioner iPositioner;
    TPositionModuleId iModuleId;
    TPositionUpdateOptions iUpdateOptions;
    TPositionInfo iPosInfo;
    TRequestStatus iStatus;
    
    void StartTrackingLC();*/
    //void StopTracking/*L*/();
 
 
 
 
private:
    CLbsPositionRequestor* iPositionRequestor;
    //CDesCArray* iItemArray;
    
public:
    void PositionInfoUpdatedL(TPositionInfoBase& aPosInfo,
        const TDesC& aModulename);   
    void ShowErrorL(const TDesC& aErrorString);
    void ShowMessageL(const TDesC& aMessage);
    
};
 
#endif // GPSDEMOCONTAINER_H
0
Лучшие ответы (1)
Programming
Эксперт
39485 / 9562 / 3019
Регистрация: 12.04.2006
Сообщений: 41,671
Блог
14.09.2018, 21:13
Ответы с готовыми решениями:

std::bind1st: is not a class, struct, or union type
Добрый день, пытаюсь найти элемент в списки указателей на объекты классачерез предикат. Вот упрощенный пример: #include...

Не могу исправить error C2228: left of '.isWorked' must have class/struct/union
Добрый день. Есть два взаимодружественных класса.Методом одного, меняю поля другого. Вот код: class Alarm; //класс сигнализации ...

error C2228: left of '.add' must have class/struct/union type. в чем ошибка?
Помогите понять в чем ошибка. Пасиб. #include &lt;iostream.h&gt; class book { private: char name_book; char name_avtor; ...

1
Неэпический
 Аватар для Croessmah
18146 / 10730 / 2066
Регистрация: 27.09.2012
Сообщений: 27,029
Записей в блоге: 1
14.09.2018, 22:38
Лучший ответ Сообщение было отмечено artem78 как решение

Решение

Цитата Сообщение от artem78 Посмотреть сообщение
Почему выходит эта ошибка?
Нет определения класса MLbsPositionListener в данной точке:
C++
1
class CGPSDemoContainer : public CCoeControl, public MLbsPositionListener
Цитата Сообщение от artem78 Посмотреть сообщение
C++
1
#include "LBSPositionRequestor.h"
Почему не добавили #include "LbsPositionListener.h"?
1
Надоела реклама? Зарегистрируйтесь и она исчезнет полностью.
inter-admin
Эксперт
29715 / 6470 / 2152
Регистрация: 06.03.2009
Сообщений: 28,500
Блог
14.09.2018, 22:38
Помогаю со студенческими работами здесь

Ошибка компиляции "must have class/struct/union"
Здравствуйте. Возникают ошибки: Error 4 error C2228: left of '.dwFileAttributes' must have class/struct/union Error 3 error...

Исправить ошибку :"Error C2227 left of '->next' must point to class/struct/union/generic type "в фунциях пуш и поп
Задача:Смоделируйте очередь с помощью двух стеков. Добавление элемента в очередь сводится к добавлению к одному из стеков, а проверка,...

При компиляции ошибка: C2228: left of ".real",".imag" must have struct/class/union
Помогите, пожалуйста! Компилирую в VS2010... Ошибка: C2228: left of &quot;.real&quot;,&quot;.imag&quot; must have struct/class/union... Почему возникает эта...

Объяснить причины ошибки "Extra qualification 'CLASS CONSTRUCTOR' and 'CLASS' has incomplete type"
Согласно синтаксису, вроде все правильно, но ошибка... что не так? Ошибки компилятора ниже на рисунке... #include...

Union, struct
Здравствуйте! Помогите, пожалуйста, решить проблему. Есть строки: 1 2 3 4 1 2 3 ... ... * - заканчивается звездочкой


Искать еще темы с ответами

Или воспользуйтесь поиском по форуму:
2
Ответ Создать тему
Новые блоги и статьи
SDL3 для Web (WebAssembly): Работа со звуком через SDL3_mixer
8Observer8 08.02.2026
Содержание блога Пошагово создадим проект для загрузки звукового файла и воспроизведения звука с помощью библиотеки SDL3_mixer. Звук будет воспроизводиться по клику мышки по холсту на Desktop и по. . .
SDL3 для Web (WebAssembly): Основы отладки веб-приложений на SDL3 по USB и Wi-Fi, запущенных в браузере мобильных устройств
8Observer8 07.02.2026
Содержание блога Браузер Chrome имеет средства для отладки мобильных веб-приложений по USB. В этой пошаговой инструкции ограничимся работой с консолью. Вывод в консоль - это часть процесса. . .
SDL3 для Web (WebAssembly): Обработчик клика мыши в браузере ПК и касания экрана в браузере на мобильном устройстве
8Observer8 02.02.2026
Содержание блога Для начала пошагово создадим рабочий пример для подготовки к экспериментам в браузере ПК и в браузере мобильного устройства. Потом напишем обработчик клика мыши и обработчик. . .
Философия технологии
iceja 01.02.2026
На мой взгляд у человека в технических проектах остается роль генерального директора. Все остальное нейронки делают уже лучше человека. Они не могут нести предпринимательские риски, не могут. . .
SDL3 для Web (WebAssembly): Вывод текста со шрифтом TTF с помощью SDL3_ttf
8Observer8 01.02.2026
Содержание блога В этой пошаговой инструкции создадим с нуля веб-приложение, которое выводит текст в окне браузера. Запустим на Android на локальном сервере. Загрузим Release на бесплатный. . .
SDL3 для Web (WebAssembly): Сборка C/C++ проекта из консоли
8Observer8 30.01.2026
Содержание блога Если вы откроете примеры для начинающих на официальном репозитории SDL3 в папке: examples, то вы увидите, что все примеры используют следующие четыре обязательные функции, а. . .
SDL3 для Web (WebAssembly): Установка Emscripten SDK (emsdk) и CMake для сборки C и C++ приложений в Wasm
8Observer8 30.01.2026
Содержание блога Для того чтобы скачать Emscripten SDK (emsdk) необходимо сначало скачать и уставить Git: Install for Windows. Следуйте стандартной процедуре установки Git через установщик. . . .
SDL3 для Android: Подключение Box2D v3, физика и отрисовка коллайдеров
8Observer8 29.01.2026
Содержание блога Box2D - это библиотека для 2D физики для анимаций и игр. С её помощью можно определять были ли коллизии между конкретными объектами. Версия v3 была полностью переписана на Си, в. . .
КиберФорум - форум программистов, компьютерный форум, программирование
Powered by vBulletin
Copyright ©2000 - 2026, CyberForum.ru