Linker error unresolved external initvcl referenced from

[Linker Error] Unresolved external '__InitVCL' C++ Builder Решение и ответ на вопрос 628804

1 / 1 / 0

Регистрация: 28.02.2012

Сообщений: 37

1

25.07.2012, 23:13. Показов 10115. Ответов 7


выявляет ошибку при компиляции… Что делать???

__________________
Помощь в написании контрольных, курсовых и дипломных работ, диссертаций здесь



0



1066 / 583 / 87

Регистрация: 03.12.2009

Сообщений: 1,255

25.07.2012, 23:20

2

Цитата
Сообщение от zhoodar93.92.kg
Посмотреть сообщение

выявляет ошибку при компиляции… Что делать???

Вы хоть код скиньте!



0



zhoodar93.92.kg

1 / 1 / 0

Регистрация: 28.02.2012

Сообщений: 37

25.07.2012, 23:22

 [ТС]

3

C++
1
2
3
4
5
6
7
8
9
10
11
12
#include <iostream.h>
int main()
{
int a,b,c; // c=???????
r:
cout << "Vvedite 2 4islan";
cin >>a >>b;
if(a>b) c=a%b;
if(b>a) c=b%a;
if (c==0) cout <<"kratnyi  " <<c<<"n";
if (c!=0) cout <<"nekratnyi " <<c <<"n";
goto r;

1) [Linker Error] Unresolved external ‘__InitVCL’ referenced from C:PROGRAM FILESBORLANDCBUILDER6LIBCP32MTI.LIB|crtlvcl

2) [Linker Error] Unresolved external ‘__ExitVCL’ referenced from C:PROGRAM FILESBORLANDCBUILDER6LIBCP32MTI.LIB|crtlvcl



0



Infinity3000

1066 / 583 / 87

Регистрация: 03.12.2009

Сообщений: 1,255

25.07.2012, 23:28

4

C++
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
//---------------------------------------------------------------------------
 
#include <vcl.h>
#pragma hdrstop
#include <iostream.h>
 
//---------------------------------------------------------------------------
 
#pragma argsused
int main(int argc, char* argv[])
{
        int a,b,c; // c=???????
 r:
        cout << "Vvedite 2 4islan";
        cin >>a >>b;
        if(a > b) c = a % b;
        if(b > a) c = b % a;
        if (c == 0) cout <<"kratnyi " <<c<<"n";
        if (c!=0) cout <<"nekratnyi " <<c <<"n";
        goto r;
        return 0;
}
//---------------------------------------------------------------------------



1



zhoodar93.92.kg

1 / 1 / 0

Регистрация: 28.02.2012

Сообщений: 37

25.07.2012, 23:37

 [ТС]

5

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
#include <iostream> 
using namespace std; 
int main() 
{   
    const int size = 5;
    int array[size] = { 11, 23, 5, 67, 8 }; 
    int i;  
    int max, min; 
    int index_max, index_min;
 
    for ( i = 0; i < size; i++) 
        cout << array[i] << " "; 
    cout << endl;  
 
    max = array[0]; 
    index_max = 0; 
 
    for ( i = 1; i < size; i++)  
        if(max < array[i]) 
        { 
            max = array[i]; 
            index_max = i; 
        } 
 
        min = array[0]; 
        index_min = 0;
 
        for ( i = 1; i < size; i++)  
            if( min > array[i]) 
            { 
                min = array[i]; 
                index_min = i; 
            }  
 
            int temp = array[index_max]; 
            array[index_max] = array[index_min]; 
            array[index_min] = temp; 
 
            for ( i = 0; i < size; i++) 
                cout << array[i] << " "; 
            cout << endl;
}

тут тоже такая же ошибка



0



1066 / 583 / 87

Регистрация: 03.12.2009

Сообщений: 1,255

25.07.2012, 23:42

6

ну посмотрите каким образом была исправленная предыдущая задача, и так же имправте эту!



0



zhoodar93.92.kg

1 / 1 / 0

Регистрация: 28.02.2012

Сообщений: 37

25.07.2012, 23:47

 [ТС]

7

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
#include <vcl.h>
#pragma hdrstop
#include <iostream.h>
 
//---------------------------------------------------------------------------
 
#pragma argsused
using namespace std;
int main() 
{   
    const int size = 5;
    int array[size] = { 11, 23, 5, 67, 8 }; 
    int i;  
    int max, min;
    int index_max, index_min;
 
    for ( i = 0; i < size; i++)
        cout << array[i] << " "; 
    cout << endl;  
 
    max = array[0]; 
    index_max = 0; 
 
    for ( i = 1; i < size; i++)  
        if(max < array[i])
        { 
            max = array[i];
            index_max = i; 
        }
 
        min = array[0];
        index_min = 0;
 
        for ( i = 1; i < size; i++)
            if( min > array[i])
            {
                min = array[i];
                index_min = i;
            }
 
            int temp = array[index_max];
            array[index_max] = array[index_min];
            array[index_min] = temp;
 
            for ( i = 0; i < size; i++)
                cout << array[i] << " ";
            cout << endl;
            return 0;
}

вы библиотеки подключили и return 0; добавили??? А у меня не получается



0



Infinity3000

1066 / 583 / 87

Регистрация: 03.12.2009

Сообщений: 1,255

26.07.2012, 00:00

8

Вполне рабочий код

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
//---------------------------------------------------------------------------
 
#include <vcl.h>
#pragma hdrstop
 #include <iostream.h>
//---------------------------------------------------------------------------
 
#pragma argsused
using namespace std;
int main(int argc, char* argv[])
{
        const int size = 5;
    int array[size] = { 11, 23, 5, 67, 8 };
    int i;
    int max, min;
    int index_max, index_min;
 
    for ( i = 0; i < size; i++)
        cout << array[i] << " ";
    cout << endl;
 
    max = array[0];
    index_max = 0;
 
    for ( i = 1; i < size; i++)
        if(max < array[i])
        {
            max = array[i];
            index_max = i;
        }
 
        min = array[0];
        index_min = 0;
 
        for ( i = 1; i < size; i++)
            if( min > array[i])
            {
                min = array[i];
                index_min = i;
            }
 
            int temp = array[index_max];
            array[index_max] = array[index_min];
            array[index_min] = temp;
 
            for ( i = 0; i < size; i++)
                cout << array[i] << " ";
            cout << endl;
            system("pause >> null");
        return 0;
}
//---------------------------------------------------------------------------

Миниатюры

[Linker Error] Unresolved external '__InitVCL'
 



1



    msm.ru

    Нравится ресурс?

    Помоги проекту!

    [!] Как относитесь к модерированию на этом форуме? Выскажите свое мнение здесь

    >
    Error

    • Подписаться на тему
    • Сообщить другу
    • Скачать/распечатать тему



    Сообщ.
    #1

    ,
    01.08.05, 21:52

      Newbie

      Рейтинг (т): 0

      Я вот пытаюсь компилировать файл .CPP, и всё гут. Но когда начинаю собирать до .exe, то выдаются три ошибки:

      [Linker Error] Unresolved external ‘__ExitVCL’ referenced from C:PROGRAM FILESBORLANDCBUILDER6LIBCP32MTI.LIB|crtlvcl

      [Linker Error] Unresolved external ‘__InitVCL’ referenced from C:PROGRAM FILESBORLANDCBUILDER6LIBCP32MTI.LIB|crtlvcl

      [Linker Error] Unresolved external ‘WinMain’ referenced from C:PROGRAM FILESBORLANDCBUILDER6LIBC0W32.OBJ

      Я не пойму чё это значит

      [FONT=Courier]


      trainer



      Сообщ.
      #2

      ,
      02.08.05, 07:12

        Это значит, что твоя программа не соответствует типу проекта, который ты выбирал при его создании.


        Coala



        Сообщ.
        #3

        ,
        03.08.05, 09:58

          Цитата Sorokin.C++ @ 01.08.05, 21:52

          [Linker Error] Unresolved external ‘__ExitVCL’ referenced from C:PROGRAM FILESBORLANDCBUILDER6LIBCP32MTI.LIB|crtlvcl

          [Linker Error] Unresolved external ‘__InitVCL’ referenced from C:PROGRAM FILESBORLANDCBUILDER6LIBCP32MTI.LIB|crtlvcl

          [Linker Error] Unresolved external ‘WinMain’ referenced from C:PROGRAM FILESBORLANDCBUILDER6LIBC0W32.OBJ

          Я не пойму чё это значит

          Возможно, неподключены некие LIB-файлы

          или сбиты настройки проекта — согласен с trainer

          Сообщение отредактировано: Coala — 03.08.05, 10:00


          C@1m



          Сообщ.
          #4

          ,
          10.08.05, 09:23

            :ph34r: Можно обйти этот весь «бред» очень интересным путём :

            залазишь в Progect->Options->Linker и там ,в св-ве Max errors, ставишь ,например,
            10;

            P.S.-у меня один раз даже сработало !!!!!! :D


            Coala



            Сообщ.
            #5

            ,
            10.08.05, 09:31

              C@1m, что сработало-то, октомпилился бред, который ты запихал в Билдер?
              А как насчет собственно проги, которую ты мастеришь? :ph34r:


              Seva



              Сообщ.
              #6

              ,
              12.08.05, 04:50

                Цитата Coala @ 10.08.05, 09:31

                C@1m, что сработало-то, октомпилился бред, который ты запихал в Билдер?
                А как насчет собственно проги, которую ты мастеришь?

                Это особенная фича Борланда — они с давних пор позволяют откомпилировать программу даже с явными ошибками, я только не знаю, на какие типы ошибок эта особенность распространяется. :)


                Coala



                Сообщ.
                #7

                ,
                12.08.05, 05:00

                  Seva, вопрос вот в чем — а будет ли эта программа работать…и если да, то как… :wall:


                  Seva



                  Сообщ.
                  #8

                  ,
                  12.08.05, 05:43

                    Это было сделано для отладочных целей, если я не ошибаюсь.

                    0 пользователей читают эту тему (0 гостей и 0 скрытых пользователей)

                    0 пользователей:

                    • Предыдущая тема
                    • Borland C++ Builder/Turbo C++ Explorer
                    • Следующая тема

                    Рейтинг@Mail.ru

                    [ Script execution time: 0,0356 ]   [ 16 queries used ]   [ Generated: 12.02.23, 19:03 GMT ]  

                    Conrad


                    • #1

                    При создании консольного приложения с массивами структур, C++ Builder выдаёт сообщения:

                    Unresolved external ‘__InitVCL’ referenced from C:PROGRAM FILESBORLANDCBUILDER6LIBCP32MTI.LIB|crtlvcl
                    Unresolved external ‘__ExitVCL’ referenced from C:PROGRAM FILESBORLANDCBUILDER6LIBCP32MTI.LIB|crtlvcl

                    Компиляция проходит без ошибок.

                    European


                    • #2

                    Ну правильно, создал голое консольное приложение и хочешь использовать внутри него VCL? Так не получится.

                    LAW


                    RainCat


                    vital


                    • #5

                    Не использовать VCL внути готового консольного приложения.

                    RainCat


                    • #6

                    В смысле как это исправить? Я в этом мало что понимаю….Пересмотрела кучу форумов, везде написано одно и тоже: при создании консольного проекта, снимай галочку Use VCL…

                    Но у меня НЕ консольное приложение!

                    А как исправить, если программа УЖЕ НАПИСАНА, уже рабочая…Просто перенесла на другой копьютер и она перестала работать…Пишет:

                    [Linker Error] Unresolved external ‘__InitVCL’ referenced from C:PROGRAM FILESBORLANDCBUILDER6LIBCP32MTI.LIB|crtlvcl
                    [Linker Error] Unresolved external ‘__ExitVCL’ referenced from C:PROGRAM FILESBORLANDCBUILDER6LIBCP32MTI.LIB|crtlvcl
                    [Linker Error] Unresolved external ‘WinMain’ referenced from C:PROGRAM FILESBORLANDCBUILDER6LIBC0W32.OBJ

                    Что делать? Заново-то писать не хочется

                    Добавлено: HELP!!! :what?:

                    Vseslavur


                    • #7

                    Необходимо определить в какой библиотеке или в каком объектнике определены эти функции и прилинковать его к проекту вручную


                    Форум программистов Vingrad

                    Поиск:

                    Ответ в темуСоздание новой темы
                    Создание опроса
                    > [Linker Error] Unresolved external 

                    :(

                       

                    Опции темы

                    Sapfeer
                    Дата 23.12.2006, 01:45 (ссылка)
                    | (нет голосов)
                    Загрузка ... Загрузка …




                    Быстрая цитата

                    Цитата

                    Новичок

                    Профиль
                    Группа: Участник
                    Сообщений: 24
                    Регистрация: 21.12.2005

                    Репутация: нет
                    Всего: нет

                    Облазил весь форум, но так ничего и не нашел… Описание класса занимает два файла: в *.h — сам класс и прототипы методов, в *.cpp — их реализации. При компиляции Builder выдает ошибку:

                    [Linker Error] Unresolved external ‘My_Text::My_Text(int)’ referenced from E:…DERIVED_STRINGUNIT1.OBJ
                    [Linker Error] Unresolved external ‘My_Text::add_string(My_String)’ referenced from E:…DERIVED_STRINGUNIT1.OBJ

                    файл *.h (точнее прототипы неработающих функций)

                    Код

                    #include <string>
                    #include <iostream>
                    #include <conio>

                    ...

                        My_Text(int i);

                        int add_string(My_String str);

                    файл *.cpp (реализации)

                    Код

                    #ifndef DERIVED_STRING_H 
                    #define DERIVED_STRING_H

                    ...

                    My_Text::My_Text(int i)  //конструктор
                      {
                        temp_size=0;
                        size=i;
                        text=new My_String [size];
                      }

                    int My_Text::add_string(My_String str) //метод
                      {
                        if(temp_size==size)
                        {
                          cout <<endl<<"Array Is Out Of Range";
                          getch();
                          return 0;
                        }
                        text[temp_size]=str;
                        temp_size++;

                          return 1;
                      }

                    #endif

                    Примечание. При перенесении реализации в *h.-файл все работает нормально…

                    Это сообщение отредактировал(а) Sapfeer — 23.12.2006, 02:17

                    PM MAIL   Вверх
                    Kuvaldis
                    Дата 23.12.2006, 02:27 (ссылка)
                    | (нет голосов)
                    Загрузка ... Загрузка …




                    Быстрая цитата

                    Цитата

                    механик-вредитель
                    ***

                    Профиль
                    Группа: Участник Клуба
                    Сообщений: 1189
                    Регистрация: 16.6.2006
                    Где: Минск

                    Репутация: нет
                    Всего: 61

                    Sapfeer
                    маловато информации, но все же…
                    имхо, проблема может быть в 
                    #ifndef DERIVED_STRING_H    
                    #define DERIVED_STRING_H
                    вообще-то такие макросы используются для предотвращения повторного включения именно хедер=файлов, а не файлов реализации (как у тебя)

                    А вообще лучше выложи оба файла (или проект), так будет быстрее и нагляднее ошибку найти

                    ———————

                    Помни — когда ты спишь, враг не дремлет
                    Спи чаще и дольше, изматывай врага бессоницей

                    PM MAIL ICQ   Вверх
                    Sapfeer
                    Дата 23.12.2006, 02:29 (ссылка)
                    | (нет голосов)
                    Загрузка ... Загрузка …




                    Быстрая цитата

                    Цитата

                    Новичок

                    Профиль
                    Группа: Участник
                    Сообщений: 24
                    Регистрация: 21.12.2005

                    Репутация: нет
                    Всего: нет

                    Цитата(Kuvaldis)
                    Sapfeer
                    имхо, проблема может быть в 
                    #ifndef DERIVED_STRING_H    
                    #define DERIVED_STRING_H
                    вообще-то такие макросы используются для предотвращения повторного включения именно хедер=файлов, а не файлов реализации (как у тебя)

                    Пробовал менять на обычное включение типа

                    Код

                    #include "Derived_String.h"

                    Но это не помогало.

                    Цитата(Kuvaldis)
                    А вообще лучше выложи оба файла (или проект), так будет быстрее и нагляднее ошибку найти 

                    Пожалуйста:

                    Derived_String.cpp

                    Код

                    #ifndef DERIVED_STRING_H 
                    #define DERIVED_STRING_H

                    //#include "Derived_String.h"

                    bool My_String::Is_Eng()
                      {
                        bool check=true;
                        for(int i=0; i<str.length(); i++)
                          if((str[i]>=65&&str[i]<=90)||(str[i]>=97&&str[i]<=122))
                            check=false;
                          return check;
                      }

                        My_Text::My_Text(int i)
                      {
                        temp_size=0;
                        size=i;
                        text=new My_String [size];
                      }

                      int My_Text::add_string(My_String str)
                      {
                        if(temp_size==size)
                        {
                          cout <<endl<<"Array Is Out Of Range";
                          getch();
                          return 0;
                        }
                        text[temp_size]=str;
                        temp_size++;

                          return 1;
                      }

                    #endif

                    Derived_String.h

                    Код

                    #include <string>
                    #include <iostream>
                    #include <conio>

                    using namespace std;

                    class My_String
                    {
                      string str;

                        public:

                          void set_string() {cin >>str;}
                        void set_string(AnsiString ans_str) {str=ans_str.c_str();}

                            string get_string() {return str;}

                            void show() {cout <<str;}

                            bool Is_Eng();
                    };

                    class My_Text: My_String
                    {
                      int size;
                      int temp_size;
                      My_String *text;

                      public:

                        My_Text() {temp_size=size=0;}
                        My_Text(int i);

                        int add_string(My_String str);

                        My_String operator[](int i) {return text[i];}
                    };

                    Это сообщение отредактировал(а) Sapfeer — 23.12.2006, 02:34

                    PM MAIL   Вверх
                    Kuvaldis
                    Дата 23.12.2006, 02:58 (ссылка)
                    | (нет голосов)
                    Загрузка ... Загрузка …




                    Быстрая цитата

                    Цитата

                    механик-вредитель
                    ***

                    Профиль
                    Группа: Участник Клуба
                    Сообщений: 1189
                    Регистрация: 16.6.2006
                    Где: Минск

                    Репутация: нет
                    Всего: 61

                    Sapfeer
                    Компиляцию прошло

                    *.h 

                    Код

                    //---------------------------------------------------------------------------
                    #ifndef Derived_StringH
                    #define Derived_StringH
                    //---------------------------------------------------------------------------
                    #include <string>    
                    #include <iostream>    
                    #include <conio.h>
                    #include <vcl.h>  // for AnsiString
                    using namespace std;
                    //---------------------------------------------------------------------------
                    class My_String    
                    {    
                      private:
                           string str;

                                                             public:

                           void set_string() {cin >> str;}

                           void set_string(AnsiString ans_str) {str=ans_str.c_str();}

                                string get_string() {return str;}

                           void show() {cout <<str;}
                           bool Is_Eng();
                    };    
                    class My_Text: My_String    
                    {    
                      int size;    
                      int temp_size;    
                      My_String *text;    
                      public:    
                        My_Text() {temp_size=size=0;}    
                        My_Text(int i);    
                        int add_string(My_String str);    
                        My_String operator[](int i) {return text[i];}    
                    };
                    //---------------------------------------------------------------------------
                    #endif

                    Реализация

                    Код

                    //----------------------------------------------------------------------
                    #include "Derived_String.h"
                    //----------------------------------------------------------------------
                    bool My_String::Is_Eng()    
                      {    
                        bool check=true;    
                        for(int i=0; i<str.length(); i++)    
                          if((str[i]>=65&&str[i]<=90)||(str[i]>=97&&str[i]<=122))    
                            check=false;    
                          return check;    
                      }    

                          My_Text::My_Text(int i)    
                      {    
                        temp_size=0;    
                        size=i;    
                        text=new My_String [size];    
                      }    

                        int My_Text::add_string(My_String str)    
                      {    
                        if(temp_size==size)    
                        {    
                          cout <<endl<<"Array Is Out Of Range";    
                          getch();    
                          return 0;    
                        }    
                        text[temp_size]=str;    
                        temp_size++;    

                            return 1;    
                      }
                    //----------------------------------------------------------------------

                    ———————

                    Помни — когда ты спишь, враг не дремлет
                    Спи чаще и дольше, изматывай врага бессоницей

                    PM MAIL ICQ   Вверх
                    Sapfeer
                    Дата 23.12.2006, 03:19 (ссылка)
                    | (нет голосов)
                    Загрузка ... Загрузка …




                    Быстрая цитата

                    Цитата

                    Новичок

                    Профиль
                    Группа: Участник
                    Сообщений: 24
                    Регистрация: 21.12.2005

                    Репутация: нет
                    Всего: нет

                    Скопировал, вставил, сохранил, запустил…

                    Теперь с этими файлами вроде проблем нету… Но Builder в упор не хочет работать!

                    [Linker Error] Unresolved external ‘__InitVCL’ referenced from C:PROGRAM FILESBORLANDCBUILDER6LIBCP32MTI.LIB|crtlvcl
                    [Linker Error] Unresolved external ‘__ExitVCL’ referenced from C:PROGRAM FILESBORLANDCBUILDER6LIBCP32MTI.LIB|crtlvcl
                    [Linker Error] Unresolved external ‘_main’ referenced from C:PROGRAM FILESBORLANDCBUILDER6LIBC0X32.OBJ

                    Я думаю тут проблема в среде — нужно переустановить…

                    PM MAIL   Вверх
                    Partizan
                    Дата 23.12.2006, 18:54 (ссылка)
                    | (нет голосов)
                    Загрузка ... Загрузка …




                    Быстрая цитата

                    Цитата

                    Let’s do some .NET
                    ****

                    Профиль
                    Группа: Модератор
                    Сообщений: 2828
                    Регистрация: 19.12.2005
                    Где: Санкт-Петербург

                    Репутация: 7
                    Всего: 67

                    а ты консольный проект создавать не пробовал?

                    ———————

                    СУВ,
                           Partizan.

                    PM MAIL WWW ICQ Skype GTalk Jabber   Вверх
                    Sapfeer
                    Дата 23.12.2006, 19:15 (ссылка)
                    | (нет голосов)
                    Загрузка ... Загрузка …




                    Быстрая цитата

                    Цитата

                    Новичок

                    Профиль
                    Группа: Участник
                    Сообщений: 24
                    Регистрация: 21.12.2005

                    Репутация: нет
                    Всего: нет

                    Цитата(Partizan)
                    а ты консольный проект создавать не пробовал?

                    В консольном проекте программа вылетает так ничего и не сделав, хотя должна

                    Код

                    //---------------------------------------------------------------------------

                    #include <vcl.h>
                    #include <conio>

                    #include "Derived_String.h";

                    #pragma hdrstop

                    using namespace std;
                    //---------------------------------------------------------------------------

                    #pragma argsused
                    void main()
                    {
                      My_String Str_01;

                      cout <<"Enter string: ";
                      Str_01.set_string();

                       cout<<"Str_01: "<<Str_01.get_string();

                      My_Text Text_01(2);

                      Text_01.add_string(Str_01);

                      cout <<endl<<"Text_01[0]: ";
                      Text_01[0].show();

                      getch();
                      cout <<"End";
                      getch();
                    }
                    //---------------------------------------------------------------------------

                    PM MAIL   Вверх
                    Anikmar
                    Дата 23.12.2006, 22:25 (ссылка)
                    | (нет голосов)
                    Загрузка ... Загрузка …




                    Быстрая цитата

                    Цитата

                    Эксперт
                    ****

                    Профиль
                    Группа: Завсегдатай
                    Сообщений: 2513
                    Регистрация: 26.11.2006
                    Где: Санкт-Петербург

                    Репутация: 34
                    Всего: 59

                    Если вылетает ничего не сделав, то на какой строке? Что говорит отладчик?

                    PM MAIL ICQ   Вверх
                    Partizan
                    Дата 24.12.2006, 16:31 (ссылка)
                    | (нет голосов)
                    Загрузка ... Загрузка …




                    Быстрая цитата

                    Цитата

                    Let’s do some .NET
                    ****

                    Профиль
                    Группа: Модератор
                    Сообщений: 2828
                    Регистрация: 19.12.2005
                    Где: Санкт-Петербург

                    Репутация: 7
                    Всего: 67

                    vcl.h убери…нафиг он тебе нужен в консольном проекте?

                    ———————

                    СУВ,
                           Partizan.

                    PM MAIL WWW ICQ Skype GTalk Jabber   Вверх



















                    Ответ в темуСоздание новой темы
                    Создание опроса
                    Правила форума «С++ Builder»
                    Rrader

                    Запрещается!

                    1. Публиковать ссылки на вскрытые компоненты

                    2. Обсуждать взлом компонентов и делиться вскрытыми компонентами

                    • Литературу по С++ Builder обсуждаем здесь
                    • Действия модераторов можно обсудить здесь
                    • С просьбами о написании курсовой, реферата и т.п. обращаться сюда
                    • Настоятельно рекомендуем заглянуть в DRKB (Delphi Russian Knowledge Base) — крупнейший в рунете сборник материалов по Дельфи

                    • FAQ раздела лежит здесь!

                    Если Вам понравилась атмосфера форума, заходите к нам чаще! С уважением, Rrader.

                     

                    0 Пользователей читают эту тему (0 Гостей и 0 Скрытых Пользователей)
                    0 Пользователей:
                    « Предыдущая тема | C++ Builder | Следующая тема »

                    Unresolved external

                    The unresolved external in your case, seems to be because the compiler is unable to find the path to the package data. You should find out if:

                    • The path exists in the compiler search path list.
                    • The package exists in the default package directory.

                    If one of them is true then the path isn’t the problem. However as Riho also mentions this is the most likely cause for the problem. The Embarcadero documentation wiki states the following about the unresolved external error:

                    The named symbol is referenced in the given module but is not defined anywhere in the set of object files and libraries included in the link. Check to make sure the symbol is spelled correctly.

                    You will usually see this error from the linker for C or C++ symbols if any of the following occur:

                    • You did not properly match a symbol’s declarations of __pascal and __cdecl types in different source files.
                    • You have omitted the name of an object file your program needs. You need to manually add all required packages to the Requires list.
                    • You did not link in the emulation library.

                    If you are linking C++ code with C modules, you might have forgotten to wrap C external declarations in extern “C”.

                    You could also have a case mismatch between two symbols.

                    Source: Unresolved external ‘symbol’ referenced from ‘module’.

                    Since it seems from the — although altered class names — it is not the case of a misspelling. You also state that you have added the package to the requires list so we rule out this as well. Since you are not linking to C modules we can omit that part as well. So it points to problems with the directory.

                    About the other questions

                    Your questions are all really interesting and many of the questions are questions I my self has been looking for answers for when I started developing packages and components for C++ Builder.

                    Are packages reliable using C++?

                    Packages are a fine solution to use for C++ Builder, Both C++ Builder is built to support packages and the Pascal written VCL framework. This means that certain implementations are different in C++ Builder than other compilers. This is a necessity to keep the language compatible with its Delphi sibling. For this reason you can use packages in C++ Builder almost as easily as if using Delphi.

                    Is linking to the first package by adding a reference to its BPI correct?

                    To start with the second part of your question here, using a lib file makes your package larger simply because it is using static linking — so your guess is correct. Now back to the first part of the question, linking to a package is fine by adding a reference to its BPI. But you do need to make sure that the path variable has been set correctly as Riho suggests in his answer.

                    Personally I always make sure to my packages to the proper directories in your users folder, the location of this is depending on your Delphi version and operating system version. As far as I recall it is under the Document and Settingsall usersshared documentsRad studio(version number)Packages but I could be mistaken about that.

                    Can we use the PACKAGE directive only on TObject-derived classes?

                    The PACKAGE macro is resolved into __declspec(package), you can compare it to __declspec(dllexport). The difference between these is that package is used when declared in a package, and dllexport is used when declared in a DLL. There is a topic about this on the official embarcadero forums titled __declspec(package) vs __declspec(dllexport). The author of the original post, also asks your exact question about this, but unfortunately that part of the question is unanswered.

                    I have a theory however, and I must emphasize that it is nothing more than a theory. Remy Lebeau writes as a response to the question in the forum post:

                    __declspec(dllexport) can be used for plain functions, data variables, and
                    non-VCL classes, and can be used in plain DLLs. __declspec(package) is
                    used for VCL components, and can only be used with packages.

                    So from reading his response it seems to me that package is simply exporting the class, just like dllexport does. And since dllexport as far as I can read from his response is to be used in plain DLLs only you have to use the package for exporting (even) non VCL classes from a package.

                    What is interesting about all this, is that a package is essentially a DLL as far as I recall, but I must admit I can’t find or remember the source of that information so take with a grain of salt.

                    Is splitting code into packages the best way to achieve the goal of isolating code?

                    Packages have some very prominent strengths when creating reusable components for the VCL. Obviously using packages limits the user to use either C++Builder or Delphi, but for components written to take advantage of the VCL framework it’s an excellent choice. Properly written packages can ease the reusability of components, and I believe it is the preferred method of distributing components for the VCL.

                    However if your code does not take advantage of the VCL framework in any way, I would consider using an ordinary library, either static or dynamic, simply to create a more cross compiler friendly approach.

                    Whether there are any better approach to isolating your code, really depends on the project you are working on. I like to keep code that communicates through use of VCL classes in packages, but code that does not require use of any VCL classes in regular libraries. Keep in mind though that you can easily use VCL classes in a DLL but you need to handle special cases if you choose to export functions with VCL String classes as parameters or return values.

                    Any general words of advice?

                    I’m not the most experienced developer of packages myself, but I have found that disabling runtime linking often solves a lot of my problems, while it is somewhat trivial to fix any problems for your own code, you can often run into 3rd party components that have trouble dealing with this. Having said that, I’m not a fan of distributing my packages along with my application as is required in this case. But to be honest that is a matter of taste.

                    Personally I found it difficult to find some proper answers to many of my questions, when I started creating components and packages. The official helpfile is not the most informative on the matter, but looking through the VCL source code, will often give you the best answer to your question. Besides there is a few other websites that can provide help, many of the sites are targeting Delphi though, but this you have to get used to though.

                    Delphi Wikia has some good articles about creating components, in particular Creating Components and Creating Packages There is also BCB Journal which is one of the few C++ Builder specific sites, it has some fine articles and an acceptable forum. The Delphi pages at About.com is also a good source of information, I’ve found lots of good hints and nice to knows there, in particular: Creating Custom Delphi Components — Inside and Out.

                    Понравилась статья? Поделить с друзьями:

                    Читайте также:

                  • Mongodb ошибка 1067
                  • Link2ea sims 4 ошибка
                  • Mongodb ошибка 1053
                  • Lineage 2 как изменить внешность
                  • Moneyman как изменить номер телефона

                  • 0 0 голоса
                    Рейтинг статьи
                    Подписаться
                    Уведомить о
                    guest

                    0 комментариев
                    Старые
                    Новые Популярные
                    Межтекстовые Отзывы
                    Посмотреть все комментарии