Меню

Ошибка средств компоновщика lnk1120

Reee

21 / 21 / 7

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

Сообщений: 65

1

12.10.2010, 15:02. Показов 45830. Ответов 12

Метки нет (Все метки)


Поскажите где ошибка?

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
#include<iostream>
using namespace std;
 
 
int main()
{
    for(;;)
    {
    char* III1="S";
    char* III2="D";
    char* III3="F";
    char* III4="G";
    char* III5="H";
    int a=0;
    cin>>a;
    switch(a)
    {
    case 1 : cout<<III1<<endl;
        break;
    case 2 : cout<<III2<<endl;
        break;
    case 3 : cout<<III3<<endl;
        break;
    case 4 : cout<<III4<<endl;
        break;
    case 5 : cout<<III5<<endl;
        break;
    }
    cout<<"Продолжить?"<<endl;
    char vvod;
    cin>>vvod;
    if(vvod=='y'||vvod=='Y')
        break;
    else
        cout<<"Вы продолжили..."<<endl;
    }
    return 0;
}

1>LINK : error LNK2001: неразрешенный внешний символ «_mainCRTStartup»
1>D:2010 profesional45165Debug45165.exe : fatal error LNK1120: 1 неразрешенных внешних элементов
1>
1>СБОЙ построения.

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



0



dihlofos

Бродяга

314 / 268 / 56

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

Сообщений: 553

12.10.2010, 15:04

2

Может из-за этого:

C++
1
cout<<"Продолжить?"<<endl;



0



21 / 21 / 7

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

Сообщений: 65

12.10.2010, 15:06

 [ТС]

3

Не… не это.



0



70 / 44 / 9

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

Сообщений: 140

12.10.2010, 15:11

4

В коде грубых ошибок (логика не имеется ввиду=) ) нет, компилируется и даже практически работает. Смотрите в сторону настроек линковщика.



0



asics

Freelance

Эксперт С++

2887 / 1822 / 356

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

Сообщений: 3,841

12.10.2010, 15:43

5

Разве не так надо писать ?

C++
1
char* III1='S';



0



Эксперт С++

5052 / 3113 / 271

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

Сообщений: 7,045

12.10.2010, 15:55

6

Нет, так вы инициализируете указатель символом S, это ошибка. А так указатель будет указывать на строку «S», которая к тому же имеет нуль-терминатор в конце.



0



21 / 21 / 7

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

Сообщений: 65

12.10.2010, 16:41

 [ТС]

7

Цитата
Сообщение от Юрий АЛексеевич
Посмотреть сообщение

В коде грубых ошибок (логика не имеется ввиду=) ) нет, компилируется и даже практически работает. Смотрите в сторону настроек линковщика.

А если я там ничево не трогал?Гдет ниделю назад всё было нормально, а щас вот так.(Тоесть программой ваще не пользовался.)

Добавлено через 30 минут
Что могло сбится в настройках Microsoft Visual Studio 2010?
Так как мой пример норм работает в Microsoft Visual C++ 2008 Express Edition.



0



1562 / 1040 / 94

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

Сообщений: 2,995

12.10.2010, 18:06

8

Какая то lib не подключена, где описывается _mainCRTStartup



0



Freelance

Эксперт С++

2887 / 1822 / 356

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

Сообщений: 3,841

12.10.2010, 18:41

9

Запишы ето /entry:»mainCRTStartup в проектсвойствакомпоновщиккомандная строкадопольнителние опции



1



2 / 2 / 1

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

Сообщений: 10

12.10.2010, 20:48

10

у меня была такая проблема, и дело было вот в чем. Студия (у меня 2010) по умолчанию вместо main юзает _tmain (для конс.прил.) попробуйте создать мастером проэкт, с готовым заголовком, и посмотрите как там называеться мэйн.



0



Freelance

Эксперт С++

2887 / 1822 / 356

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

Сообщений: 3,841

12.10.2010, 20:53

11

Tim0xAA, не только MSVS10 юзает по дефу _tmain,и вопше дело не в етом,в студии можно щитать что main ето синоним слова _tmain.



0



Эксперт JavaЭксперт С++

8376 / 3598 / 419

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

Сообщений: 10,708

13.10.2010, 14:20

12

Clean, а потом Rebuild Solution



0



бжни

2473 / 1684 / 135

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

Сообщений: 7,162

13.10.2010, 16:20

13

в Linker/System/Subsystem должно быть Console (/SUBSYSTEM:CONSOLE) или Not Set



1



Дан код GitHub
При попытке компиляции выдает это

1>------ Build started: Project: SimpleLang, Configuration: Debug Win32 ------
1>  Parser.cpp
1>MSVCRTD.lib(crtexe.obj) : error LNK2019: unresolved external symbol _main referenced in function ___tmainCRTStartup
1>C:UsersDanielDocumentsGitHubSimpleLangDebugSimpleLang.exe : fatal error LNK1120: 1 unresolved externals
2>------ Build started: Project: Tests, Configuration: Debug Win32 ------
2>  Parser_GetType.cpp
2>Parser_GetType.obj : error LNK2019: unresolved external symbol "public: static class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > __cdecl Parser::GetType(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >)" (?GetType@Parser@@SA?AV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@V23@@Z) referenced in function "private: virtual void __thiscall ParserTest_identifer_Test::TestBody(void)" (?TestBody@ParserTest_identifer_Test@@EAEXXZ)
2>C:UsersDanielDocumentsGitHubSimpleLangDebugTests.exe : fatal error LNK1120: 1 unresolved externals
========== Build: 0 succeeded, 2 failed, 1 up-to-date, 0 skipped ==========

#include<iostream>
#include<string>
using namespace std;
struct Train
{
    string final_destination;
    int number_train;
    int t_hour;
    int t_minute;
};
template<typename T>
class Tmain
{
protected:
    T*mas;
    int n;
public:
    Tmain()
    {
        mas = NULL;
        n = 0;
    }
    Tmain(int n)
    {
        this->n = n;
        mas = NULL;
    }
    Tmain(const Tmain& obj)
    {
        if (this == &obj)return;
        n = obj.n;
        for (int i = 0; i < n; i++)
            mas[i] = obj.mas[i];
    }
    virtual ~Tmain()
    {
        if (mas) delete[]mas;
        mas = NULL;
        n = 0;
    }
    virtual void set() = 0;
    virtual void get() = 0;
};
istream&operator>>(istream& in, Train& train);
ostream&operator<<(ostream& out, const Train& train)
{
    out << "Final destination: " << train.final_destination << endl;
    out << "Number of train: " << train.number_train << endl;
    out << "Time: " << train.t_hour << ":" << train.t_minute << endl;
    return out;
}
class TTrain :public Tmain<Train>
{
public:
    TTrain() :Tmain<Train>(){};
    TTrain(int n) :Tmain<Train>(n){};
    TTrain(const TTrain& obj) :Tmain<Train>(obj){};
    void set() override
    {
        cout << "Input info for " << n << " trains" << endl;
        for (int i = 0; i < n; i++)
            cin >> mas[i];
    }
    void get() override
    {
        for (int i = 0; i < n; i++)
        {
            cout << "Train #" << i << endl;
            cout << mas[i];
        }
    }
    void addTrain(string final_destination, int number_train, int t_hour, int t_minute)
    {
        Train *arr = new Train[n + 1];
        for (int i = 0; i < n; i++)
            arr[i] = mas[i];
        arr[n].final_destination = final_destination;
        arr[n].number_train = number_train;
        arr[n].t_hour = t_hour;
        arr[n].t_minute = t_minute;
        delete[]mas;
        mas = arr;
        n++;
    }
    void getTrains(int t_hour, int t_minute)
    {
        for (int i = 0; i < n; i++)
        {
            if (mas[i].t_hour > t_hour || (mas[i].t_hour == t_hour && mas[i].t_minute>t_minute))
            {
                cout << "Train #" << i << endl;
                cout << mas[i];
            }
            else cout << "Not found!" << endl;
        }
    }
    void getTrains()
    {
        int t_hour, t_minute;
        cout << "Enter time: " << endl;
        cin >> t_hour;
        cin >> t_minute;
        for (int i = 0; i < n; i++)
        {
            if (mas[i].t_hour > t_hour || (mas[i].t_hour == t_hour && mas[i].t_minute>t_minute))
            {
                cout << "Train #" << i << endl;
                cout << mas[i];
            }
            else cout << "Not found!" << endl;
        }
    }
};
istream&operator>>(istream& in, TTrain& train)
{
    string final_destination, number_train, t_hour, t_minute;
    cout << "Enter final destination: " << endl;
    getline(in, final_destination);
    cout << "Enter number of train: " << endl;
    getline(in, number_train);
    cout << "Enter time: " << endl;
    getline(in, t_hour);
    getline(in, t_minute);
    train.addTrain(final_destination, atoi(number_train.c_str()), atoi(t_hour.c_str()), atoi(t_hour.c_str()));
    return in;
}
int main()
{
    int n;
    cout << "Enter quentity trains: " << endl;
    cin >> n;
    TTrain train(n);
    train.set();
    train.get();
    train.getTrains();
    train.getTrains(15, 45);
    system("pause");
    return 0;
}

Я получаю эти две ошибки, и я не могу найти решение, которое работает.

LNK1120: 1 неразрешенное внешнее

Ошибка 1 ошибка LNK2019: неразрешенный внешний символ «public: __thiscall Vector3D :: Vector3D (класс Vector3D const &) «(?? 0Vector3D @@ QAE @ ABV0 @@ Z) ссылка на функцию» public: класс Vector3D __thiscall Vertex :: GetPosition (void) «(? GetPosition @ Vertex @@ QAE? AVVector3D @@ XZ)

Я думаю, что это связано с моим оператором Matrix и конструктором в моем классе Vector 3d
Любая помощь будет высоко ценится, так как я новичок в C ++

#ifndef MATRIX4_H
#define MATRIX4_H

#include "Vector3D.h"
class Matrix4
{
public:
Matrix4();
Matrix4(const Matrix4& rhs);
~Matrix4();

Vector3D Matrix4::operator *(Vector3D vector)
{
Vector3D newVector;

newVector.SetVector_X((m[0][0] * vector.GetVector_X()) + (m[0][1] * vector.GetVector_Y()) + (m[0][2] * vector.GetVector_Z()) + m[0][3]);
newVector.SetVector_Y((m[0][0] * vector.GetVector_X()) + (m[1][1] * vector.GetVector_Y()) + (m[1][2] * vector.GetVector_Z()) + m[1][3]);
newVector.SetVector_Z((m[0][0] * vector.GetVector_X()) + (m[2][1] * vector.GetVector_Y()) + (m[2][2] * vector.GetVector_Z()) + m[2][3]);
return Vector3D(newVector.GetVector_X(),newVector.GetVector_Y(),newVector.GetVector_Z());

}

void SetMatrix(float matrix[4][4])
{
memcpy(m,matrix,sizeof(matrix));
}

private:
float m[4][4];
};
#endif

Файл Vector3D.h

#ifndef VECTOR3D_H
#define VECTOR3D_H

class Vector3D
{
public:
Vector3D();
Vector3D(const Vector3D& rhs);
~Vector3D();

Vector3D(float VectorX, float VectorY, float VectorZ)
{
x=VectorX;
y=VectorY;
z=VectorZ;
}

void SetVector3D(float vector_X, float vector_Y, float vector_Z)
{
x = vector_X;
y = vector_Y;
z = vector_Z;
}

void SetVector_X(float vector_X)
{
x=vector_X;
}

void SetVector_Y(float vector_Y)
{
y=vector_Y;
}

void SetVector_Z(float vector_Z)
{
z=vector_Z;
}

float GetVector_X()
{
return x;
}

float GetVector_Y()
{
return y;
}

float GetVector_Z()
{
return z;
}

Vector3D GetVector()
{
return Vector3D(x,y,z);
}

private:
float x;
float y;
float z;

};
#endif

1

Решение

Это говорит о том, что компоновщик не может найти реализацию Vector3D(const Vector3D& rhs);, Этот конструктор объявлен в вашем векторном классе, но не определен.

У вас есть реализация конструктора где-то в .cpp файл, а этот файл известен вашему компилятору?

Компиляция C / C ++ работает так: сначала у вас есть несколько так называемых «модулей компиляции» — обычно каждый .cpp-file является одним из таких модулей компиляции. Ваша программа состоит из всех этих отдельных модулей, связанных друг с другом (процесс «связывания» происходит после компиляции). Каждая функция, которая вызывается где-то, должна быть определена ровно один раз в некотором модуле компиляции, если он не определен встроенным (как другие методы вашего класса). Если метод объявлен, но не определен, компилятор не будет жаловаться — только компоновщик. Представьте себе блоки компиляции, имеющие «розетки» и «соединители», которые соответствуют соответствующим «розеткам» других блоков. Процесс компиляции просто создает эти модули, принимая определенную форму «сокета» (как указано в объявлениях), тогда как компоновщик фактически пытается соединить каждый «сокет» с его «соединителем». Итак, вы видите, как процесс компиляции может быть успешным, но ссылки нет.

Ошибки компоновщика могут быть сложно решить, особенно если вы еще не так опытны. Там может быть много причин для них:

  • Отсутствует реализация / определение
  • Определение существует, но почему-то не компилируется (потому что файл не передается компилятору и т. Д.)
  • Различные версии библиотек и т. Д.

И многое другое ..

Редактировать: Кроме того, вы должны передать вектор по константной ссылке и создать newVector, вызвав его конструктор, вместо создания объекта по умолчанию и последующего присвоения. И окончательное строительство в return statement тоже не нужен. Улучшенный код:

Vector3D Matrix4::operator *(const Vector3D& vector)
{
return Vector3D(
(m[0][0] * vector.GetVector_X()) + (m[0][1] * vector.GetVector_Y()) + (m[0][2] * vector.GetVector_Z()) + m[0][3],
(m[0][0] * vector.GetVector_X()) + (m[1][1] * vector.GetVector_Y()) + (m[1][2] * vector.GetVector_Z()) + m[1][3],
(m[0][0] * vector.GetVector_X()) + (m[2][1] * vector.GetVector_Y()) + (m[2][2] * vector.GetVector_Z()) + m[2][3]
);
}

5

Другие решения

Ваша реализация Vector3D кажется, что отсутствует фактическая реализация для конструктора копирования, следовательно, неразрешенная внешняя ошибка. Если вы не собираетесь копировать объект Vector3D, вы не сможете передать его в Matrix::operator* по значению, что бы вызвать копию.

Тем не менее, я не думаю, что есть какие-либо причины объявлять и реализовывать конструктор копирования для Vector3D в любом случае, поскольку он содержит только POD-типы, и сгенерированный компилятором конструктор копирования будет работать нормально. То же самое относится и к деструктору, ресурсы для управления отсутствуют, поэтому пусть компилятор выполняет свою работу.

2

Вы реализовали Vector3D конструктор по умолчанию, конструктор копирования и деструктор? Вы показали свои заголовки, но не файлы реализации. Линкер жалуется на отсутствие определения Vector3D::Vector3D(Vector3D const&),

1

На чтение 3 мин. Просмотров 75 Опубликовано 15.12.2019

число неразрешенных внешних идентификаторов number unresolved externals

Error LNK1120 сообщает количество неразрешенных ошибок внешних символов в текущей ссылке. Error LNK1120 reports the number of unresolved external symbol errors in the current link.

Каждый неразрешенный внешний символ сначала получает сообщение об ошибке LNK2001 или LNK2019 . Each unresolved external symbol first gets reported by a LNK2001 or LNK2019 error. Сообщение LNK1120 поступает последним и показывает количество ошибок неразрешенного символа. The LNK1120 message comes last, and shows the unresolved symbol error count.

Устранить эту ошибку не нужно. You don’t need to fix this error. Эта ошибка исчезает, когда вы исправляете все ошибки компоновщика LNK2001 и LNK2019 до того, как они попадают в выходные данные сборки. This error goes away when you correct all of the LNK2001 and LNK2019 linker errors before it in the build output. Всегда устранять проблемы, начиная с первой ошибки, о которой сообщается. Always fix issues starting at the first reported error. Более поздние ошибки могут быть вызваны более ранними версиями и исчезнуть при исправлении предыдущих ошибок. Later errors may be caused by earlier ones, and go away when the earlier errors are fixed.

При компиляции программы ошибок не вылетает. значит в коде ошибок нет. Но при попытке создания экзешника студия показывает 2 ошибки:

1. error LNK2019: unresolved external symbol _WinMain@16 referenced in function ___tmainCRTStartup

2. fatal error LNK1120: 1 unresolved externals

При работе с кодом на другой машине, нареканий у программы не возникает.

Напишите, пожалуйста, что необходимо сделать чтобы студия работала нормально (поподробнее для чайника) . И если нетрудно, опишите причины возникновения ошибок.

What is causing this error? I google’d it and first few solutions I found were that something was wrong with the library and the main function but both seem to be fine in my problem, I even retyped both! What could be causing this?

This might be helpful:

MSVCRTD.lib(crtexew.obj) : error LNK2019: unresolved external symbol WinMain@16 referenced in function __tmainCRTStartup

7 Answers 7

When you created the project, you made the wrong choice of application type. When asked whether your project was a console application or a windows application or a DLL or a static library, you made the wrong chose windows application (wrong choice).

Go back, start over again, go to File -> New -> Project -> Win32 Console Application -> name your app -> click next -> click application settings.

For the application type, make sure Console Application is selected (this step is the vital step).

The main for a windows application is called WinMain, for a DLL is called DllMain, for a .NET application is called Main(cli::array ^), and a static library doesn’t have a main. Only in a console app is main called main

Эти три ошибки являются ошибками связи, указывающими на то, что файл lib используемой функции не был связан во время процесса генерации, как показано на рисунке.

Видно, что эта ошибка в основном связана с функцией поиска. Ожидается, что файл lib поиска не включен в атрибут. Решение следующее:

Щелкните правой кнопкой мыши проект, чтобы открыть страницу свойств, страницу свойств -> компоновщик -> ввод -> дополнительные зависимости

Просто введите абсолютный путь к файлу lib в дополнительных зависимостях и добавьте его. Обратите внимание, что здесь нет кнопки добавления. Вы можете ввести его только вручную. Просто найдите существующий, поместите курсор в конец и нажмите Enter, чтобы вставить необходимую библиотеку. Абсолютный путь к файлу в порядке.

Перекомпилируйте и сгенерируйте, проблема решена.

Обратите внимание на добавление файлов lib! ! !

Обязательно введите абсолютный путь к файлу lib прямо в этом интерфейсе, как это, чтобы все существующие включенные файлы lib были очищены, оставив только тот, который вы только что ввели, так что операция и компиляция будут генерировать больше ошибок.

  • Remove From My Forums
  • Question

  • 1> Skipping task because its outputs are up-to-date.

    1>MSVCRTD.lib(wcrtexe.obj) : error LNK2019: unresolved external symbol wmain referenced in function __tmainCRTStartup this is what my error is can someone help me

    • Edited by

      Friday, March 19, 2010 2:20 AM
      did not finish

Answers

  • change the «subsystem» in your linker settings from «Windows» to «Console» Or if it is a UNICODE build, use wWinMainCRTStartup as entry point in the linker properties.

    Linker Tools Error LNK2019
    Error Message
    unresolved external symbol ‘symbol’ referenced in function ‘function’
    An undefined external symbol (symbol) was found in function. To resolve this error, provide a definition for symbol or remove the code that references it. For more information, see,Function

    inlining problems

    Automatic (function scope) variables

    Missing function body or variable

    Common problems that cause LNK2019 include:

    The declaration of the symbol contains a spelling mistake, such that, it is not the same name as the definition of the symbol.

    A function was used but the type or number of the parameters did not match the function definition.

    The calling convention (__cdecl, __stdcall, or __fastcall) differs on the use of the function declaration and the function definition.

    Symbol definitions are in a file that was compiled as a C program and symbols are declared in a C++ file without an extern «C» modifier. In that case, modify the declaration, for example, instead of:

    Copy Code extern int i;
    extern void g();use:

    Copy Code extern «C» int i;
    extern «C» void g();

    for more info look here


    Knowledge is like light; It spreads only when you have clear and transparent mind. — Sreedhar dv

    • Proposed as answer by
      D.Sreedhar
      Friday, March 19, 2010 4:33 AM
    • Marked as answer by
      Wesley Yao
      Thursday, March 25, 2010 3:26 AM
    • Edited by
      D.Sreedhar
      Friday, March 26, 2010 10:00 AM

  • This usually happens when you create a console application and don’t have the main function defined.

    You probably have written WinMain instead.

    If you want a Windows application instead you can change this from Project Properties -> Configuration Properties -> Linker -> System -> SubSystem.


    «_Superman_»

    Microsoft MVP (Visual C++)

    • Marked as answer by
      Wesley Yao
      Thursday, March 25, 2010 3:26 AM

  • As was already said, you are missing the function main. This is the entry point for a console application so it always need to exist.

    So first of all, are you actually writing a console application.

    Second, if you are writing a console application then do you have a function which looks similar to

    int main()
    {
    }

    or maybe

    int main(int argc, char* argv[])
    {
    }

    Also, what version of Visual Studio are you using? If you are using VS2010 Beta 2 then that had problems detecting the correct version of the main function. If you are using Beta 2, then I suggest you get the Release Candidate since that did fix the problem.


    Visit my (not very good) blog at http://c2kblog.blogspot.com/

    • Marked as answer by
      Wesley Yao
      Thursday, March 25, 2010 3:26 AM

  • >error LNK2019: unresolved external symbol _wmain
    >referenced in function ___tmainCRTStartup

    The linker is trying to find _wmain as that
    is what the startup code is expecting. See:

    Using wmain
    http://msdn.microsoft.com/en-us/library/bky3b5dh(VS.100).aspx

    main: Program Startup
    http://msdn.microsoft.com/en-us/library/6wd819wh(VS.100).aspx
    (Note the comments about _tmain and Unicode.)

    — Wayne

    • Marked as answer by
      Wesley Yao
      Thursday, March 25, 2010 3:26 AM

  • Remove From My Forums
  • Question

  • 1> Skipping task because its outputs are up-to-date.

    1>MSVCRTD.lib(wcrtexe.obj) : error LNK2019: unresolved external symbol wmain referenced in function __tmainCRTStartup this is what my error is can someone help me

    • Edited by

      Friday, March 19, 2010 2:20 AM
      did not finish

Answers

  • change the «subsystem» in your linker settings from «Windows» to «Console» Or if it is a UNICODE build, use wWinMainCRTStartup as entry point in the linker properties.

    Linker Tools Error LNK2019
    Error Message
    unresolved external symbol ‘symbol’ referenced in function ‘function’
    An undefined external symbol (symbol) was found in function. To resolve this error, provide a definition for symbol or remove the code that references it. For more information, see,Function

    inlining problems

    Automatic (function scope) variables

    Missing function body or variable

    Common problems that cause LNK2019 include:

    The declaration of the symbol contains a spelling mistake, such that, it is not the same name as the definition of the symbol.

    A function was used but the type or number of the parameters did not match the function definition.

    The calling convention (__cdecl, __stdcall, or __fastcall) differs on the use of the function declaration and the function definition.

    Symbol definitions are in a file that was compiled as a C program and symbols are declared in a C++ file without an extern «C» modifier. In that case, modify the declaration, for example, instead of:

    Copy Code extern int i;
    extern void g();use:

    Copy Code extern «C» int i;
    extern «C» void g();

    for more info look here


    Knowledge is like light; It spreads only when you have clear and transparent mind. — Sreedhar dv

    • Proposed as answer by
      D.Sreedhar
      Friday, March 19, 2010 4:33 AM
    • Marked as answer by
      Wesley Yao
      Thursday, March 25, 2010 3:26 AM
    • Edited by
      D.Sreedhar
      Friday, March 26, 2010 10:00 AM

  • This usually happens when you create a console application and don’t have the main function defined.

    You probably have written WinMain instead.

    If you want a Windows application instead you can change this from Project Properties -> Configuration Properties -> Linker -> System -> SubSystem.


    «_Superman_»

    Microsoft MVP (Visual C++)

    • Marked as answer by
      Wesley Yao
      Thursday, March 25, 2010 3:26 AM

  • As was already said, you are missing the function main. This is the entry point for a console application so it always need to exist.

    So first of all, are you actually writing a console application.

    Second, if you are writing a console application then do you have a function which looks similar to

    int main()
    {
    }

    or maybe

    int main(int argc, char* argv[])
    {
    }

    Also, what version of Visual Studio are you using? If you are using VS2010 Beta 2 then that had problems detecting the correct version of the main function. If you are using Beta 2, then I suggest you get the Release Candidate since that did fix the problem.


    Visit my (not very good) blog at http://c2kblog.blogspot.com/

    • Marked as answer by
      Wesley Yao
      Thursday, March 25, 2010 3:26 AM

  • >error LNK2019: unresolved external symbol _wmain
    >referenced in function ___tmainCRTStartup

    The linker is trying to find _wmain as that
    is what the startup code is expecting. See:

    Using wmain
    http://msdn.microsoft.com/en-us/library/bky3b5dh(VS.100).aspx

    main: Program Startup
    http://msdn.microsoft.com/en-us/library/6wd819wh(VS.100).aspx
    (Note the comments about _tmain and Unicode.)

    — Wayne

    • Marked as answer by
      Wesley Yao
      Thursday, March 25, 2010 3:26 AM

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

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

А вот еще интересные материалы:

  • Яшка сломя голову остановился исправьте ошибки
  • Ясность цели позволяет целеустремленно добиваться намеченного исправьте ошибки
  • Ясность цели позволяет целеустремленно добиваться намеченного где ошибка
  • Ошибка ссылка на объект не указывает на экземпляр объекта арм фсс элн
  • Ошибка старта холдера что это