Форум программистов, компьютерный форум, киберфорум
C++ Builder
Войти
Регистрация
Восстановить пароль
Блоги Сообщество Поиск Заказать работу  
 
Рейтинг 4.83/6: Рейтинг темы: голосов - 6, средняя оценка - 4.83
1 / 1 / 2
Регистрация: 08.12.2015
Сообщений: 24

Unresolved External. (XE2)

29.01.2016, 00:40. Показов 1165. Ответов 1
Метки нет (Все метки)

Студворк — интернет-сервис помощи студентам
Здравствуйте! Помогите найти ошибку в коде!

При запуске программы в режиме debug ошибок не было. Решил делать release, и тут понеслось... Выдал 15 ошибок. Все поправил, осталась последняя.

[ILINK32 Error] Error: Unresolved external '__fastcall Vcl::Grids::TInplaceEditList::PaintWindo w(void *)' referenced from C:\ESOIL\RELEASE_BUILD\DATAUNIT.OBJ

Стал думать. Единственное место, где упоминается TInplaceEditList - это .h файл одного из модулей.

Вот этот .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
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
#ifndef DataUnitH
#define DataUnitH
//---------------------------------------------------------------------------
#include <Classes.hpp>
#include <Controls.hpp>
#include <StdCtrls.hpp>
#include <Forms.hpp>
#include <Grids.hpp>
 
#include <tchar.h>
#include <Math.hpp>
//---------------------------------------------------------------------------
#include "GeoUnit.h"
#include "SlopeUnit.h"
#include <Vcl.Dialogs.hpp>
//---------------------------------------------------------------------------
namespace SG_ComboBoxes
{
//---------------------------------------------------------------------------
    class TMyInplaceEdit : public Grids::TInplaceEditList
    {
    public:
    //-----------------------------------------------------------------------
        __fastcall virtual TMyInplaceEdit(TComponent* AOwner)
            : TInplaceEditList(AOwner)
        {
        }
    //-----------------------------------------------------------------------
    protected:
    //-----------------------------------------------------------------------
    //--------Описание события При нажатии на кнопку-------------------------
        DYNAMIC void __fastcall KeyDown(System::Word &Key,
            System::Classes::TShiftState Shift)
        {
            TStringGrid *grid = static_cast<TStringGrid*>(Parent);
            if (Key == VK_RETURN)
            {
                if (grid->Row < grid->RowCount - 1)
                    grid->Row += 1;
                else if (grid->Col < grid->ColCount - 1)
                {
                    grid->Col += 1;
                    grid->Row = grid->FixedRows;
                }
            }
            TInplaceEdit::KeyDown(Key, Shift);
        }
    };
    //-----------------------------------------------------------------------
//---------------------------------------------------------------------------
    class TStringGrid : public Grids::TStringGrid
    {
    private:
    //-----------------------------------------------------------------------
        void __fastcall ColWidth(int ACol)
        {
            int max = 15;
            for (int row = 0; row < RowCount; row++)
                max = Max(max, Canvas->TextWidth(Cells[ACol][row]));
            ColWidths[ACol] = max + 6;
        }
    //-----------------------------------------------------------------------
        __fastcall void GetCbxItems(int ACol, int ARow, TStrings *Items)
        {
            Items->Clear();
            switch (Tag)
            {
            case 1:
                switch (ACol)
                {
                case 2:
                    for(int i = 1; i <= GetTableCount(); i++) Items->Add(IntToStr(i));
                    break;
                case 8:
                    Items->CommaText = L" "без откосов" "с двух сторон" "с четырёх сторон" ";
                }
            break;
            case 2:
                switch (ACol)
                {
                case 1:
                    Items->CommaText =
                    L"Почвенный,Насыпной,Песок,Супесь,Суглинок,Глина,Ил,Торф,"
                    L"Лёсс,Опока,Гипс,Сланец,Трепел,Аргиллит,Алевролит,Мергель,"
                    L"Известняк";
                break;
                case 4:
                    Items->CommaText = L"I,II,III,IV,V,VI";
                break;
                case 5:
                    Items->CommaText = L"I,II,III,IV,V,VI,VII";
                break;
                case 6:
                    Items->CommaText = L"сухой,мокрый";
                }
            }
 
        }
    //-----------------------------------------------------------------------
 
    protected:
    //-----------------------------------------------------------------------
        virtual TInplaceEdit* __fastcall CreateEditor(void)
        {
            TInplaceEditList *inplace = new TMyInplaceEdit(this);
            inplace->DropDownRows = 5;
            inplace->OnGetPickListitems = GetCbxItems;
            return inplace;
        }
    //-----------------------------------------------------------------------
        DYNAMIC void __fastcall DoExit(void)
        {
            TGridRect Rect;
            Rect.Top = -1;
            Rect.Left = -1;
            Rect.Right = -1;
            Rect.Bottom = -1;
            Selection = Rect;
        }
    //-----------------------------------------------------------------------
        DYNAMIC TEditStyle __fastcall GetEditStyle(int ACol, int ARow)
        {
            switch (Tag)
            {
                case 1:
                {
                    switch (ACol)
                    {
                    case 2:
                    case 8:
                    return esPickList;
                    }
                    return esSimple;
                }
 
                case 2:
                {
                    switch (ACol)
                    {
                    case 1:
                    case 4:
                    case 5:
                    case 6:
                    return esPickList;
                    }
                    return esSimple;
                }
            }
 
            return esSimple;
        }
    //-----------------------------------------------------------------------
    //--------Описание события DrawCell--------------------------------------
        virtual void __fastcall DrawCell(int ACol, int ARow,
            const System::Types::TRect &ARect, TGridDrawState AState)
        {
 
            if (AState.Contains(gdFixed))
            {
                Canvas->Brush->Color = clGradientInactiveCaption;
                Canvas->Font->Style = TFontStyles();
                Canvas->Font->Color = clBlack;
            }
            else if (AState.Contains(gdSelected))
            {
                Canvas->Brush->Color = 0x00940A4B;
                Canvas->Font->Style = TFontStyles() << fsBold;
                Canvas->Font->Color = clHighlightText;
            }
            else
            {
                Canvas->Brush->Color = 0x00FFFFFF;
                Canvas->Font->Style = TFontStyles();
                Canvas->Font->Color = clWindowText;
            }
 
            Canvas->FillRect(ARect);
            TRect R(ARect);
            unsigned Format = DT_CENTER;
            OffsetRect(R, 2, 2);
            AnsiString s = Cells[ACol][ARow];
            DrawText(Canvas->Handle, AnsiString(s).c_str(), s.Length(), &R, Format);
        }
    //-----------------------------------------------------------------------
 
    public:
    //-----------------------------------------------------------------------
        __fastcall virtual TStringGrid(Classes::TComponent* AOwner)
            : Grids::TStringGrid(AOwner)
        {
        }
    //-----------------------------------------------------------------------
        void AllColWid()
        {
            for (int col = 0; col < ColCount; col++)
                ColWidth(col);
        }
    //-----------------------------------------------------------------------
    };
}
//---------------------------------------------------------------------------
#define TStringGrid SG_ComboBoxes::TStringGrid
 
class TDataInput : public TForm
{
__published:    // IDE-managed Components
        TStringGrid *StringGrid1;
        TButton *Button1;
        TButton *Button2;
        TButton *Button3;
    TButton *Button4;
    TButton *Button5;
    TButton *Button6;
    TButton *Button7;
    TStringGrid *MC;
    TSaveDialog *SaveDialog1;
    TButton *Save;
    TOpenDialog *OpenDialog1;
    TButton *Load;
        void __fastcall Button1Click(TObject *Sender);
        void __fastcall Button2Click(TObject *Sender);
        void __fastcall Button3Click(TObject *Sender);
    void __fastcall FormCreate(TObject *Sender);
    void __fastcall Button4Click(TObject *Sender);
    void __fastcall Button5Click(TObject *Sender);
    void __fastcall Button6Click(TObject *Sender);
    void __fastcall Button7Click(TObject *Sender);
    void __fastcall FormClose(TObject *Sender, TCloseAction &Action);
    void __fastcall StringGrid1KeyDown(TObject *Sender, WORD &Key, TShiftState Shift);
    void __fastcall SaveClick(TObject *Sender);
    void __fastcall LoadClick(TObject *Sender);
 
 
private:    // User declarations
public:     // User declarations
        __fastcall TDataInput(TComponent* Owner);
        void __fastcall hooku(tagMSG& fr,bool& re);
        //int cl, rw;
};
//---------------------------------------------------------------------------
extern PACKAGE TDataInput *DataInput;
//---------------------------------------------------------------------------
#endif
Не подскажете, из-за чего возникает ошибка?

P.S.
volvo, не посмотришь? Ты - автор это кода...
0
Programming
Эксперт
39485 / 9562 / 3019
Регистрация: 12.04.2006
Сообщений: 41,671
Блог
29.01.2016, 00:40
Ответы с готовыми решениями:

Unresolved external
Доброго времени суток. Такая вот байда получается...Суть вот в чем: По заданию преподавателя необходимо было реализовать динамическую...

Unresolved external
Проблема следующая: класс &quot;die&quot; хранится отдельным файлом. .h: #ifndef butsH #define butsH class die{ private: int left; ...

Unresolved external
Builder 2010 Error: Unresolved external '__fastcall System::TObject::NewInstance(System::TMetaClass *)' referenced from...

1
1 / 1 / 2
Регистрация: 08.12.2015
Сообщений: 24
30.01.2016, 18:32  [ТС]
Вот, нашёл информацию об этой проблеме.

Кликните здесь для просмотра всего текста
To verify the problem, find the hpp file where PaintWindow is declared
(I'd say Grids.hpp) and look at the definition of the first parameter.
If I'm correct, it should be a void* (or something that resolves to a void*)
Now, if you open Grids.pas in the source directory, you'll see that
PaintWindow has a first parameter of type HDC.
The hpp file is generated from the pas file and you shouldn't modify it
under any circumstance.
It seems that HDC is output as a void* by the hpp generator, while HDC
actually simply is a long (32 bits) and is output as such in the obj
file. Thus the problem you get.
One solution may be to edit the hpp file and replace void* by long, but
I don't recommend doing this as this change will have to be done on
every installation of C++ Builder.
Another solution, a bit dirty, but more portable, would be to declare
your own TInplaceEditList class in a separate header file. This
declaration would be a complete copy of the one in Grids.hpp, but would
include the correction. You would have to include your own file instead
of grids.hpp but still use #pragma link "grids". This is the way I would
explore anyway.


А вот таким путём проблема была решена:

C++
1
2
3
4
void __fastcall TMyInPlaceEditList::PaintWindow(HDC DC)
{
inherited::PaintWindow(DC);
}
Только я не понял, куда конкретно вставить этот код?

Добавлено через 30 минут
Покопался ещё.

Эх, почему же я такой тупой...

В настройках для релиза нужно сделать то же самое, что и для дебага.

volvo
Project->Options, на закладке Directories and Conditionals переключить _TCHAR maps to в позицию wchar_t. Там же в строке Conditional defines добавить STRICT
Проблема решена.
0
Надоела реклама? Зарегистрируйтесь и она исчезнет полностью.
inter-admin
Эксперт
29715 / 6470 / 2152
Регистрация: 06.03.2009
Сообщений: 28,500
Блог
30.01.2016, 18:32
Помогаю со студенческими работами здесь

---Unresolved external---
Доброго времени суток! Я тут писал прогу(ну эт понятно),запустил, понял, что не правильно поставил FormStyle. Программа Не отвечает!...

Unresolved external __fastcall
Было у меня несколько таймеров на форме, к каждому таймеру был привязан какойто код. Таймеры я удалил, код тоже. (Странно, что он не...

unresolved external и .lib
Здравствуйте. Пытаюсь подключить libtheoraplayer к своему проекту на C++ Builder 2010. Он (плеер) состоит из нескольких заголовочных...

Ошибка Unresolved external
Unresolved external &quot;Tform1::&quot; referenced from D://... (путь...) Добавлено через 1 минуту Код(Unit.cpp): ...

Unresolved external '.....' referenced from....
Ух... сразу скажу, поиск юзал =) всё читал...ответы есть..но ничего из предложенного не помогло. Сами ошибки полностью так: Unresolved...


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

Или воспользуйтесь поиском по форуму:
2
Ответ Создать тему
Новые блоги и статьи
Загрузка PNG с альфа-каналом на SDL3 для Android: с помощью SDL_LoadPNG (без SDL3_image)
8Observer8 28.01.2026
Содержание блога SDL3 имеет собственные средства для загрузки и отображения PNG-файлов с альфа-каналом и базовой работы с ними. В этой инструкции используется функция SDL_LoadPNG(), которая. . .
Загрузка PNG с альфа-каналом на SDL3 для Android: с помощью SDL3_image
8Observer8 27.01.2026
Содержание блога SDL3_image - это библиотека для загрузки и работы с изображениями. Эта пошаговая инструкция покажет, как загрузить и вывести на экран смартфона картинку с альфа-каналом, то есть с. . .
влияние грибов на сукцессию
anaschu 26.01.2026
Бифуркационные изменения массы гриба происходят тогда, когда мы уменьшаем массу компоста в 10 раз, а скорость прироста биомассы уменьшаем в три раза. Скорость прироста биомассы может уменьшаться за. . .
Воспроизведение звукового файла с помощью SDL3_mixer при касании экрана Android
8Observer8 26.01.2026
Содержание блога SDL3_mixer - это библиотека я для воспроизведения аудио. В отличие от инструкции по добавлению текста код по проигрыванию звука уже содержится в шаблоне примера. Нужно только. . .
Установка Android SDK, NDK, JDK, CMake и т.д.
8Observer8 25.01.2026
Содержание блога Перейдите по ссылке: https:/ / developer. android. com/ studio и в самом низу страницы кликните по архиву "commandlinetools-win-xxxxxx_latest. zip" Извлеките архив и вы увидите. . .
Вывод текста со шрифтом TTF на Android с помощью библиотеки SDL3_ttf
8Observer8 25.01.2026
Содержание блога Если у вас не установлены Android SDK, NDK, JDK, и т. д. то сделайте это по следующей инструкции: Установка Android SDK, NDK, JDK, CMake и т. д. Сборка примера Скачайте. . .
Использование SDL3-callbacks вместо функции main() на Android, Desktop и WebAssembly
8Observer8 24.01.2026
Содержание блога Если вы откроете примеры для начинающих на официальном репозитории SDL3 в папке: examples, то вы увидите, что все примеры используют следующие четыре обязательные функции, а. . .
моя боль
iceja 24.01.2026
Выложила интерполяцию кубическими сплайнами www. iceja. net REST сервисы временно не работают, только через Web. Написала за 56 рабочих часов этот сайт с нуля. При помощи perplexity. ai PRO , при. . .
КиберФорум - форум программистов, компьютерный форум, программирование
Powered by vBulletin
Copyright ©2000 - 2026, CyberForum.ru