Ошибка lnk2001 неразрешенный внешний символ

При попытке сборки программы появляется сообщение об ошибке одного из следующих видов: ссылка на неразрешенный внешний символ ... неопределённая ссылка на символ ... unresolved external symbol ...

Определение

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

К таким сущностям может относиться, например, функция или переменная.


Причины и решения

Возможных причин появления ошибки может быть несколько и это зависит от того, что представляет из себя собираемый проект. Всё множество ситуаций можно разбить на две большие группы:


Используются сторонние библиотеки

  • Не указана необходимая (статическая) библиотека для компоновщика.

    Например, к проекту подключен только *.h файл с объявлениями, но отсутствует код реализации, обычно это *.lib или *.a файлы (в зависимости от используемой системы).
    Требуется явно подключить библиотеку к проекту.

  • Для Visual C++ это можно сделать добавлением следующей строки прямо в код:

    #pragma comment(lib, "libname.lib")
    
  • Для gcc/clang требуется указать файл через ключ -l (эль)

  • Для Qt в .pro файле нужно использовать переменную LIBS:

    LIBS += -L[путь_к_библиотеке] -l[имя_библиотеки]
    
  • Для системы сборки cmake есть target_link_libraries.

  • Библиотека указана, но необходимая сущность, например, класс или функция фактически не экспортируется из библиотеки. Под Windows это может возникать из-за отсуствия __declspec(dllexport) перед сущностью. Обычно это решается макросами. Данная ситуация чаще всего характерна именно для библиотек, находящихся в процессе разработки, и доступных для модификации самому разработчику, нежели для каких-то стабильных версий действительно внешних для проекта библиотек. После разрешения экспортирования библиотеку, конечно же, нужно пересобрать перед непосредственным использованием проблемной сущности.

  • Библиотека указана, но не совпадает разрядность библиотеки и компилируемого кода.

    В общем случае, разрядность собираемого проекта (приложения или библиотеки) должна совпадать с разрядностью используемой сторонней библиотеки. Обычно производители библиотек предоставляют возможность выбора 32 или 64 бит версию использовать. Если библиотека поставляется в исходных кодах и собирается отдельно от текущего проекта, нужно также выбрать правильную разрядность.

  • Библиотека указана, но она собрана для другой (не совместимой) ОС.

    Например при сборке проекта в Windows осуществляется попытка использовать бинарный файл, собранный для Linux. В данном случае нужно использовать файлы, подходящие для вашей ОС.

  • Библиотека указана, но она собрана другим компилятором, не совместимым с используемым.

    Объектные файлы, полученные путем сборки C++ кода разными компиляторами для одной и той же ОС могут быть бинарно несовместимы друг с другом. Требуется использовать совместимые (скорее всего и вовсе одинаковые) компиляторы.

  • Библиотека указана, и собрана тем же компилятором, что и основной проект, но используются разные версии Run-Time библиотек.

    Например, для Visual C++ возможна ситуация, когда библиотека собрана с ключом /MDd, а основной проект с /MTd. Требуется задать ключи так, чтобы использовались одинаковые версии Run-Time библиотек.


Сторонние библиотеки не используются

  • Просто отсутствует определение функции.

    void f(int); // всего лишь объявление. Нет `тела` функции
    int main(){  
        f(42);   // undefined reference to `f(int)'
    }  
    

    Требуется добавить определение функции f:

    void f(int) {
        // тело функции
    }
    

    Может быть ещё частный случай с ошибкой вида:

    undefined reference to `vtable for <имя_класса>`
    

    Такая ошибка возникает, если объявленная виртуальная функция класса, не являющаяся чистой (=0), не содержит реализации.

    class C {
        virtual void f(int);
    };
    

    Нужно такую реализацию добавить. Если это делается вне класса, надо не забыть указать имя проблемного класса, иначе это будет просто свободная функция, которая не устраняет указанную проблему:

    void C::f(int) { // виртуальная функция-член вне определения класса
        // тело функции  
    } 
    
    void f(int) { // свободная функция, не устраняющая проблему
        // тело функции 
    } 
    

    Аналогичная ситуация может возникать при использовании пространств имён, когда объявлении функции находится в пространстве имён:

    // В заголовочном файле
    namespace N {
        void f(int);
    };    
    

    а при реализации указать это пространство имён забыли:

    // В файле реализации
    void f(int) { // функция в глобальном пространстве имён, не устраняющая проблему
        // тело функции  
    }
    
    namespace N {
    void f(int) { // функция в нужном пространстве имён
        // тело функции  
    }
    } // конец пространства имён
    

    Стоит заметить, что C++ разрешает перегрузку функций (существование одноимённых функций, но с разным набором параметров), и в этом случае важно, чтобы сигнатуры функций при объявлении и определении совпадали. Например, вместо объявленной void f(int) была реализована другая:

    void f(const char*) { // const char* вместо int
        // тело функции     
    }
    

    При вызове f(42) будет ошибка:

    undefined reference to `f(int)'
    

    Наличие связки шаблонного класса и дружественной функции также может приводить к ошибке. Например:

    template <class T>
    struct C {
        friend void f(C<T>);   // объявляет *НЕ*шаблонную дружественную функцию
    };
    
    template <class T>         // определяет шаблонную функцию 
    void f(C<T>) { }
    
    int main() {
        C<int> c;
        f(c);                  // undefined reference to `f(C<int>)'
    }
    

    Чтобы объявить шаблонную дружественную функцию, требуется добавить указание шаблонности:

    template <class T>
    struct C {
        template <class V>     // добавили шаблонность для friend функции
        friend void f(C<T>);
    };
    

    Важно, что имя шаблонного параметра для дружественной функции должно отличаться от имени параметра шаблонного класса T, т.к. иначе будет ошибка о сокрытии имени. В частном случае имя класса можно вовсе не указывать, и оставить template <class>. Но это не всегда будет правильным решением, т.к. фактически могла потребоваться дружественная специализация шаблона функции, а не сама шаблонная функция. Подробнее об использовании дружественных функций в шаблонном классе можно ознакомиться здесь.

  • Отсутствует определение статической переменной класса.

    struct S {
        static int i;
    };
    
    int main() {
        S s;
        s.i = 42;  // undefined reference to `S::i'
    }
    

    Нужно добавить определение (выделить память) переменной:

    int S::i;
    
  • Неправильная реализация шаблонного кода.

    Например, реализация шаблонного кода помещена в *.cpp файл, хотя она должна находиться полностью в подключаемом *.h файле. Это требуется по той причине, что компилятор обрабатывает каждый модуль независимо, и в момент инстанцирования шаблона (подстановки конкретного типа) код его реализации должен быть виден. При этом если возможные типы шаблона известны заранее, можно произвести инстанцирование сразу рядом с телом шаблона и не предоставлять его наружу в исходном коде заголовочного файла. Пример:

    // unit.h
    #pragma once
    
    template <class T>
    T f(T);                    // объявление шаблона без реализации
    
    // unit.cpp
    #include "unit.h"
    
    template <class T>
    T f(T t) { return t + t; } // реализация шаблона
    
    template
    int f<int>(int);           // явное инстанцирование для int
    
    template
    double f<double>(double);  // явное инстанцирование для double
    
    // main.cpp
    #include "unit.h"
    
    int main() { 
        f(2);   // ok int
        f(1.5); // ok double
        f('a'); // undefined reference to `char f<char>(char)'
    }
    
  • Файл с кодом не был скомпилирован.

    Например, в случае использования make-файла не было прописано правило построения файла, а в случае использования IDE типа Visual Studio *.cpp файл не добавлен в список файлов проекта.

  • Виртуальная функция в базовом классе не объявлена как = 0 (pure-virtual).

    struct B {
        void virtual f();
    };
    
    struct D : B {
        void f() {}
    };
    
    int main() {
        D d;
    }
    

    При использовании иерархии классов функция в базовом классе, не имеющая реализации должна быть помечена как «чистая»:

    struct B {
        void virtual f() = 0;
    };
    
  • Имя не имеет внешнего связывания.

    Например, есть объявление функции f в модуле А и даже ее реализация в модуле B, но реализация помечена как static:

    // A.cpp
    void f();
    int main() {
        f();   // undefined reference to `f()'
    }
    
    // B.cpp
    static void f() {}
    

    Аналогичная ситуация может возникнуть при использовании безымянного пространства имен:

    // B.cpp
    namespace {
       void f() {}
    }
    

    Или даже при наличии inline у функции:

    // B.cpp
    inline void f() {}
    
description title ms.date f1_keywords helpviewer_keywords ms.assetid

Learn more about: Linker Tools Error LNK2001

Linker Tools Error LNK2001

10/22/2021

LNK2001

LNK2001

dc1cf267-c984-486c-abd2-fd07c799f7ef

unresolved external symbol «symbol«

The compiled code makes a reference or call to symbol. The symbol isn’t defined in any libraries or object files searched by the linker.

This error message is followed by fatal error LNK1120. To fix error LNK1120, first fix all LNK2001 and LNK2019 errors.

There are many ways to get LNK2001 errors. All of them involve a reference to a function or variable that the linker can’t resolve, or find a definition for. The compiler can identify when your code doesn’t declare a symbol, but not when it doesn’t define one. That’s because the definition may be in a different source file or library. If your code refers to a symbol, but it’s never defined, the linker generates an error.

What is an unresolved external symbol?

A symbol is the internal name for a function or global variable. It’s the form of the name used or defined in a compiled object file or library. A global variable is defined in the object file where storage is allocated for it. A function is defined in the object file where the compiled code for the function body is placed. An external symbol is one referenced in one object file, but defined in a different library or object file. An exported symbol is one that’s made publicly available by the object file or library that defines it.

To create an application or DLL, every symbol used must have a definition. The linker must resolve, or find the matching definition for, every external symbol referenced by each object file. The linker generates an error when it can’t resolve an external symbol. It means the linker couldn’t find a matching exported symbol definition in any of the linked files.

Compilation and link issues

This error can occur:

  • When the project is missing a reference to a library (.LIB) or object (.OBJ) file. To fix this issue, add a reference to the required library or object file to your project. For more information, see lib Files as linker input.

  • When the project has a reference to a library (.LIB) or object (.OBJ) file that in turn requires symbols from another library. It may happen even if you don’t call functions that cause the dependency. To fix this issue, add a reference to the other library to your project. For more information, see Understanding the classical model for linking: Taking symbols along for the ride.

  • If you use the /NODEFAULTLIB or /Zl options. When you specify these options, libraries that contain required code aren’t linked into the project unless you’ve explicitly included them. To fix this issue, explicitly include all the libraries you use on the link command line. If you see many missing CRT or Standard Library function names when you use these options, explicitly include the CRT and Standard Library DLLs or library files in the link.

  • If you compile using the /clr option. There may be a missing reference to .cctor. For more information on how to fix this issue, see Initialization of mixed assemblies.

  • If you link to the release mode libraries when building a debug version of an application. Similarly, if you use options /MTd or /MDd or define _DEBUG and then link to the release libraries, you should expect many potential unresolved externals, among other problems. Linking a release mode build with the debug libraries also causes similar problems. To fix this issue, make sure you use the debug libraries in your debug builds, and retail libraries in your retail builds.

  • If your code refers to a symbol from one library version, but you link a different version of the library. Generally, you can’t mix object files or libraries that are built for different versions of the compiler. The libraries that ship in one version may contain symbols that can’t be found in the libraries included with other versions. To fix this issue, build all the object files and libraries with the same version of the compiler before linking them together. For more information, see C++ binary compatibility between Visual Studio versions.

  • If library paths are out of date. The Tools > Options > Projects > VC++ Directories dialog, under the Library files selection, allows you to change the library search order. The Linker folder in the project’s Property Pages dialog box may also contain paths that could be out of date.

  • When a new Windows SDK is installed (perhaps to a different location). The library search order must be updated to point to the new location. Normally, you should put the path to new SDK include and lib directories in front of the default Visual C++ location. Also, a project containing embedded paths may still point to old paths that are valid, but out of date. Update the paths for new functionality added by the new version that’s installed to a different location.

  • If you build at the command line, and have created your own environment variables. Verify that the paths to tools, libraries, and header files go to a consistent version. For more information, see Use the MSVC toolset from the command line.

Coding issues

This error can be caused by:

  • Mismatched case in your source code or module-definition (.def) file. For example, if you name a variable var1 in one C++ source file and try to access it as VAR1 in another, this error is generated. To fix this issue, use consistently spelled and cased names.

  • A project that uses function inlining. It can occur when you define the functions as inline in a source file, rather than in a header file. Inlined functions can’t be seen outside the source file that defines them. To fix this issue, define the inlined functions in the headers where they’re declared.

  • Calling a C function from a C++ program without using an extern "C" declaration for the C function. The compiler uses different internal symbol naming conventions for C and C++ code. The internal symbol name is what the linker looks for when resolving symbols. To fix this issue, use an extern "C" wrapper around all declarations of C functions used in your C++ code, which causes the compiler to use the C internal naming convention for those symbols. Compiler options /Tp and /Tc cause the compiler to compile files as C++ or C, respectively, no matter what the filename extension is. These options can cause internal function names different from what you expect.

  • An attempt to reference functions or data that don’t have external linkage. In C++, inline functions and const data have internal linkage unless explicitly specified as extern. To fix this issue, use explicit extern declarations on symbols referred to outside the defining source file.

  • A missing function body or variable definition. This error is common when you declare, but don’t define, variables, functions, or classes in your code. The compiler only needs a function prototype or extern variable declaration to generate an object file without error, but the linker can’t resolve a call to the function or a reference to the variable because there’s no function code or variable space reserved. To fix this issue, make sure to define every referenced function and variable in a source file or library you link.

  • A function call that uses return and parameter types or calling conventions that don’t match the ones in the function definition. In C++ object files, Name decoration encodes the calling convention, class or namespace scope, and return and parameter types of a function. The encoded string becomes part of the final decorated function name. This name is used by the linker to resolve, or match, calls to the function from other object files. To fix this issue, make sure the function declaration, definition, and calls all use the same scopes, types, and calling conventions.

  • C++ code you call, when you include a function prototype in a class definition, but don’t include the implementation of the function. To fix this issue, be sure to provide a definition for all class members you call.

  • An attempt to call a pure virtual function from an abstract base class. A pure virtual function has no base class implementation. To fix this issue, make sure all called virtual functions are implemented.

  • Trying to use a variable declared within a function (a local variable) outside the scope of that function. To fix this issue, remove the reference to the variable that isn’t in scope, or move the variable to a higher scope.

  • When you build a Release version of an ATL project, producing a message that CRT startup code is required. To fix this issue, do one of the following,

    • Remove _ATL_MIN_CRT from the list of preprocessor defines to allow CRT startup code to be included. For more information, see General property page (Project).

    • If possible, remove calls to CRT functions that require CRT startup code. Instead, use their Win32 equivalents. For example, use lstrcmp instead of strcmp. Known functions that require CRT startup code are some of the string and floating point functions.

Consistency issues

There’s currently no standard for C++ name decoration between compiler vendors, or even between different versions of the same compiler. Object files compiled with different compilers may not use the same naming scheme. Linking them can cause error LNK2001.

Mixing inline and non-inline compile options on different modules can cause LNK2001. If a C++ library is created with function inlining turned on (/Ob1 or /Ob2) but the corresponding header file describing the functions has inlining turned off (no inline keyword), this error occurs. To fix this issue, define the functions inline in the header file you include in other source files.

If you use the #pragma inline_depth compiler directive, make sure you’ve set a value of 2 or greater, and make sure you also use the /Ob1 or /Ob2 compiler option.

This error can occur if you omit the LINK option /NOENTRY when you create a resource-only DLL. To fix this issue, add the /NOENTRY option to the link command.

This error can occur if you use incorrect /SUBSYSTEM or /ENTRY settings in your project. For example, if you write a console application and specify /SUBSYSTEM:WINDOWS, an unresolved external error is generated for WinMain. To fix this issue, make sure you match the options to the project type. For more information on these options and entry points, see the /SUBSYSTEM and /ENTRY linker options.

Exported .def file symbol issues

This error occurs when an export listed in a .def file isn’t found. It could be because the export doesn’t exist, is spelled incorrectly, or uses C++ decorated names. A .def file doesn’t take decorated names. To fix this issue, remove unneeded exports, and use extern "C" declarations for exported symbols.

Use the decorated name to find the error

The C++ compiler and linker use Name Decoration, also known as name-mangling. Name decoration encodes extra information about the type of a variable in its symbol name. The symbol name for a function encodes its return type, parameter types, scope, and calling convention. This decorated name is the symbol name the linker searches for to resolve external symbols.

A link error can result if the declaration of a function or variable doesn’t exactly match the definition of the function or variable. That’s because any difference becomes part of the symbol name to match. The error can happen even if the same header file is used in both the calling code and the defining code. One way it may occur is if you compile the source files by using different compiler flags. For example, if your code is compiled to use the __vectorcall calling convention, but you link to a library that expects clients to call it using the default __cdecl or __fastcall calling convention. In this case, the symbols don’t match because the calling conventions are different.

To help you find the cause, the error message shows you two versions of the name. It displays both the «friendly name,» the name used in source code, and the decorated name (in parentheses). You don’t need to know how to interpret the decorated name. You can still search for and compare it with other decorated names. Command-line tools can help to find and compare the expected symbol name and the actual symbol name:

  • The /EXPORTS and /SYMBOLS options of the DUMPBIN command-line tool are useful here. They can help you discover which symbols are defined in your .dll and object or library files. You can use the symbols list to verify that the exported decorated names match the decorated names the linker searches for.

  • In some cases, the linker can only report the decorated name for a symbol. You can use the UNDNAME command-line tool to get the undecorated form of a decorated name.

Additional resources

For more information, see the Stack Overflow question «What is an undefined reference/unresolved external symbol error and how do I fix it?».

description title ms.date f1_keywords helpviewer_keywords ms.assetid

Learn more about: Linker Tools Error LNK2001

Linker Tools Error LNK2001

10/22/2021

LNK2001

LNK2001

dc1cf267-c984-486c-abd2-fd07c799f7ef

unresolved external symbol «symbol«

The compiled code makes a reference or call to symbol. The symbol isn’t defined in any libraries or object files searched by the linker.

This error message is followed by fatal error LNK1120. To fix error LNK1120, first fix all LNK2001 and LNK2019 errors.

There are many ways to get LNK2001 errors. All of them involve a reference to a function or variable that the linker can’t resolve, or find a definition for. The compiler can identify when your code doesn’t declare a symbol, but not when it doesn’t define one. That’s because the definition may be in a different source file or library. If your code refers to a symbol, but it’s never defined, the linker generates an error.

What is an unresolved external symbol?

A symbol is the internal name for a function or global variable. It’s the form of the name used or defined in a compiled object file or library. A global variable is defined in the object file where storage is allocated for it. A function is defined in the object file where the compiled code for the function body is placed. An external symbol is one referenced in one object file, but defined in a different library or object file. An exported symbol is one that’s made publicly available by the object file or library that defines it.

To create an application or DLL, every symbol used must have a definition. The linker must resolve, or find the matching definition for, every external symbol referenced by each object file. The linker generates an error when it can’t resolve an external symbol. It means the linker couldn’t find a matching exported symbol definition in any of the linked files.

Compilation and link issues

This error can occur:

  • When the project is missing a reference to a library (.LIB) or object (.OBJ) file. To fix this issue, add a reference to the required library or object file to your project. For more information, see lib Files as linker input.

  • When the project has a reference to a library (.LIB) or object (.OBJ) file that in turn requires symbols from another library. It may happen even if you don’t call functions that cause the dependency. To fix this issue, add a reference to the other library to your project. For more information, see Understanding the classical model for linking: Taking symbols along for the ride.

  • If you use the /NODEFAULTLIB or /Zl options. When you specify these options, libraries that contain required code aren’t linked into the project unless you’ve explicitly included them. To fix this issue, explicitly include all the libraries you use on the link command line. If you see many missing CRT or Standard Library function names when you use these options, explicitly include the CRT and Standard Library DLLs or library files in the link.

  • If you compile using the /clr option. There may be a missing reference to .cctor. For more information on how to fix this issue, see Initialization of mixed assemblies.

  • If you link to the release mode libraries when building a debug version of an application. Similarly, if you use options /MTd or /MDd or define _DEBUG and then link to the release libraries, you should expect many potential unresolved externals, among other problems. Linking a release mode build with the debug libraries also causes similar problems. To fix this issue, make sure you use the debug libraries in your debug builds, and retail libraries in your retail builds.

  • If your code refers to a symbol from one library version, but you link a different version of the library. Generally, you can’t mix object files or libraries that are built for different versions of the compiler. The libraries that ship in one version may contain symbols that can’t be found in the libraries included with other versions. To fix this issue, build all the object files and libraries with the same version of the compiler before linking them together. For more information, see C++ binary compatibility between Visual Studio versions.

  • If library paths are out of date. The Tools > Options > Projects > VC++ Directories dialog, under the Library files selection, allows you to change the library search order. The Linker folder in the project’s Property Pages dialog box may also contain paths that could be out of date.

  • When a new Windows SDK is installed (perhaps to a different location). The library search order must be updated to point to the new location. Normally, you should put the path to new SDK include and lib directories in front of the default Visual C++ location. Also, a project containing embedded paths may still point to old paths that are valid, but out of date. Update the paths for new functionality added by the new version that’s installed to a different location.

  • If you build at the command line, and have created your own environment variables. Verify that the paths to tools, libraries, and header files go to a consistent version. For more information, see Use the MSVC toolset from the command line.

Coding issues

This error can be caused by:

  • Mismatched case in your source code or module-definition (.def) file. For example, if you name a variable var1 in one C++ source file and try to access it as VAR1 in another, this error is generated. To fix this issue, use consistently spelled and cased names.

  • A project that uses function inlining. It can occur when you define the functions as inline in a source file, rather than in a header file. Inlined functions can’t be seen outside the source file that defines them. To fix this issue, define the inlined functions in the headers where they’re declared.

  • Calling a C function from a C++ program without using an extern "C" declaration for the C function. The compiler uses different internal symbol naming conventions for C and C++ code. The internal symbol name is what the linker looks for when resolving symbols. To fix this issue, use an extern "C" wrapper around all declarations of C functions used in your C++ code, which causes the compiler to use the C internal naming convention for those symbols. Compiler options /Tp and /Tc cause the compiler to compile files as C++ or C, respectively, no matter what the filename extension is. These options can cause internal function names different from what you expect.

  • An attempt to reference functions or data that don’t have external linkage. In C++, inline functions and const data have internal linkage unless explicitly specified as extern. To fix this issue, use explicit extern declarations on symbols referred to outside the defining source file.

  • A missing function body or variable definition. This error is common when you declare, but don’t define, variables, functions, or classes in your code. The compiler only needs a function prototype or extern variable declaration to generate an object file without error, but the linker can’t resolve a call to the function or a reference to the variable because there’s no function code or variable space reserved. To fix this issue, make sure to define every referenced function and variable in a source file or library you link.

  • A function call that uses return and parameter types or calling conventions that don’t match the ones in the function definition. In C++ object files, Name decoration encodes the calling convention, class or namespace scope, and return and parameter types of a function. The encoded string becomes part of the final decorated function name. This name is used by the linker to resolve, or match, calls to the function from other object files. To fix this issue, make sure the function declaration, definition, and calls all use the same scopes, types, and calling conventions.

  • C++ code you call, when you include a function prototype in a class definition, but don’t include the implementation of the function. To fix this issue, be sure to provide a definition for all class members you call.

  • An attempt to call a pure virtual function from an abstract base class. A pure virtual function has no base class implementation. To fix this issue, make sure all called virtual functions are implemented.

  • Trying to use a variable declared within a function (a local variable) outside the scope of that function. To fix this issue, remove the reference to the variable that isn’t in scope, or move the variable to a higher scope.

  • When you build a Release version of an ATL project, producing a message that CRT startup code is required. To fix this issue, do one of the following,

    • Remove _ATL_MIN_CRT from the list of preprocessor defines to allow CRT startup code to be included. For more information, see General property page (Project).

    • If possible, remove calls to CRT functions that require CRT startup code. Instead, use their Win32 equivalents. For example, use lstrcmp instead of strcmp. Known functions that require CRT startup code are some of the string and floating point functions.

Consistency issues

There’s currently no standard for C++ name decoration between compiler vendors, or even between different versions of the same compiler. Object files compiled with different compilers may not use the same naming scheme. Linking them can cause error LNK2001.

Mixing inline and non-inline compile options on different modules can cause LNK2001. If a C++ library is created with function inlining turned on (/Ob1 or /Ob2) but the corresponding header file describing the functions has inlining turned off (no inline keyword), this error occurs. To fix this issue, define the functions inline in the header file you include in other source files.

If you use the #pragma inline_depth compiler directive, make sure you’ve set a value of 2 or greater, and make sure you also use the /Ob1 or /Ob2 compiler option.

This error can occur if you omit the LINK option /NOENTRY when you create a resource-only DLL. To fix this issue, add the /NOENTRY option to the link command.

This error can occur if you use incorrect /SUBSYSTEM or /ENTRY settings in your project. For example, if you write a console application and specify /SUBSYSTEM:WINDOWS, an unresolved external error is generated for WinMain. To fix this issue, make sure you match the options to the project type. For more information on these options and entry points, see the /SUBSYSTEM and /ENTRY linker options.

Exported .def file symbol issues

This error occurs when an export listed in a .def file isn’t found. It could be because the export doesn’t exist, is spelled incorrectly, or uses C++ decorated names. A .def file doesn’t take decorated names. To fix this issue, remove unneeded exports, and use extern "C" declarations for exported symbols.

Use the decorated name to find the error

The C++ compiler and linker use Name Decoration, also known as name-mangling. Name decoration encodes extra information about the type of a variable in its symbol name. The symbol name for a function encodes its return type, parameter types, scope, and calling convention. This decorated name is the symbol name the linker searches for to resolve external symbols.

A link error can result if the declaration of a function or variable doesn’t exactly match the definition of the function or variable. That’s because any difference becomes part of the symbol name to match. The error can happen even if the same header file is used in both the calling code and the defining code. One way it may occur is if you compile the source files by using different compiler flags. For example, if your code is compiled to use the __vectorcall calling convention, but you link to a library that expects clients to call it using the default __cdecl or __fastcall calling convention. In this case, the symbols don’t match because the calling conventions are different.

To help you find the cause, the error message shows you two versions of the name. It displays both the «friendly name,» the name used in source code, and the decorated name (in parentheses). You don’t need to know how to interpret the decorated name. You can still search for and compare it with other decorated names. Command-line tools can help to find and compare the expected symbol name and the actual symbol name:

  • The /EXPORTS and /SYMBOLS options of the DUMPBIN command-line tool are useful here. They can help you discover which symbols are defined in your .dll and object or library files. You can use the symbols list to verify that the exported decorated names match the decorated names the linker searches for.

  • In some cases, the linker can only report the decorated name for a symbol. You can use the UNDNAME command-line tool to get the undecorated form of a decorated name.

Additional resources

For more information, see the Stack Overflow question «What is an undefined reference/unresolved external symbol error and how do I fix it?».

  • Remove From My Forums
  • Question

  • Hello everybody,

    I’m experiencing linkage issues while trying to compile a program.

    Anyone out there wanna try to help me?

    Linking...
    CreatureSpriteTable.obj : error LNK2001: unresolved external symbol "class EditString * pdlgEditString" (?pdlgEditString@@3PAVEditString@@A)
    CreatureSpriteTable.obj : error LNK2001: unresolved external symbol "public: void __thiscall CNewEdit::AddString(char const *)" (?AddString@CNewEdit@@QAEXPBD@Z)
    InitCreatureTable.obj : error LNK2001: unresolved external symbol "public: void __thiscall CNewEdit::AddString(char const *)" (?AddString@CNewEdit@@QAEXPBD@Z)
    InitInfo.obj : error LNK2001: unresolved external symbol "public: void __thiscall CNewEdit::AddString(char const *)" (?AddString@CNewEdit@@QAEXPBD@Z)
    
    InitCreatureTable.obj : error LNK2001: unresolved external symbol "class CNewEdit * pedit" (?pedit@@3PAVCNewEdit@@A)
    InitInfo.obj : error LNK2001: unresolved external symbol "class CNewEdit * pedit" (?pedit@@3PAVCNewEdit@@A)
    Debug/ClientInfo.exe : fatal error LNK1120: 3 unresolved externals
    Error executing link.exe.
    
    ClientInfo.exe - 8 error(s), 0 warning(s)

    I’m using Visual C++

Answers

  • If you get  unresolved external symbol means, you have used the class/function in your program. But, the linker is not able to find the definition. 

    If the EditString/CNewEdit::AddString used in executable, you should define in your application.

    If you are tying to use 3rd party application
    DLL, you should link with the Libarry (*.lib) file. you can also use run time linking using

    LoadLibrary/GetProcAddress family function.

    If you want more information about Link 2001, you can check the following msdn link

    http://msdn.microsoft.com/en-us/library/f6xx1b1z(VS.80).aspx


    Thanks and Regards Selvam http://www15.brinkster.com/selvamselvam/

    • Marked as answer by

      Friday, November 25, 2011 9:30 AM

  • Hi,

    As 
    Selvam’s suggestion, LNK2001 means that the Visual Studio or Visual C+ cannot find the definition of the function or class. That mean
     you need to add the LIB or DLL to your project.

    According to your description, I suggest you can ask your friend and find out whether or not there is any other LIB or DLL. Then you can add these libraries to the
    Visual C++ by these step:

    1. 
    Select Tools menu and click option.

    2. Click Directories tab and choose the “Library Files” in Show directories for option.

    3. Double click the blank in the Directories option and add the path of the LIBs or DLLs

    4. Repeat these steps to add the Include files or other option.

    5. Select Ok to finish.

    In addition, you can also load the libraries dynamically. Please check these reference:

    1.
    http://msdn.microsoft.com/en-us/library/ms686923(v=VS.85).aspx

    2.
    http://msdn.microsoft.com/en-us/library/ms686944(v=VS.85).aspx

    Best Regards,

    Rob


    Rob Pan [MSFT]
    MSDN Community Support | Feedback to us

    • Marked as answer by
      Rob Pan
      Friday, November 25, 2011 9:30 AM

Содержание

  1. Error lnk2001 unresolved external symbol printf
  2. Answered by:
  3. Question
  4. Ошибка средств компоновщика LNK2001
  5. Что такое неразрешенный внешний символ?
  6. Проблемы компиляции и компоновки
  7. Проблемы кодирования
  8. Проблемы согласованности
  9. Ошибки экспортированного файла DEF
  10. Использовать декорированное имя для поиска ошибки

Error lnk2001 unresolved external symbol printf

This forum has migrated to Microsoft Q&A. Visit Microsoft Q&A to post new questions.

Answered by:

Question

I’ve got a project which successfully compiled (by dynamically linking in the runtime DLLs). However we want to statically link them in instead. Since then, I’ve just been getting linker errors with everything I tried.

Currently, I’ve got:
fatal error LNK1120: 1 unresolved externals
error LNK2001: unresolved external symbol __imp__printf
error LNK2005: «public: __thiscall std::_Lockit::_Lockit(int)» (??0_Lockit@std@@QAE@H@Z) already defined in libcpmt.lib(xlock.obj)
error LNK2005: «public: __thiscall std::_Lockit::

_Lockit(void)» (??1_Lockit@std@@QAE@XZ) already defined in libcpmt.lib(xlock.obj)
error LNK2005: «public: __thiscall std::basic_string ,class std::allocator >::basic_string ,class std::allocator >(unsigned int,char)» (??0?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAE@ID@Z) already defined in libcpmt.lib(cout.obj)
error LNK2005: «public: __thiscall std::locale::

locale(void)» (??1locale@std@@QAE@XZ) already defined in libcpmt.lib(cout.obj)
error LNK2005: «public: __thiscall std::locale::id::operator unsigned int(void)» (??Bid@locale@std@@QAEIXZ) already defined in libcpmt.lib(cout.obj)
error LNK2005: «public: char __thiscall std::basic_ios >::widen(char)const » (?widen@?$basic_ios@DU?$char_traits@D@std@@@std@@QBEDD@Z) already defined in libcpmt.lib(cout.obj)
error LNK2005: «public: class std::basic_string ,class std::allocator > & __thiscall std::basic_string ,class std::allocator >::append(unsigned int,char)» (?append@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAEAAV12@ID@Z) already defined in libcpmt.lib(cout.obj)
error LNK2005: «public: class std::locale __thiscall std::ios_base::getloc(void)const » (?getloc@ios_base@std@@QBE?AVlocale@2@XZ) already defined in libcpmt.lib(cout.obj)
error LNK2005: «public: class std::locale::facet const * __thiscall std::locale::_Getfacet(unsigned int)const » (?_Getfacet@locale@std@@QBEPBVfacet@12@I@Z) already defined in libcpmt.lib(locale0.obj)
error LNK2005: «public: static unsigned int __cdecl std::ctype ::_Getcat(class std::locale::facet const * *)» (?_Getcat@?$ctype@D@std@@SAIPAPBVfacet@locale@2@@Z) already defined in libcpmt.lib(cout.obj)
error LNK2005: «public: void __thiscall std::locale::facet::_Incref(void)» (?_Incref@facet@locale@std@@QAEXXZ) already defined in libcpmt.lib(cout.obj)
error LNK2005: «public: void __thiscall std::locale::facet::_Register(void)» (?_Register@facet@locale@std@@QAEXXZ) already defined in libcpmt.lib(locale0.obj)

My additional dependencies are:
libcmt.lib
crypt32.lib
JNIBridgeStatic.lib

And I’m ignoring the following libraries:
libc.lib
libcd.lib
libcmtd.lib
msvcrt.lib
msvcrtd.lib

JNIBridgeStatic.lib is another library that I’ve built, it’s additional dependencies are:
libcmt.lib
and ignoring:
libc.lib
libcd.lib
libcmtd.lib
msvcrt.lib
msvcrtd.lib

I’m using Visual C++ 2003 for each. I’ve got a feeling I’m close, but I’ve got no idea where to go from here.

Источник

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

Скомпилированный код создает ссылку или вызов символа. Символ не определен ни в одной из библиотек или объектных файлов, поиск которого осуществляется компоновщиком.

Это сообщение об ошибке после неустранимой ошибки LNK1120. Чтобы устранить ошибку LNK1120, сначала исправьте все ошибки LNK2001 и LNK2019.

Существует множество способов получения ошибок LNK2001. Все они используют ссылку на функцию или переменную, которую компоновщик не может Разрешить, или найти определение для. Компилятор может определить, когда код не объявляет символ, но не в том случае, если он не определен . Это связано с тем, что определение может находиться в другом исходном файле или библиотеке. Если код ссылается на символ, но он никогда не определен, компоновщик создает ошибку.

Что такое неразрешенный внешний символ?

Символ — это внутреннее имя функции или глобальной переменной. Это форма имени, используемая или определенная в скомпилированном объектном файле или библиотеке. Глобальная переменная определяется в объектном файле, где для него выделяется хранилище. Функция определена в объектном файле, где размещается скомпилированный код для тела функции. Внешний символ является ссылкой в одном файле объекта, но определен в другой библиотеке или объектном файле. Экспортированный символ — это открытый объект, который становится общедоступным для файлового файла или библиотеки, определяющей его.

Для создания приложения или библиотеки DLL в каждом используемом символе должно быть определено определение. Компоновщик должен Разрешитьили найти определение сопоставления для каждого внешнего символа, на который ссылается каждый файл объекта. Компоновщик создает ошибку, если не удается разрешить внешний символ. Это означает, что компоновщику не удалось найти соответствующее определение экспортированного символа в любом из связанных файлов.

Проблемы компиляции и компоновки

Эта ошибка может возникать:

Если в проекте отсутствует ссылка на библиотеку (. LIB) или Object (. OBJ-файл). Чтобы устранить эту проблему, добавьте в проект ссылку на требуемую библиотеку или файл объекта. Дополнительные сведения см. в разделе lib files as input компоновщика.

Если проект содержит ссылку на библиотеку (. LIB) или Object (. OBJ), который, в свою очередь, требуются символы из другой библиотеки. Это может произойти даже в том случае, если не вызываются функции, вызывающие зависимость. Чтобы устранить эту проблему, добавьте в проект ссылку на другую библиотеку. Дополнительные сведения см. в разделе понимание классической модели для связывания: использование символов в качестве пути.

При использовании параметров /NODEFAULTLIB или /Zl . При указании этих параметров библиотеки, содержащие требуемый код, не будут связаны с проектом, если они не включены явным образом. Чтобы устранить эту проблему, явно включите все библиотеки, используемые в командной строке компоновки. Если при использовании этих параметров отображается множество отсутствующих имен функций CRT или стандартной библиотеки, явно включите библиотеки CRT и библиотеки стандартных библиотек или файлы библиотеки в ссылку.

При компиляции с параметром /CLR . Возможно, отсутствует ссылка на .cctor . Дополнительные сведения об устранении этой проблемы см. в разделе Инициализация смешанных сборок.

Если при построении отладочной версии приложения вы связываетесь с библиотеками в режиме выпуска. Аналогично, если вы используете параметры /MTD или /MDD или определяете _DEBUG , а затем связываетесь с библиотеками выпусков, то во многих других случаях следует рассчитывать на множество потенциальных неразрешенных внешних значений. Связывание сборки в режиме выпуска с отладочными библиотеками также вызывает аналогичные проблемы. Чтобы устранить эту проблему, убедитесь, что вы используете отладочные библиотеки в отладочных сборках и розничных библиотеках в ваших розничных сборках.

Если код ссылается на символ из одной версии библиотеки, но вы связываете другую версию библиотеки. Как правило, нельзя смешивать объектные файлы или библиотеки, созданные для разных версий компилятора. Библиотеки, поставляемые в одной версии, могут содержать символы, которые не могут быть найдены в библиотеках, включенных в другие версии. Чтобы устранить эту проблему, создайте все объектные файлы и библиотеки с одной и той же версией компилятора, прежде чем связывать их друг с другом. дополнительные сведения см. в разделе совместимость двоичных данных C++ между версиями Visual Studio.

Если пути к библиотекам устарели. диалоговое окно сервис > параметры > проекты > VC++ каталоги в области выбор файлов библиотеки позволяет изменить порядок поиска в библиотеке. Папка Компоновщик в диалоговом окне страницы свойств проекта может также содержать неактуальные пути.

при установке нового Windows SDK (возможно, в другое расположение). Необходимо обновить порядок поиска библиотеки, чтобы он указывал на новое расположение. Как правило, путь следует поместить в новый каталог include и lib для пакета SDK перед расположением Visual C++ по умолчанию. Кроме того, проект, содержащий внедренные пути, может по-прежнему указывать на старые пути, которые являются допустимыми, но устарели. Обновите пути для новых функций, добавленных новой версией, которая установлена в другое расположение.

При построении в командной строке и создании собственных переменных среды. Убедитесь, что пути к инструментам, библиотекам и файлам заголовков имеют одинаковую версию. Дополнительные сведения см. в статье Использование набора инструментов MSVC из командной строки.

Проблемы кодирования

Эта ошибка может быть вызвана следующими причинами.

Несовпадение регистра в исходном коде или файле определения модуля (DEF). Например, если вы назначите переменную var1 в одном исходном файле C++ и попытаетесь получить к ней доступ, как VAR1 в другой, возникает эта ошибка. Чтобы устранить эту проблему, используйте согласованное написание имен и имена регистров.

Проект, использующий встраивание функций. Это может произойти при определении функций inline в исходном файле, а не в файле заголовка. Встроенные функции не отображаются за пределами исходного файла, который их определяет. Чтобы устранить эту проблему, определите встроенные функции в заголовках, где они объявляются.

Вызов функции C из программы на языке C++ без использования extern «C» объявления для функции C. Компилятор использует разные внутренние соглашения об именовании символов для кода C и C++. Внутреннее имя символа — это то, что ищет компоновщик при разрешении символов. Чтобы устранить эту проблему, используйте extern «C» обертку для всех объявлений функций C, используемых в коде C++, в результате чего компилятор должен использовать внутреннее соглашение об именовании языка c для этих символов. Параметры компилятора /TP и /TC заставляют компилятор компилировать файлы как C++ или C соответственно, независимо от расширения имени файла. Эти параметры могут привести к тому, что имена внутренних функций отличаются от предполагаемых.

Попытка сослаться на функции или данные, у которых нет внешней компоновки. В C++ встроенные функции и const данные имеют внутреннюю компоновку, если явно не указано в качестве extern . Чтобы устранить эту проблему, используйте явные extern объявления для символов, которые ссылаются вне определяющего исходного файла.

Отсутствует тело функции или определение переменной . Эта ошибка часто возникает при объявлении, но не определении, переменных, функций или классов в коде. Компилятору требуется только прототип функции или extern объявление переменной, чтобы создать объектный файл без ошибок, но компоновщик не может разрешить вызов функции или ссылку на переменную, так как код функции или переменное пространство не зарезервированы. Чтобы устранить эту проблему, обязательно Определите каждую указанную функцию и переменную в исходном файле или библиотеке, на которую вы связываетесь.

Вызов функции, который использует типы возвращаемых значений и параметров или соглашения о вызовах, которые не соответствуют объектам в определении функции. В объектных файлах C++ декорирование имен кодирует соглашение о вызовах, область класса или пространства имен, а также типы возвращаемых данных и параметров функции. Закодированная строка становится частью окончательного декорированного имени функции. Это имя используется компоновщиком для разрешения или сопоставления вызовов функции из других объектных файлов. Чтобы устранить эту проблему, убедитесь, что в объявлении функции, определении и вызовах используются одни и те же области, типы и соглашения о вызовах.

Код C++, который вызывается при включении прототипа функции в определение класса, но не включает реализацию функции. Чтобы устранить эту проблему, обязательно предоставьте определение для всех членов класса, которые вы вызываете.

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

Попытка использовать переменную, объявленную в функции (Локальная переменная), за пределами области этой функции. Чтобы устранить эту проблему, удалите ссылку на переменную, которая не находится в области действия, или переместите переменную в область более высокого уровня.

При построении окончательной версии проекта ATL создается сообщение о том, что код запуска CRT является обязательным. Чтобы устранить эту проблему, выполните одно из следующих действий.

Удалите _ATL_MIN_CRT из списка определений препроцессора, чтобы разрешить включение кода запуска CRT. Дополнительные сведения см. в разделе Страница свойств General (Project).

Если это возможно, удалите вызовы функций CRT, требующих код запуска CRT. Вместо этого используйте эквиваленты Win32. Например, используйте lstrcmp вместо strcmp . Известными функциями, требующими код запуска CRT, являются некоторые функции строк и вычислений с плавающей запятой.

Проблемы согласованности

В настоящее время нет стандарта для декорирования имен C++ между поставщиками компиляторов или даже между разными версиями одного и того же компилятора. Объектные файлы, скомпилированные с разными компиляторами, могут не использовать одинаковую схему именования. Связывание их может вызвать ошибку LNK2001.

Смешивание встроенных и невстроенных параметров компиляции в разных модулях может вызвать ошибку LNK2001. Если библиотека C++ создается с включенной функцией встраивания функций (/Ob1 или /Ob2), но соответствующий заголовочный файл, описывающий функции, отключен (без inline ключевого слова), возникает эта ошибка. Чтобы устранить эту проблему, определите функции inline в файле заголовка, который включается в другие исходные файлы.

Если вы используете #pragma inline_depth директиву компилятора, убедитесь, что задано значение 2 или более, и убедитесь, что вы также используете параметр компилятора /Ob1 или /Ob2 .

Эта ошибка может возникать, если опустить параметр LINK/NOENTRY при создании библиотеки DLL только для ресурсов. Чтобы устранить эту проблему, добавьте параметр/NOENTRY в команду Link.

Эта ошибка может возникать, если в проекте используются неверные параметры/SUBSYSTEM или/ENTRY. Например, при написании консольного приложения и задании/SUBSYSTEM: WINDOWS создается неразрешенная внешняя ошибка для WinMain . Чтобы устранить эту проблему, убедитесь, что вы соответствуете параметрам типа проекта. Дополнительные сведения об этих параметрах и точках входа см. в разделе Параметры компоновщика /SUBSYSTEM и /entry .

Ошибки экспортированного файла DEF

Эта ошибка возникает, когда экспорт, указанный в DEF-файле, не найден. Это может быть вызвано тем, что экспорт не существует, написан неправильно или использует декорированные имена C++. DEF-файл не имеет декорированных имен. Чтобы устранить эту проблему, удалите ненужные экспорты и используйте extern «C» объявления для экспортированных символов.

Использовать декорированное имя для поиска ошибки

Компилятор и компоновщик C++ используют декорирование имен, также называемое искажением имени. Декорирование имен кодирует дополнительные сведения о типе переменной в ее имени символа. Имя символа для функции кодирует свой возвращаемый тип, типы параметров, область и соглашение о вызовах. Это декорированное имя — это имя символа, которое компоновщик ищет для разрешения внешних символов.

Ошибка связи может возникнуть, если объявление функции или переменной не полностью соответствует определению функции или переменной. Это связано с тем, что все различия становятся частью имени символа для сопоставления. Ошибка может возникать даже в том случае, если один и тот же файл заголовка используется как в вызывающем, так и в коде, определяющем код. Это может произойти, если вы компилируете исходные файлы с помощью различных флагов компилятора. Например, если код компилируется для использования __vectorcall соглашения о вызовах, но вы связываетесь с библиотекой, которая ожидает, что клиенты будут вызывать его с помощью соглашения по умолчанию __cdecl или __fastcall вызова. В этом случае символы не совпадают, поскольку соглашения о вызовах различаются.

Чтобы помочь вам найти причину, в сообщении об ошибке отображаются две версии имени. В нем отображается «понятное имя», имя, используемое в исходном коде, и декорированное имя (в круглых скобках). Вам не нужно знать, как интерпретировать декорированное имя. Вы по-прежнему можете выполнять поиск и сравнивать его с другими декорированными именами. Программы командной строки могут помочь найти и сравнить ожидаемое имя символа и фактическое имя символа:

Параметры /EXPORTS и /SYMBOLS программы командной строки DUMPBIN полезны здесь. Они могут помочь определить, какие символы определены в .dll и файлах объектов или библиотек. Можно использовать список символов, чтобы убедиться, что экспортированные декорированные имена соответствуют декорированным именам, которые ищет компоновщик.

В некоторых случаях Компоновщик может сообщать только о декорированном имени символа. Для получения недекорированной формы декорированного имени можно использовать программу командной строки UNDNAME.

Источник

#pragma once
#include «filt1.h»
//#include «filt_gen.h»

//extern void cf(double *h,int hsize,double fs, double f0, double sf, double ef, double *rcf, double *icf);
//extern int filt_gen(double lf,double hf,double* resp);
//extern int differ_gen(double lf,double* resp);

using namespace System;
using namespace System::ComponentModel;
using namespace System::Collections;
using namespace System::Windows::Forms;
using namespace System::Data;
using namespace System::Drawing;
using namespace ZedGraph;
//static int click;
//static double coordY[4][64], coordX[4][64];

extern double coordY[4][64], coordX[4][64];
extern bool canalOpen[5];
static double l1,l2[5],l3,t;
static short * pbf;
static int per, Canal;
extern int set_generator(int phase,int amplityde, int canal);
extern int set_amp(int att, int gain, int canal);
extern int set_frequency(double frequency, int freq_unit, int canal);
extern int set_compensator(int phase,int amplityde, int canal);
extern int get_amp1();
extern int balance(int canal);

namespace vihretok {
    /// <summary>
    /// Сводка для Def
    ///
    /// Внимание! При изменении имени этого класса необходимо также изменить
    ///          свойство имени файла ресурсов («Resource File Name») для средства компиляции управляемого ресурса,
    ///          связанного со всеми файлами с расширением .resx, от которых зависит данный класс. В противном случае,
    ///          конструкторы не смогут правильно работать с локализованными
    ///          ресурсами, сопоставленными данной форме.
    /// </summary>
    public ref class Def : public System::Windows::Forms::Form
    {
                public: void Load_Graw (void)
                        {
                                // Получим панель для рисования
                                ZedGraph::GraphPane ^myPane1 = zedGraphControl1>GraphPane;
                                // Очистим список кривых на тот случай, если до этого сигналы уже были нарисованы
                                //myPane1->CurveList->Clear();
                                //myPane1->GraphObjList->Clear();
                                //Запрет на самосогласования и выход за установленные границы
                                myPane1>XAxis>Scale>MaxGrace=0;
                                myPane1>XAxis>Scale>MinGrace=0;
                                myPane1>YAxis>Scale>MaxGrace=0;
                                myPane1>YAxis>Scale>MinGrace=0;
                                // Подписи к графику и к осям
                                // Установим размеры шрифтов для подписей по осям
                                myPane1>XAxis>Title>FontSpec>Size = 16;
                                myPane1>YAxis>Title>FontSpec>Size = 16;
                                // Установим размеры шрифта для легенды
                                myPane1>Legend>FontSpec>Size = 12;
                                // Установим размеры шрифта для общего заголовка
                                myPane1>Title>FontSpec>Size = 17;
                                myPane1>Title>FontSpec>FontColor=System::Drawing::Color::Brown;
                                myPane1>Title>Text = «Отклонение по X»;
                                myPane1>XAxis>Title>Text = «Измерение»;
                                myPane1>YAxis>Title>Text = «Отклонение»;
                                //Установка фона панели графиков (не рабочая часть)
                                myPane1>Fill>Color=System::Drawing::Color::LightBlue;
                                //Установка фона панели отображения графиков
                                myPane1>Chart>Fill = gcnew Fill( Color::White, Color::Aqua, 90 );
                                //Установка границы вывода графиков
                                myPane1>Chart>Border>Color=System::Drawing::Color::Black;
                                // Устанавливаем интересующий нас интервал по оси X
                                myPane1>XAxis>Scale>Min = l2[Convert::ToInt32(lCanal>Text)]2*t;
                                myPane1>XAxis>Scale>Max = l2[Convert::ToInt32(lCanal>Text)]+2*t;
                                //Ручная установка шага оси Х —  1 В
                                //myPane1->XAxis->Scale->MinorStep = 0.1;
                                myPane1>XAxis>Scale>MajorStep = 25;
                                // Устанавливаем интересующий нас интервал по оси Y — значения в мА от -10 до 100 мА
                                myPane1>YAxis>Scale>Min = t;
                                myPane1>YAxis>Scale>Max = t;
                                //myPane1->YAxis->Scale->MinorStep = 0.1;
                                myPane1>YAxis>Scale>MajorStep = 25;
                                //Установка оси «Y» ровно по оси «Х» 0.0
                                myPane1>XAxis>Cross = 0.0;
                                //Устанавливаем метки только возле осей!
                                myPane1>XAxis>MajorTic>IsOpposite = false;
                                myPane1>XAxis>MinorTic>IsOpposite = false;
                                myPane1>YAxis>MajorTic>IsOpposite = false;
                                myPane1>YAxis>MinorTic>IsOpposite = false;
                                //Рисуем сетку по X
                                myPane1>XAxis>MajorGrid>IsVisible=true;
                                myPane1>XAxis>MajorGrid>DashOn=20;
                                myPane1>XAxis>MajorGrid>DashOff=20;
                                myPane1>XAxis>MajorGrid>Color=System::Drawing::Color::Gray;
                                myPane1>XAxis>Color=System::Drawing::Color::Gray;
                                //Рисуем сетку по Y
                                myPane1>YAxis>MajorGrid>IsVisible=true;
                                myPane1>YAxis>MajorGrid>DashOn=20;
                                myPane1>YAxis>MajorGrid>DashOff=20;
                                myPane1>YAxis>MajorGrid>Color=System::Drawing::Color::Gray;
                                myPane1>YAxis>Color=System::Drawing::Color::Gray;

                                // Получим панель для рисования
                                ZedGraph::GraphPane ^myPane3 = zedGraphControl3>GraphPane;
                                // Очистим список кривых на тот случай, если до этого сигналы уже были нарисованы
                                //myPane2->CurveList->Clear();
                                //myPane2->GraphObjList->Clear();
                                //Запрет на самосогласования и выход за установленные границы
                                myPane3>XAxis>Scale>MaxGrace=0;
                                myPane3>XAxis>Scale>MinGrace=0;
                                myPane3>YAxis>Scale>MaxGrace=0;
                                myPane3>YAxis>Scale>MinGrace=0;
                                // Подписи к графику и к осям
                                // Установим размеры шрифтов для подписей по осям
                                myPane3>XAxis>Title>FontSpec>Size = 16;
                                myPane3>YAxis>Title>FontSpec>Size = 16;
                                // Установим размеры шрифта для легенды
                                myPane3>Legend>FontSpec>Size = 12;
                                // Установим размеры шрифта для общего заголовка
                                myPane3>Title>FontSpec>Size = 17;
                                myPane3>Title>FontSpec>FontColor=System::Drawing::Color::Brown;
                                myPane3>Title>Text = «Отклонение по Z»;
                                myPane3>XAxis>Title>Text = «Отклонение по Х»;
                                myPane3>YAxis>Title>Text = «Отклонение по Y»;
                                //Установка фона панели графиков (не рабочая часть)
                                myPane3>Fill>Color=System::Drawing::Color::LightBlue;
                                //Установка фона панели отображения графиков
                                myPane3>Chart>Fill = gcnew Fill( Color::White, Color::Aqua, 90 );
                                //Установка границы вывода графиков
                                myPane3>Chart>Border>Color=System::Drawing::Color::Black;
                                // Устанавливаем интересующий нас интервал по оси X
                                myPane3>XAxis>Scale>Min = t;
                                myPane3>XAxis>Scale>Max = t;
                                //Ручная установка шага оси Х —  1 В
                                //myPane1->XAxis->Scale->MinorStep = 0.1;
                                myPane3>XAxis>Scale>MajorStep = 25;
                                // Устанавливаем интересующий нас интервал по оси Y — значения в мА от -10 до 100 мА
                                myPane3>YAxis>Scale>Min = t;
                                myPane3>YAxis>Scale>Max = t;
                                //myPane1->YAxis->Scale->MinorStep = 0.1;
                                myPane3>YAxis>Scale>MajorStep = 25;
                                //Установка оси «Y» ровно по оси «Х» 0.0
                                myPane3>XAxis>Cross = 0.0;
                                //Устанавливаем метки только возле осей!
                                myPane3>XAxis>MajorTic>IsOpposite = false;
                                myPane3>XAxis>MinorTic>IsOpposite = false;
                                myPane3>YAxis>MajorTic>IsOpposite = false;
                                myPane3>YAxis>MinorTic>IsOpposite = false;
                                //Рисуем сетку по X
                                myPane3>XAxis>MajorGrid>IsVisible=true;
                                myPane3>XAxis>MajorGrid>DashOn=20;
                                myPane3>XAxis>MajorGrid>DashOff=20;
                                myPane3>XAxis>MajorGrid>Color=System::Drawing::Color::Gray;
                                myPane3>XAxis>Color=System::Drawing::Color::Gray;
                                //Рисуем сетку по Y
                                myPane3>YAxis>MajorGrid>IsVisible=true;
                                myPane3>YAxis>MajorGrid>DashOn=20;
                                myPane3>YAxis>MajorGrid>DashOff=20;
                                myPane3>YAxis>MajorGrid>Color=System::Drawing::Color::Gray;
                                myPane3>YAxis>Color=System::Drawing::Color::Gray;

                                // Получим панель для рисования
                                ZedGraph::GraphPane ^myPane2 = zedGraphControl2>GraphPane;
                                // Очистим список кривых на тот случай, если до этого сигналы уже были нарисованы
                                //myPane2->CurveList->Clear();
                                //myPane2->GraphObjList->Clear();
                                //Запрет на самосогласования и выход за установленные границы
                                myPane2>XAxis>Scale>MaxGrace=0;
                                myPane2>XAxis>Scale>MinGrace=0;
                                myPane2>YAxis>Scale>MaxGrace=0;
                                myPane2>YAxis>Scale>MinGrace=0;
                                // Подписи к графику и к осям
                                // Установим размеры шрифтов для подписей по осям
                                myPane2>XAxis>Title>FontSpec>Size = 16;
                                myPane2>YAxis>Title>FontSpec>Size = 16;
                                // Установим размеры шрифта для легенды
                                myPane2>Legend>FontSpec>Size = 12;
                                // Установим размеры шрифта для общего заголовка
                                myPane2>Title>FontSpec>Size = 17;
                                myPane2>Title>FontSpec>FontColor=System::Drawing::Color::Brown;
                                myPane2>Title>Text = «Отклонение по Y»;
                                myPane2>XAxis>Title>Text = «Измерение»;
                                myPane2>YAxis>Title>Text = «Отклонение»;
                                //Установка фона панели графиков (не рабочая часть)
                                myPane2>Fill>Color=System::Drawing::Color::LightBlue;
                                //Установка фона панели отображения графиков
                                myPane2>Chart>Fill = gcnew Fill( Color::White, Color::Aqua, 90 );
                                //Установка границы вывода графиков
                                myPane2>Chart>Border>Color=System::Drawing::Color::Black;
                                // Устанавливаем интересующий нас интервал по оси X
                                myPane2>XAxis>Scale>Min = l2[Convert::ToInt32(lCanal>Text)]t*2;
                                myPane2>XAxis>Scale>Max = l2[Convert::ToInt32(lCanal>Text)]+t*2;
                                //Ручная установка шага оси Х —  1 В
                                //myPane1->XAxis->Scale->MinorStep = 0.1;
                                myPane2>XAxis>Scale>MajorStep = 25;
                                // Устанавливаем интересующий нас интервал по оси Y — значения в мА от -10 до 100 мА
                                myPane2>YAxis>Scale>Min = t;
                                myPane2>YAxis>Scale>Max = t;
                                //myPane1->YAxis->Scale->MinorStep = 0.1;
                                myPane2>YAxis>Scale>MajorStep = 25;
                                //Установка оси «Y» ровно по оси «Х» 0.0
                                myPane2>XAxis>Cross = 0.0;
                                //Устанавливаем метки только возле осей!
                                myPane2>XAxis>MajorTic>IsOpposite = false;
                                myPane2>XAxis>MinorTic>IsOpposite = false;
                                myPane2>YAxis>MajorTic>IsOpposite = false;
                                myPane2>YAxis>MinorTic>IsOpposite = false;
                                //Рисуем сетку по X
                                myPane2>XAxis>MajorGrid>IsVisible=true;
                                myPane2>XAxis>MajorGrid>DashOn=20;
                                myPane2>XAxis>MajorGrid>DashOff=20;
                                myPane2>XAxis>MajorGrid>Color=System::Drawing::Color::Gray;
                                myPane2>XAxis>Color=System::Drawing::Color::Gray;
                                //Рисуем сетку по Y
                                myPane2>YAxis>MajorGrid>IsVisible=true;
                                myPane2>YAxis>MajorGrid>DashOn=20;
                                myPane2>YAxis>MajorGrid>DashOff=20;
                                myPane2>YAxis>MajorGrid>Color=System::Drawing::Color::Gray;
                                myPane2>YAxis>Color=System::Drawing::Color::Gray;

                                //******************************************************************************
                                // Добавляем информацию по регистрам вывода точек
                                //******************************************************************************
                                RollingPointPairList ^list1 = gcnew RollingPointPairList (64);
                                RollingPointPairList ^list2 = gcnew RollingPointPairList (64);
                                RollingPointPairList ^list3 = gcnew RollingPointPairList (64);
                                // Выводим пустые линии графиков на экран
                                LineItem ^F1Curve = myPane1>AddCurve( «», list1, Color::Indigo, SymbolType::None);
                                LineItem ^F2Curve = myPane2>AddCurve( «», list2, Color::Blue, SymbolType::None);
                                LineItem ^F3Curve = myPane3>AddCurve( «», list3, Color::BlueViolet, SymbolType::None);
                                //Ширина линии в 1/72 дюйма!!!!!!!!!! Хорошо получается при 2!!!!!!!!!
                                F1Curve>Line>Width=2;
                                F2Curve>Line>Width=2;
                                F3Curve>Line>Width=1;
                                //Задаем что линии гладкии!!!!!!!
                                F1Curve>Line>IsSmooth=true;
                                F2Curve>Line>IsSmooth=true;
                                F3Curve>Line>IsSmooth=true;
                                // Вызываем метод AxisChange (), чтобы обновить данные об осях.
                                // В противном случае на рисунке будет показана только часть графика,
                                // которая умещается в интервалы по осям, установленные по умолчанию
                                zedGraphControl1>AxisChange ();
                                zedGraphControl2>AxisChange ();
                                zedGraphControl3>AxisChange ();
                                // Обновляем график
                                zedGraphControl1>Invalidate();
                                zedGraphControl2>Invalidate();
                                zedGraphControl3>Invalidate();

                        }
        //График для функций
        public: void Graw_Draw (void)
                        {
                                //Получаем линии от графиков
                                LineItem ^F1Curve=(LineItem ^)zedGraphControl1>GraphPane>CurveList[0];
                                LineItem ^F2Curve=(LineItem ^)zedGraphControl2>GraphPane>CurveList[0];
                                LineItem ^F3Curve=(LineItem ^)zedGraphControl3>GraphPane>CurveList[0];
                                IPointListEdit ^list1= (IPointListEdit ^) F1Curve>Points;
                                IPointListEdit ^list2= (IPointListEdit ^) F2Curve>Points;
                                IPointListEdit ^list3= (IPointListEdit ^) F3Curve>Points;
                                //for (unsigned int i=0; i<200; i++)
                                //{
                                //  int x;
                                //  x=(i-10)*(i-10);
                                        list1>Add(l2[Convert::ToInt32(lCanal>Text)], l1);
                                        list2>Add(l2[Convert::ToInt32(lCanal>Text)], l3);
                                        list3>Add(l1, l3);
                                //}
                                // Вызываем метод AxisChange (), чтобы обновить данные об осях.
                                // В противном случае на рисунке будет показана только часть графика,
                                // которая умещается в интервалы по осям, установленные по умолчанию
                                zedGraphControl1>AxisChange ();
                                zedGraphControl2>AxisChange ();
                                zedGraphControl3>AxisChange();

                               
                               
                                // Обновляем график
                                zedGraphControl1>Invalidate();
                                zedGraphControl2>Invalidate();
                                //************************
                }
    public:
        Def(void)
        {
                    l1=0;
                    //l2[Canal]=0;
                    l3=0;
                    t=5;

            InitializeComponent();
            //
            //TODO: добавьте код конструктора
            //
        }

    protected:
        /// <summary>
        /// Освободить все используемые ресурсы.
        /// </summary>
        ~Def()
        {
            if (components)
            {
                delete components;
            }
        }
    private: System::Windows::Forms::TextBox^  tObj;
    protected:
    private: int click;
    private: Devart::Data::MySql::MySqlDataReader^  MySqlDataReader1;
    private: System::Windows::Forms::Button^  bSizeMinus;
    private: System::Windows::Forms::Button^  bStart;
    private: System::Windows::Forms::Button^  bSizePlus;
    private: System::Windows::Forms::Label^  lOut;
    private: System::Windows::Forms::Label^  lIn;
    private: System::Windows::Forms::NumericUpDown^  attIn;
    private: System::Windows::Forms::Label^  lPhase;
    private: System::Windows::Forms::Timer^  timer1;
    private: System::Windows::Forms::Label^  lObj;
    private: System::Windows::Forms::NumericUpDown^  attOut;
    private: System::Windows::Forms::Label^  lf;
    private: System::Windows::Forms::Label^  lAmp;
    private: System::Windows::Forms::Button^  bResize;
    private: System::Windows::Forms::Label^  lSettings;
    private: System::Windows::Forms::TextBox^  tf1;
    private: System::Windows::Forms::TextBox^  tPhase1;
    private: System::Windows::Forms::TextBox^  tAmp1;
    private: System::Windows::Forms::TrackBar^  fBar1;
    private: System::Windows::Forms::TrackBar^  phaseBar1;
    private: System::Windows::Forms::SplitContainer^  splitContainer1;
    private: ZedGraph::ZedGraphControl^  zedGraphControl3;
    private: ZedGraph::ZedGraphControl^  zedGraphControl2;
    private: ZedGraph::ZedGraphControl^  zedGraphControl1;
private: System::Windows::Forms::Label^  lCanal;
private: Devart::Data::MySql::MySqlConnection^  mySqlConnection1;
private: Devart::Data::MySql::MySqlCommand^  mySqlCommand1;
private: System::Windows::Forms::Label^  label2;
private: System::Windows::Forms::TrackBar^  trackBar1;
private: System::Windows::Forms::Label^  lObject;
private: System::Windows::Forms::Label^  lBase;
private: System::Windows::Forms::Button^  bStop;
private: System::Windows::Forms::Button^  bBalance;
private: System::Windows::Forms::Button^  bFilt;

    private: System::ComponentModel::IContainer^  components;

    private:
        /// <summary>
        /// Требуется переменная конструктора.
        /// </summary>

#pragma region Windows Form Designer generated code
        /// <summary>
        /// Обязательный метод для поддержки конструктора — не изменяйте
        /// содержимое данного метода при помощи редактора кода.
        /// </summary>
        void InitializeComponent(void)
        {
            this>components = (gcnew System::ComponentModel::Container());
            System::ComponentModel::ComponentResourceManager^  resources = (gcnew System::ComponentModel::ComponentResourceManager(Def::typeid));
            this>tObj = (gcnew System::Windows::Forms::TextBox());
            this>bSizeMinus = (gcnew System::Windows::Forms::Button());
            this>bStart = (gcnew System::Windows::Forms::Button());
            this>bSizePlus = (gcnew System::Windows::Forms::Button());
            this>lOut = (gcnew System::Windows::Forms::Label());
            this>lIn = (gcnew System::Windows::Forms::Label());
            this>attIn = (gcnew System::Windows::Forms::NumericUpDown());
            this>lPhase = (gcnew System::Windows::Forms::Label());
            this>timer1 = (gcnew System::Windows::Forms::Timer(this>components));
            this>lObj = (gcnew System::Windows::Forms::Label());
            this>attOut = (gcnew System::Windows::Forms::NumericUpDown());
            this>lf = (gcnew System::Windows::Forms::Label());
            this>lAmp = (gcnew System::Windows::Forms::Label());
            this>bResize = (gcnew System::Windows::Forms::Button());
            this>lSettings = (gcnew System::Windows::Forms::Label());
            this>tf1 = (gcnew System::Windows::Forms::TextBox());
            this>tPhase1 = (gcnew System::Windows::Forms::TextBox());
            this>tAmp1 = (gcnew System::Windows::Forms::TextBox());
            this>fBar1 = (gcnew System::Windows::Forms::TrackBar());
            this>phaseBar1 = (gcnew System::Windows::Forms::TrackBar());
            this>splitContainer1 = (gcnew System::Windows::Forms::SplitContainer());
            this>bFilt = (gcnew System::Windows::Forms::Button());
            this>bBalance = (gcnew System::Windows::Forms::Button());
            this>bStop = (gcnew System::Windows::Forms::Button());
            this>lBase = (gcnew System::Windows::Forms::Label());
            this>trackBar1 = (gcnew System::Windows::Forms::TrackBar());
            this>label2 = (gcnew System::Windows::Forms::Label());
            this>lCanal = (gcnew System::Windows::Forms::Label());
            this>zedGraphControl3 = (gcnew ZedGraph::ZedGraphControl());
            this>zedGraphControl2 = (gcnew ZedGraph::ZedGraphControl());
            this>zedGraphControl1 = (gcnew ZedGraph::ZedGraphControl());
            this>lObject = (gcnew System::Windows::Forms::Label());
            this>mySqlConnection1 = (gcnew Devart::Data::MySql::MySqlConnection());
            this>mySqlCommand1 = (gcnew Devart::Data::MySql::MySqlCommand());
            (cli::safe_cast<System::ComponentModel::ISupportInitialize^  >(this>attIn))>BeginInit();
            (cli::safe_cast<System::ComponentModel::ISupportInitialize^  >(this>attOut))>BeginInit();
            (cli::safe_cast<System::ComponentModel::ISupportInitialize^  >(this>fBar1))>BeginInit();
            (cli::safe_cast<System::ComponentModel::ISupportInitialize^  >(this>phaseBar1))>BeginInit();
            this>splitContainer1>Panel1>SuspendLayout();
            this>splitContainer1>Panel2>SuspendLayout();
            this>splitContainer1>SuspendLayout();
            (cli::safe_cast<System::ComponentModel::ISupportInitialize^  >(this>trackBar1))>BeginInit();
            this>SuspendLayout();
            //
            // tObj
            //
            this>tObj>Location = System::Drawing::Point(537, 14);
            this>tObj>Name = L«tObj»;
            this>tObj>Size = System::Drawing::Size(201, 20);
            this>tObj>TabIndex = 33;
            //
            // bSizeMinus
            //
            this>bSizeMinus>Font = (gcnew System::Drawing::Font(L«Microsoft Sans Serif», 12, System::Drawing::FontStyle::Regular, System::Drawing::GraphicsUnit::Point,
                static_cast<System::Byte>(204)));
            this>bSizeMinus>Location = System::Drawing::Point(472, 95);
            this>bSizeMinus>Name = L«bSizeMinus»;
            this>bSizeMinus>Size = System::Drawing::Size(34, 34);
            this>bSizeMinus>TabIndex = 32;
            this>bSizeMinus>Text = L«-«;
            this>bSizeMinus>UseVisualStyleBackColor = true;
            this>bSizeMinus>Click += gcnew System::EventHandler(this, &Def::bSizeMinus_Click);
            //
            // bStart
            //
            this>bStart>BackColor = System::Drawing::SystemColors::ButtonHighlight;
            this>bStart>Location = System::Drawing::Point(432, 33);
            this>bStart>Name = L«bStart»;
            this>bStart>Size = System::Drawing::Size(74, 25);
            this>bStart>TabIndex = 30;
            this>bStart>Text = L«СТАРТ»;
            this>bStart>UseVisualStyleBackColor = true;
            this>bStart>Click += gcnew System::EventHandler(this, &Def::bStart_Click);
            //
            // bSizePlus
            //
            this>bSizePlus>Font = (gcnew System::Drawing::Font(L«Microsoft Sans Serif», 12, System::Drawing::FontStyle::Regular, System::Drawing::GraphicsUnit::Point,
                static_cast<System::Byte>(204)));
            this>bSizePlus>Location = System::Drawing::Point(432, 95);
            this>bSizePlus>Name = L«bSizePlus»;
            this>bSizePlus>Size = System::Drawing::Size(34, 34);
            this>bSizePlus>TabIndex = 31;
            this>bSizePlus>Text = L«+»;
            this>bSizePlus>UseVisualStyleBackColor = true;
            this>bSizePlus>Click += gcnew System::EventHandler(this, &Def::bSizePlus_Click);
            //
            // lOut
            //
            this>lOut>AutoSize = true;
            this>lOut>Location = System::Drawing::Point(32, 95);
            this>lOut>Name = L«lOut»;
            this>lOut>Size = System::Drawing::Size(39, 13);
            this>lOut>TabIndex = 33;
            this>lOut>Text = L«Выход»;
            //
            // lIn
            //
            this>lIn>AutoSize = true;
            this>lIn>Location = System::Drawing::Point(32, 56);
            this>lIn>Name = L«lIn»;
            this>lIn>Size = System::Drawing::Size(31, 13);
            this>lIn>TabIndex = 32;
            this>lIn>Text = L«Вход»;
            //
            // attIn
            //
            this>attIn>Increment = System::Decimal(gcnew cli::array< System::Int32 >(4) {3, 0, 0, 0});
            this>attIn>Location = System::Drawing::Point(29, 72);
            this>attIn>Maximum = System::Decimal(gcnew cli::array< System::Int32 >(4) {45, 0, 0, 0});
            this>attIn>Name = L«attIn»;
            this>attIn>Size = System::Drawing::Size(45, 20);
            this>attIn>TabIndex = 30;
            this>attIn>ValueChanged += gcnew System::EventHandler(this, &Def::attIn_ValueChanged);
            //
            // lPhase
            //
            this>lPhase>AutoSize = true;
            this>lPhase>Location = System::Drawing::Point(83, 17);
            this>lPhase>Name = L«lPhase»;
            this>lPhase>Size = System::Drawing::Size(36, 13);
            this>lPhase>TabIndex = 28;
            this>lPhase>Text = L«Фаза»;
            //
            // timer1
            //
            this>timer1>Interval = 1;
            this>timer1>Tick += gcnew System::EventHandler(this, &Def::timer1_Tick);
            //
            // lObj
            //
            this>lObj>AutoSize = true;
            this>lObj>Location = System::Drawing::Point(426, 5);
            this>lObj>Name = L«lObj»;
            this>lObj>Size = System::Drawing::Size(105, 26);
            this>lObj>TabIndex = 34;
            this>lObj>Text = L«Название объекта rnдефектоскопии:»;
            //
            // attOut
            //
            this>attOut>Increment = System::Decimal(gcnew cli::array< System::Int32 >(4) {3, 0, 0, 0});
            this>attOut>Location = System::Drawing::Point(29, 109);
            this>attOut>Maximum = System::Decimal(gcnew cli::array< System::Int32 >(4) {45, 0, 0, 0});
            this>attOut>Name = L«attOut»;
            this>attOut>Size = System::Drawing::Size(45, 20);
            this>attOut>TabIndex = 31;
            this>attOut>ValueChanged += gcnew System::EventHandler(this, &Def::attOut_ValueChanged);
            //
            // lf
            //
            this>lf>AutoSize = true;
            this>lf>Location = System::Drawing::Point(128, 17);
            this>lf>Name = L«lf»;
            this>lf>Size = System::Drawing::Size(49, 13);
            this>lf>TabIndex = 29;
            this>lf>Text = L«Частота»;
            //
            // lAmp
            //
            this>lAmp>AutoSize = true;
            this>lAmp>Location = System::Drawing::Point(26, 17);
            this>lAmp>Name = L«lAmp»;
            this>lAmp>Size = System::Drawing::Size(62, 13);
            this>lAmp>TabIndex = 27;
            this>lAmp>Text = L«Амплитуда»;
            //
            // bResize
            //
            this>bResize>Location = System::Drawing::Point(3, 3);
            this>bResize>Name = L«bResize»;
            this>bResize>Size = System::Drawing::Size(22, 22);
            this>bResize>TabIndex = 26;
            this>bResize>Text = L«>»;
            this>bResize>UseVisualStyleBackColor = true;
            this>bResize>Click += gcnew System::EventHandler(this, &Def::bResize_Click);
            //
            // lSettings
            //
            this>lSettings>AutoSize = true;
            this>lSettings>Location = System::Drawing::Point(3, 25);
            this>lSettings>Name = L«lSettings»;
            this>lSettings>Size = System::Drawing::Size(15, 117);
            this>lSettings>TabIndex = 25;
            this>lSettings>Text = L«НrnАrnСrnТrnРrnОrnЙrnКrnИ»;
            this>lSettings>TextAlign = System::Drawing::ContentAlignment::TopCenter;
            //
            // tf1
            //
            this>tf1>Location = System::Drawing::Point(131, 33);
            this>tf1>Name = L«tf1»;
            this>tf1>Size = System::Drawing::Size(45, 20);
            this>tf1>TabIndex = 24;
            this>tf1>Text = L«500»;
            this>tf1>TextChanged += gcnew System::EventHandler(this, &Def::tf1_TextChanged);
            //
            // tPhase1
            //
            this>tPhase1>Location = System::Drawing::Point(80, 33);
            this>tPhase1>Name = L«tPhase1»;
            this>tPhase1>Size = System::Drawing::Size(45, 20);
            this>tPhase1>TabIndex = 23;
            this>tPhase1>Text = L«0»;
            this>tPhase1>TextChanged += gcnew System::EventHandler(this, &Def::tPhase1_TextChanged);
            //
            // tAmp1
            //
            this>tAmp1>Location = System::Drawing::Point(29, 33);
            this>tAmp1>Name = L«tAmp1»;
            this>tAmp1>Size = System::Drawing::Size(45, 20);
            this>tAmp1>TabIndex = 22;
            this>tAmp1>Text = L«0»;
            this>tAmp1>TextChanged += gcnew System::EventHandler(this, &Def::tAmp1_TextChanged);
            //
            // fBar1
            //
            this>fBar1>Location = System::Drawing::Point(131, 60);
            this>fBar1>Maximum = 1000;
            this>fBar1>Minimum = 10;
            this>fBar1>Name = L«fBar1»;
            this>fBar1>Orientation = System::Windows::Forms::Orientation::Vertical;
            this>fBar1>Size = System::Drawing::Size(45, 260);
            this>fBar1>TabIndex = 21;
            this>fBar1>TickStyle = System::Windows::Forms::TickStyle::Both;
            this>fBar1>Value = 500;
            this>fBar1>Scroll += gcnew System::EventHandler(this, &Def::fBar1_Scroll);
            //
            // phaseBar1
            //
            this>phaseBar1>Location = System::Drawing::Point(80, 60);
            this>phaseBar1>Maximum = 3600;
            this>phaseBar1>Name = L«phaseBar1»;
            this>phaseBar1>Orientation = System::Windows::Forms::Orientation::Vertical;
            this>phaseBar1>Size = System::Drawing::Size(45, 260);
            this>phaseBar1>TabIndex = 20;
            this>phaseBar1>TickStyle = System::Windows::Forms::TickStyle::Both;
            this>phaseBar1>Scroll += gcnew System::EventHandler(this, &Def::phaseBar1_Scroll);
            //
            // splitContainer1
            //
            this>splitContainer1>Dock = System::Windows::Forms::DockStyle::Fill;
            this>splitContainer1>Location = System::Drawing::Point(0, 0);
            this>splitContainer1>Name = L«splitContainer1»;
            //
            // splitContainer1.Panel1
            //
            this>splitContainer1>Panel1>Controls>Add(this>lOut);
            this>splitContainer1>Panel1>Controls>Add(this>lIn);
            this>splitContainer1>Panel1>Controls>Add(this>attOut);
            this>splitContainer1>Panel1>Controls>Add(this>attIn);
            this>splitContainer1>Panel1>Controls>Add(this>lf);
            this>splitContainer1>Panel1>Controls>Add(this>lPhase);
            this>splitContainer1>Panel1>Controls>Add(this>lAmp);
            this>splitContainer1>Panel1>Controls>Add(this>bResize);
            this>splitContainer1>Panel1>Controls>Add(this>lSettings);
            this>splitContainer1>Panel1>Controls>Add(this>tf1);
            this>splitContainer1>Panel1>Controls>Add(this>tPhase1);
            this>splitContainer1>Panel1>Controls>Add(this>tAmp1);
            this>splitContainer1>Panel1>Controls>Add(this>fBar1);
            this>splitContainer1>Panel1>Controls>Add(this>phaseBar1);
            this>splitContainer1>Panel1MinSize = 28;
            //
            // splitContainer1.Panel2
            //
            this>splitContainer1>Panel2>BackColor = System::Drawing::Color::PaleTurquoise;
            this>splitContainer1>Panel2>Controls>Add(this>bFilt);
            this>splitContainer1>Panel2>Controls>Add(this>bBalance);
            this>splitContainer1>Panel2>Controls>Add(this>bStop);
            this>splitContainer1>Panel2>Controls>Add(this>lBase);
            this>splitContainer1>Panel2>Controls>Add(this>trackBar1);
            this>splitContainer1>Panel2>Controls>Add(this>label2);
            this>splitContainer1>Panel2>Controls>Add(this>lCanal);
            this>splitContainer1>Panel2>Controls>Add(this>zedGraphControl3);
            this>splitContainer1>Panel2>Controls>Add(this>zedGraphControl2);
            this>splitContainer1>Panel2>Controls>Add(this>zedGraphControl1);
            this>splitContainer1>Panel2>Controls>Add(this>lObj);
            this>splitContainer1>Panel2>Controls>Add(this>tObj);
            this>splitContainer1>Panel2>Controls>Add(this>bSizeMinus);
            this>splitContainer1>Panel2>Controls>Add(this>bSizePlus);
            this>splitContainer1>Panel2>Controls>Add(this>bStart);
            this>splitContainer1>Panel2>Controls>Add(this>lObject);
            this>splitContainer1>Size = System::Drawing::Size(924, 555);
            this>splitContainer1>SplitterDistance = 28;
            this>splitContainer1>TabIndex = 5;
            //
            // bFilt
            //
            this>bFilt>Location = System::Drawing::Point(432, 135);
            this>bFilt>Name = L«bFilt»;
            this>bFilt>Size = System::Drawing::Size(72, 23);
            this>bFilt>TabIndex = 45;
            this>bFilt>Text = L«Фильтр»;
            this>bFilt>UseVisualStyleBackColor = true;
            this>bFilt>Click += gcnew System::EventHandler(this, &Def::bFilt_Click);
            //
            // bBalance
            //
            this>bBalance>Location = System::Drawing::Point(432, 164);
            this>bBalance>Name = L«bBalance»;
            this>bBalance>Size = System::Drawing::Size(73, 23);
            this>bBalance>TabIndex = 44;
            this>bBalance>Text = L«Баланс»;
            this>bBalance>UseVisualStyleBackColor = true;
            this>bBalance>Click += gcnew System::EventHandler(this, &Def::bBalance_Click);
            //
            // bStop
            //
            this>bStop>BackColor = System::Drawing::SystemColors::ButtonHighlight;
            this>bStop>Location = System::Drawing::Point(432, 64);
            this>bStop>Name = L«bStop»;
            this>bStop>Size = System::Drawing::Size(74, 25);
            this>bStop>TabIndex = 43;
            this>bStop>Text = L«СТОП»;
            this>bStop>UseVisualStyleBackColor = true;
            this>bStop>Click += gcnew System::EventHandler(this, &Def::bStop_Click);
            //
            // lBase
            //
            this>lBase>AutoSize = true;
            this>lBase>Location = System::Drawing::Point(565, 99);
            this>lBase>Name = L«lBase»;
            this>lBase>Size = System::Drawing::Size(33, 13);
            this>lBase>TabIndex = 42;
            this>lBase>Text = L«lBase»;
            this>lBase>Visible = false;
            //
            // trackBar1
            //
            this>trackBar1>BackColor = System::Drawing::Color::PaleTurquoise;
            this>trackBar1>Location = System::Drawing::Point(3, 498);
            this>trackBar1>Name = L«trackBar1»;
            this>trackBar1>Size = System::Drawing::Size(666, 45);
            this>trackBar1>TabIndex = 40;
            this>trackBar1>TickStyle = System::Windows::Forms::TickStyle::None;
            this>trackBar1>Visible = false;
            this>trackBar1>Scroll += gcnew System::EventHandler(this, &Def::trackBar1_Scroll);
            //
            // label2
            //
            this>label2>AutoSize = true;
            this>label2>Location = System::Drawing::Point(564, 81);
            this>label2>Name = L«label2»;
            this>label2>Size = System::Drawing::Size(35, 13);
            this>label2>TabIndex = 39;
            this>label2>Text = L«label1»;
            this>label2>Visible = false;
            //
            // lCanal
            //
            this>lCanal>AutoSize = true;
            this>lCanal>Location = System::Drawing::Point(564, 62);
            this>lCanal>Name = L«lCanal»;
            this>lCanal>Size = System::Drawing::Size(35, 13);
            this>lCanal>TabIndex = 38;
            this>lCanal>Text = L«label1»;
            this>lCanal>Visible = false;
            //
            // zedGraphControl3
            //
            this>zedGraphControl3>Location = System::Drawing::Point(429, 246);
            this>zedGraphControl3>Name = L«zedGraphControl3»;
            this>zedGraphControl3>ScrollGrace = 0;
            this>zedGraphControl3>ScrollMaxX = 0;
            this>zedGraphControl3>ScrollMaxY = 0;
            this>zedGraphControl3>ScrollMaxY2 = 0;
            this>zedGraphControl3>ScrollMinX = 0;
            this>zedGraphControl3>ScrollMinY = 0;
            this>zedGraphControl3>ScrollMinY2 = 0;
            this>zedGraphControl3>Size = System::Drawing::Size(240, 240);
            this>zedGraphControl3>TabIndex = 37;
            //
            // zedGraphControl2
            //
            this>zedGraphControl2>Location = System::Drawing::Point(3, 246);
            this>zedGraphControl2>Name = L«zedGraphControl2»;
            this>zedGraphControl2>ScrollGrace = 0;
            this>zedGraphControl2>ScrollMaxX = 0;
            this>zedGraphControl2>ScrollMaxY = 0;
            this>zedGraphControl2>ScrollMaxY2 = 0;
            this>zedGraphControl2>ScrollMinX = 0;
            this>zedGraphControl2>ScrollMinY = 0;
            this>zedGraphControl2>ScrollMinY2 = 0;
            this>zedGraphControl2>Size = System::Drawing::Size(420, 240);
            this>zedGraphControl2>TabIndex = 36;
            //
            // zedGraphControl1
            //
            this>zedGraphControl1>Location = System::Drawing::Point(3, 5);
            this>zedGraphControl1>Name = L«zedGraphControl1»;
            this>zedGraphControl1>ScrollGrace = 0;
            this>zedGraphControl1>ScrollMaxX = 0;
            this>zedGraphControl1>ScrollMaxY = 0;
            this>zedGraphControl1>ScrollMaxY2 = 0;
            this>zedGraphControl1>ScrollMinX = 0;
            this>zedGraphControl1>ScrollMinY = 0;
            this>zedGraphControl1>ScrollMinY2 = 0;
            this>zedGraphControl1>Size = System::Drawing::Size(420, 240);
            this>zedGraphControl1>TabIndex = 35;
            //
            // lObject
            //
            this>lObject>AutoSize = true;
            this>lObject>Location = System::Drawing::Point(537, 18);
            this>lObject>Name = L«lObject»;
            this>lObject>Size = System::Drawing::Size(0, 13);
            this>lObject>TabIndex = 41;
            //
            // mySqlConnection1
            //
            this>mySqlConnection1>ConnectionString = L«User Id=root;Host=localhost;Database=fazus_db;»;
            this>mySqlConnection1>Name = L«mySqlConnection1»;
            //
            // mySqlCommand1
            //
            this>mySqlCommand1>Connection = this>mySqlConnection1;
            this>mySqlCommand1>Name = L«mySqlCommand1»;
            //
            // Def
            //
            this>AutoScaleDimensions = System::Drawing::SizeF(6, 13);
            this>AutoScaleMode = System::Windows::Forms::AutoScaleMode::Font;
            this>BackColor = System::Drawing::Color::PaleTurquoise;
            this>ClientSize = System::Drawing::Size(924, 555);
            this>Controls>Add(this>splitContainer1);
            this>Icon = (cli::safe_cast<System::Drawing::Icon^  >(resources>GetObject(L«$this.Icon»)));
            this>Name = L«Def»;
            this>Text = L«Def»;
            this>Load += gcnew System::EventHandler(this, &Def::Def_Load);
            this>VisibleChanged += gcnew System::EventHandler(this, &Def::Def_Load);
            this>FormClosing += gcnew System::Windows::Forms::FormClosingEventHandler(this, &Def::Def_FormClosing);
            (cli::safe_cast<System::ComponentModel::ISupportInitialize^  >(this>attIn))>EndInit();
            (cli::safe_cast<System::ComponentModel::ISupportInitialize^  >(this>attOut))>EndInit();
            (cli::safe_cast<System::ComponentModel::ISupportInitialize^  >(this>fBar1))>EndInit();
            (cli::safe_cast<System::ComponentModel::ISupportInitialize^  >(this>phaseBar1))>EndInit();
            this>splitContainer1>Panel1>ResumeLayout(false);
            this>splitContainer1>Panel1>PerformLayout();
            this>splitContainer1>Panel2>ResumeLayout(false);
            this>splitContainer1>Panel2>PerformLayout();
            this>splitContainer1>ResumeLayout(false);
            (cli::safe_cast<System::ComponentModel::ISupportInitialize^  >(this>trackBar1))>EndInit();
            this>ResumeLayout(false);

        }
#pragma endregion
    private: System::Void Def_Load(System::Object^  sender, System::EventArgs^  e) {
            tPhase1>Text=Convert::ToString((float)phaseBar1>Value/10);
            tf1>Text=Convert::ToString(fBar1>Value);
            click=0;
/*          fd_set soc_insp;
            timeval insp_time;
            soc_insp.fd_count = 1;
            soc_insp.fd_array[0] = m_sock;
            insp_time.tv_sec = 0;
            insp_time.tv_usec = 10000*2;*/

/*          init_program();
            init_instrument();
            select(0, &soc_insp, NULL, NULL, &insp_time);
            this->Name;*/

            if(this>Name==«Can0») {
                Canal=0;
                lCanal>Text=«0»;
                this>Text=«Дефектоскопия, канал 1»;
            }
            if(this>Name==«Can1») {
                Canal=1;
                lCanal>Text=«1»;
                this>Text=«Дефектоскопия, канал 2»;
            }
            if(this>Name==«Can2») {
                Canal=2;
                lCanal>Text=«2»;
                this>Text=«Дефектоскопия, канал 3»;
            }
            if(this>Name==«Can3») {
                Canal=3;
                lCanal>Text=«3»;
                this>Text=«Дефектоскопия, канал 4»;
            }
            if(this>Name!=«Can0»&&this>Name!=«Can1»&&this>Name!=«Can2»&&this>Name!=«Can3») {
                Canal=99;
                l2[4]=0;
                trackBar1>Value=(int)l2[4];
                lCanal>Text=«4»;
                bBalance>Visible=false;
                lBase>Text=this>Name;
                tObj>Visible=false;
                bResize>Visible=false;
                lSettings>Visible=false;
                bFilt>Visible=false;
                this>Text=«Дефектоскопия, архив»;
                trackBar1>Visible=true;

               
                mySqlCommand1>CommandText=«select X from`»+lBase>Text+«`;»;
                mySqlConnection1>Open();
                MySqlDataReader1 = mySqlCommand1>ExecuteReader();
                while(MySqlDataReader1>Read())
                {
                }
                trackBar1>Maximum=Convert::ToInt16(MySqlDataReader1>RecordCount::get());
                mySqlCommand1>CommandText=«select `obj` from`obj` where `database`='»+lBase>Text+«‘;»;
                MySqlDataReader1 = mySqlCommand1>ExecuteReader();
                    while(MySqlDataReader1>Read())
                    {
                    for (int i = 0; i < MySqlDataReader1>FieldCount; i++)
                    {
                    lObject>Text=MySqlDataReader1>GetValue(i)>ToString();
                    }
                }
                mySqlConnection1>Close();
            }
            canalOpen[Convert::ToInt32(lCanal>Text)]=false;
            this>Load_Graw();
             }
private: System::Void tAmp1_TextChanged(System::Object^  sender, System::EventArgs^  e) {
             set_generator(phaseBar1>Value,Convert::ToInt32(tAmp1>Text),Convert::ToInt32(lCanal>Text));
             set_compensator(phaseBar1>Value,Convert::ToInt32(tAmp1>Text),Convert::ToInt32(lCanal>Text));
             set_amp(Convert::ToInt32(attIn>Text)/3,Convert::ToInt32(attOut>Text)/3,Convert::ToInt32(lCanal>Text));
             set_frequency(fBar1>Value,1,Convert::ToInt32(lCanal>Text));
         }
private: System::Void tf1_TextChanged(System::Object^  sender, System::EventArgs^  e) {
             fBar1>Value=Convert::ToInt32(tf1>Text);
             set_frequency(fBar1>Value,1,Convert::ToInt32(lCanal>Text));

         }
private: System::Void tPhase1_TextChanged(System::Object^  sender, System::EventArgs^  e) {
             set_generator(phaseBar1>Value,Convert::ToInt32(tAmp1>Text),Convert::ToInt32(lCanal>Text));
             set_compensator(phaseBar1>Value,Convert::ToInt32(tAmp1>Text),Convert::ToInt32(lCanal>Text));
             set_amp(Convert::ToInt32(attIn>Text)/3,Convert::ToInt32(attOut>Text)/3,Convert::ToInt32(lCanal>Text));
             set_frequency(fBar1>Value,1,Convert::ToInt32(lCanal>Text));
         }
private: System::Void phaseBar1_Scroll(System::Object^  sender, System::EventArgs^  e) {
             tPhase1>Text=Convert::ToString((float)phaseBar1>Value/10);
         }
private: System::Void fBar1_Scroll(System::Object^  sender, System::EventArgs^  e) {
             tf1>Text=Convert::ToString(fBar1>Value);
         }

private: System::Void bResize_Click(System::Object^  sender, System::EventArgs^  e) {
                 click++;
                 if(click%2){
                     splitContainer1>SplitterDistance=tf1>Width+tf1>Left+3;
                     bResize>Text=«<«;
                 }
                 else{
                     splitContainer1>SplitterDistance=bResize>Width;
                     bResize>Text=«>»;
                 }

         }
private: System::Void attIn_ValueChanged(System::Object^  sender, System::EventArgs^  e) {
             tAmp1>Text=Convert::ToString(get_amp1());
             set_generator(phaseBar1>Value,Convert::ToInt32(tAmp1>Text),Convert::ToInt32(lCanal>Text));
             set_compensator(phaseBar1>Value,Convert::ToInt32(tAmp1>Text),Convert::ToInt32(lCanal>Text));
             set_amp(Convert::ToInt32(attIn>Text)/3,Convert::ToInt32(attOut>Text)/3,Convert::ToInt32(lCanal>Text));
         }
private: System::Void attOut_ValueChanged(System::Object^  sender, System::EventArgs^  e) {
             tAmp1>Text=Convert::ToString(get_amp1());
             set_generator(phaseBar1>Value,Convert::ToInt32(tAmp1>Text),Convert::ToInt32(lCanal>Text));
             set_compensator(phaseBar1>Value,Convert::ToInt32(tAmp1>Text),Convert::ToInt32(lCanal>Text));
             set_amp(Convert::ToInt32(attIn>Text)/3,Convert::ToInt32(attOut>Text)/3,Convert::ToInt32(lCanal>Text));
         }
private: System::Void timer1_Tick(System::Object^  sender, System::EventArgs^  e) {
             if(this>Name!=«Can0»&&this>Name!=«Can1»&&this>Name!=«Can2»&&this>Name!=«Can3»)
             {//алгоритм вывода из базы
                if(lObject>Text!=«»){
                int z;
                l2[4]=trackBar1>Value;
                if(trackBar1>Value<64){
                    z=0;
                }
                else{
                    z=trackBar1>Value64;
                }
                timer1>Interval=42;
                //timer1->Interval=65;
                //timer1->Interval=1;
                l2[4]=++l2[4];
                trackBar1>Value=Convert::ToInt32(l2[4]);
                if(l2[4]>trackBar1>Maximum2){
                            timer1>Enabled=false;
                        }      
                mySqlCommand1>CommandText = «select `X` from`»+lBase>Text+«` where `id`=»+trackBar1>Value+«;»;
                mySqlConnection1>Open();
                MySqlDataReader1 = mySqlCommand1>ExecuteReader();
                while(MySqlDataReader1>Read())
                {
                    for (int i = 0; i < MySqlDataReader1>FieldCount; i++)
                    {
                        l1=Convert::ToDouble(MySqlDataReader1>GetValue(i)>ToString());
                        if(l2[4]>trackBar1>Maximum2){
                            break;
                            timer1>Enabled=false;
                        }
                        per++;
                        if(per>=64){
                        per=0;};
                        if(l1>t) t=t+2.5;
                        if(l3>t) t=t+2.5;
                        if(l1<t) t=t+2.5;
                        if(l3<t) t=t+2.5;
                    }
                }
                mySqlCommand1>CommandText = «select `Y` from`»+lBase>Text+«` where `id`=»+trackBar1>Value+«;»;
                mySqlConnection1>Open();
                MySqlDataReader1 = mySqlCommand1>ExecuteReader();
                while(MySqlDataReader1>Read())
                {
                    for (int i = 0; i < MySqlDataReader1>FieldCount; i++)
                    {
                        l3=Convert::ToDouble(MySqlDataReader1>GetValue(i)>ToString());
                        if(l2[4]>trackBar1>Maximum2){
                            break;
                            timer1>Enabled=false;
                        }
                        per++;
                        if(per>=64){
                        per=0;};
                        if(l1>t) t=t+2.5;
                        if(l3>t) t=t+2.5;
                        if(l1<t) t=t+2.5;
                        if(l3<t) t=t+2.5;
                    }
                }
                Load_Graw();
                Graw_Draw();
                mySqlConnection1>Close();
             }
             }
             else
             {
                     l1=coordX[Convert::ToInt32(lCanal>Text)][per]/1000;
                     l3=coordY[Convert::ToInt32(lCanal>Text)][per]/1000;
                     this>Load_Graw();
                     this>Graw_Draw();
                     l2[Convert::ToInt32(lCanal>Text)]=++l2[Convert::ToInt32(lCanal>Text)];
                     mySqlCommand1>CommandText = «insert into `»+label2>Text+«`(`X`,`Y`) values (‘»+Convert::ToString(l1)+«‘,'»+Convert::ToString(l3)+«‘);»;
                     mySqlConnection1>Open();
                     mySqlCommand1>ExecuteNonQuery();
                     per++;
                     if(per>=64){
                     per=0;};
                     if(l1>t) t=t+2.5;
                     if(l3>t) t=t+2.5;
                     if(l1<t) t=t+2.5;
                     if(l3<t) t=t+2.5;
             }

           
           
         }
private: System::Void bStart_Click(System::Object^  sender, System::EventArgs^  e) {
            if((tObj>Text!=«»)&&(tObj>Text!=«Enter the name of the object inspection»)&&(this>Name==«Can0»||this>Name==«Can1»||this>Name==«Can2»||this>Name==«Can3»)){
                timer1>Interval=1;
            DateTime date1;
            date1=DateTime::Now;
            mySqlCommand1>CommandText = «create table `»+Convert::ToString(date1.Day)+«_»+Convert::ToString(date1.Month)+«_»+Convert::ToString(date1.Year)+«_»+Convert::ToString(date1.Hour)+«_»+Convert::ToString(date1.Minute)+«_»+Convert::ToString(date1.Second)+«`(`ID` int(10) AUTO_INCREMENT,`X` char(10),`Y` char(10), `step` int(10), PRIMARY KEY(`ID`));»;
            mySqlConnection1>Open();
            label2>Text=Convert::ToString(date1.Day)+«_»+Convert::ToString(date1.Month)+«_»+Convert::ToString(date1.Year)+«_»+Convert::ToString(date1.Hour)+«_»+Convert::ToString(date1.Minute)+«_»+Convert::ToString(date1.Second);
            mySqlCommand1>ExecuteNonQuery();
            mySqlCommand1>CommandText = «insert into `obj`(`OBJ`,`database`) values (‘»+tObj>Text+«‘,'»+label2>Text+«‘);»;
            mySqlCommand1>ExecuteNonQuery();
            timer1>Enabled=true;
            mySqlConnection1>Close();
            }
            else
            {
                tObj>Text=«Enter the name of the object inspection»;
            }
            if((lObject>Text!=«»)&&(trackBar1>Value<trackBar1>Maximum2)){
            timer1>Enabled=true;
            l2[4]=trackBar1>Value;
            }
/*          if(lObject->Text!=»»){
                int z;
                l2[4]=trackBar1->Value;
                if(trackBar1->Value<64){
                    z=0;
                }
                else{
                    z=trackBar1->Value-64;
                }
                mySqlCommand1->CommandText = «select `X` from`»+lBase->Text+»` where `id`<«+trackBar1->Value+» and `id`>=»+z+»;»;
                mySqlConnection1->Open();
                MySqlDataReader1 = mySqlCommand1->ExecuteReader();
                while(MySqlDataReader1->Read())
                {
                    for (int i = 0; i < MySqlDataReader1->FieldCount; i++)
                    {
                        l1=Convert::ToDouble(MySqlDataReader1->GetValue(i)->ToString());
                        l2[4]=++l2[4];
                        trackBar1->Value=Convert::ToInt32(l2[4]);
                        per++;
                        if(per>=64){
                        per=0;};
                        if(l1>t) t=t+2.5;
                        if(l3>t) t=t+2.5;
                        if(l1<-t) t=t+2.5;
                        if(l3<-t) t=t+2.5;
                    }
                }
            mySqlConnection1->Close();
            timer1->Enabled=true;*/

        //  }
         }
private: System::Void bSizePlus_Click(System::Object^  sender, System::EventArgs^  e) {
             t=t2.5;
         }
private: System::Void bSizeMinus_Click(System::Object^  sender, System::EventArgs^  e) {
             t=t+2.5;
         }
private: System::Void trackBar1_Scroll(System::Object^  sender, System::EventArgs^  e) {
             if(!timer1>Enabled){
                int z;
                l2[4]=trackBar1>Value;
                if(trackBar1>Value<64){
                    z=0;
                }
                else{
                    z=trackBar1>Value64;
                }
                l2[4]=++l2[4];
                mySqlCommand1>CommandText = «select `X` from`»+lBase>Text+«` where `id`<«+trackBar1>Value+» and `id`>»+z+«;»;
                mySqlConnection1>Open();
                MySqlDataReader1 = mySqlCommand1>ExecuteReader();
                while(MySqlDataReader1>Read())
                {
                    for (int i = 0; i < MySqlDataReader1>FieldCount; i++)
                    {
                        l1=Convert::ToDouble(MySqlDataReader1>GetValue(i)>ToString());
                        per++;
                        if(per>=64){
                        per=0;};
                        if(l1>t) t=t+2.5;
                        if(l3>t) t=t+2.5;
                        if(l1<t) t=t+2.5;
                        if(l3<t) t=t+2.5;
                    }
                }
                mySqlCommand1>CommandText = «select `Y` from`»+lBase>Text+«` where `id`=»+trackBar1>Value+«;»;
                mySqlConnection1>Open();
                MySqlDataReader1 = mySqlCommand1>ExecuteReader();
                while(MySqlDataReader1>Read())
                {
                    for (int i = 0; i < MySqlDataReader1>FieldCount; i++)
                    {
                        l3=Convert::ToDouble(MySqlDataReader1>GetValue(i)>ToString());
                        per++;
                        if(per>=64){
                        per=0;};
                        if(l1>t) t=t+2.5;
                        if(l3>t) t=t+2.5;
                        if(l1<t) t=t+2.5;
                        if(l3<t) t=t+2.5;
                    }
                }
                Load_Graw();
                Graw_Draw();
                mySqlConnection1>Close();
                }
         }
private: System::Void bStop_Click(System::Object^  sender, System::EventArgs^  e) {
             timer1>Enabled=false;
         }
private: System::Void bBalance_Click(System::Object^  sender, System::EventArgs^  e) {
                balance(Convert::ToInt32(lCanal>Text));
         }
private: System::Void bFilt_Click(System::Object^  sender, System::EventArgs^  e) {
             filt1^ gfilt = gcnew filt1;
             gfilt>Show();
         }
private: System::Void Def_FormClosing(System::Object^  sender, System::Windows::Forms::FormClosingEventArgs^  e) {
             canalOpen[Convert::ToInt32(lCanal>Text)]=true;
         }
};
}
//Convert::ToInt32(lCanal)
/*          mySqlInsertData->CommandText = «insert into `»+label2->Text+»`(`X`,`Y`, `step`) values (‘»+textBox1->Text+»‘,'»+textBox2->Text+»‘,'»+textBox3->Text+»‘);»;
            label1->Text=mySqlInsertData->CommandText;
            mySqlInsertData->ExecuteNonQuery();
*/

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

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

  • Ошибка lnk1169 обнаружен многократно определенный символ один или более
  • Ошибка ls 0009 фортнайт
  • Ошибка lnk1120 неразрешенных внешних элементов 1
  • Ошибка lp на газовом котле kentatsu furst
  • Ошибка lnb short

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

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