Ошибка e0304 visual studio

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
#include <iostream>
#include <iomanip>
#include <functional>
#include <vector>
#include <boost/multiprecision/cpp_bin_float.hpp>
 
using namespace boost::multiprecision;
using namespace std;
 
typedef number<cpp_bin_float<200>> cpp_dec_float_unlim;
 
#define double cpp_dec_float_unlim
 
double dy0dt(const double& t, const double& y_0, const double& y_1, const double& y_2, const double& y_3, double& alpha) {
   return double(8.85e4) - y_2*y_0*((double(0.2) - y_0) / (double(1.) - y_1)) + y_0 / double(1e-8);
}
 
double dy1dt(const double& t, const double& y_0, const double& y_1, const double& y_2, const double& y_3, double& alpha) {
   return y_0 * y_2;
}
 
double dy2dt(const double& t, const double& y_0, const double& y_1, const double& y_2, const double& y_3, double& alpha) {
    return y_0 * y_3;
}
 
double dy3dt(const double& t, const double& y_0, const double& y_1, const double& y_2, const double& y_3, double& alpha) {
   return double(1e30)*sqrt(y_0)*exp(double(-alpha) / y_0);
}
 
struct my_data { 
 
    double t, y_0, y_1, y_2, y_3;
    my_data(double _t, double _y0, double _y1, double _y2, double _y3) : t(_t), y_0(_y0), y_1(_y1), y_2(_y2), y_3(_y3) {}
 
};
 
void rungeKutta( double y0, double y1, double y2, double y3, double t0, double max_t, double h, double alpha, std::vector<my_data>& result){
 
   double k1[4], k2[4], k3[4], k4[4];
 
   double t = t0;
 
   std::vector<std::function<double(double, double, double, double, double, double) >> vfunc;
   vfunc.push_back(dy0dt);
   vfunc.push_back(dy1dt);
   vfunc.push_back(dy2dt);
   vfunc.push_back(dy3dt);
 
   for (int i = 0; i < ((max_t - t0) / h); i++) {
 
      std::cout << t << "t" << std::setprecision(5) << y0 << "t" << y1 << "t" << y2 << "t" << y3 << std::endl;
 
      for (int j = 0; j < 4; ++j) {
         k1[j] = h*vfunc[j](t, y0, y1, y2, y3, alpha);
      }
 
      for (int j = 0; j < 4; ++j) {
         k2[j] = h*vfunc[j](t + double(0.5)*h, y0 + double(0.5)*k1[0], y1 + double(0.5)*k1[1], y2 + double(0.5)*k1[2], y3 + double(0.5)*k1[3], alpha);
      }
 
      for (int j = 0; j < 4; ++j) {
         k3[j] = h*vfunc[j](t + double(0.5)*h, y0 + double(0.5)*k2[0], y1 + double(0.5)*k2[1], y2 + double(0.5)*k2[2], y3 + double(0.5)*k3[3], alpha);
      }
 
      for (int j = 0; j < 4; ++j) {
         k4[j] = h*vfunc[j](t + h, y0 + k3[0], y1 + k3[1], y2 + k3[2], y3 + k3[3], alpha);
      }
 
      y0 += (k1[0] + double(2.) * k2[0] + double(2.) * k3[0] + k4[0]) / double(6.);
      y1 += (k1[1] + double(2.) * k2[1] + double(2.) * k3[1] + k4[1]) / double(6.);
      y2 += (k1[2] + double(2.) * k2[2] + double(2.) * k3[2] + k4[2]) / double(6.);
      y3 += (k1[3] + double(2.) * k2[3] + double(2.) * k3[3] + k4[3]) / double(6.);
 
      t = t + h;
   }
   
   result.emplace_back(t, y0, y1, y2, y3);
 
}
 
void foo() {
 
    double y_0, y_1, y_2, y_3, alpha;
 
    std::cout << "Input y_0: "; std::cin >> y_0; // 1e-10
    std::cout << "Input y_1: "; std::cin >> y_1; // 0
    std::cout << "Input y_2: "; std::cin >> y_2; // 0
    std::cout << "Input y_3: "; std::cin >> y_3; // 0
    std::cout << "Input alpha: "; std::cin >> alpha; //0.25
 
    double beg_time, max_time;
 
    std::cout << "Input beg_time: "; std::cin >> beg_time; // 0
    cout << "Input max_time: "; std::cin >> max_time; // 1.1e-8
 
    double step;
 
    cout << "Input step: "; std::cin >> step; // 1e-9
    
    vector<my_data> result;
    cout << "Runge-Kutta method: " << endl;
    rungeKutta(y_0, y_1, y_2, y_3, beg_time, max_time, step, alpha, result);
 
    double a, b, e, xmin;
    cout << "Input a: "; cin >> a;   // 8e-2
    cout << "Input b: "; cin >> b;   // 5e-1
    cout << "Input eps: "; cin >> e; // 1e-3
 
    cout << "Gold method: " << endl;
    Gold(a, b, e, xmin);
    cout << endl;
 
}
 
/******************************************************************************************************************/
 
int main(){
    foo();
 
    system("pause");
    return 0;
}

So we have this old project that was originally written in MSVC 6.0. The language standards are mostly C-based, although we’ve moved the project over to C++ v17 on VS2017. This project compiled just fine before the latest VS update.

After updating VS to 15.7.0 (and adding the Windows 10 SDK 10.0.17134), the project will still compile, but Intellisense drops hundreds of E0304 errors like the following:

Severity	Code	Source	        Description	
Error (active)	E0304	IntelliSense	no instance of function template "__countof_helper" matches the argument list	
  

Every single one of these calls (or at least every one I looked at) was calling
_countof like this snippet:

TCHAR ErrMsg[ERR_MSG_SIZE] = { (TCHAR)NULL };

...

FormatErrorString(GetLastError(), ErrMsg, _countof(ErrMsg), true);

If I try to «Show Error Help» on the error in the error list, it does nothing.

Has anyone else run into this or have some advice on why or how this has occurred?

Additionally, if it helps…

This project is:

— Targeting Windows 10 as a platform

— 10.0.17134.0 as the Windows SDK Version

— has 64-bit config (UNICODE defined) and 32-bit config (UNICODE
not
defined) profiles

— using «C++ 17 Standard» as the C++ Language Standard

— does not use MFC or CLR

I can include all the miscellaneous options if that helps, but I think that covers the major variables. Some of these options are intentional due to certain constraints in our software environment and/or integration requirements.

Thanks for any feedback.

Не понимаю, откуда эта ошибка появляется. Уже изучил, почему она может вызываться, но мне это никак не помогло в поиске/решении проблемы. Что надо сделать?
Код с реализацией функций:

#pragma once

#include <vector>
#include <iostream>
#include <random>

template <typename T>
void create_huge_matrix(std::vector<std::vector<T>>& matrix, T lowerLimit);
template <typename T>
void create_freeMatrixColumn(std::vector<T>& freeMatrixColumn);

template <typename T>
inline void create_huge_matrix(std::vector<std::vector<T>>& matrix, T lowerLimit)
{
	//std::vector<std::vector<T>> huge_matrix;
	std::random_device random_device; // Источник энтропии
	std::mt19937 generator(random_device()); // Генератор случайных чисел
	std::uniform_int_distribution<> distribution(lowerLimit, lowerLimit * 2);

	for (int i = 0; i < matrix[0].size(); i++)
	{
		for (int j = 0; j < matrix[0].size(); j++)
		{
			if (i == j) matrix[i][j] = distribution(generator);
			else matrix[i][j] = rand() % 2;
		}
	}
}

template <typename T>
inline void create_freeMatrixColumn(std::vector<T> &freeMatrixColumn)
{
	for (int i = 0; i < size; i++)
		freeMatrixColumn[i] = (rand() % 100) / 10;
}

Часть кода из функции main.cpp (где вызываю/есть ошибка):

#include <iostream>
#include <vector>
#include <cmath>
#include "gauss_serial.h"
#include "gauss_parallel.h"
#include "huge_matrix.h"

bool check_answer(std::vector<double> answer, std::vector<double> freeMatrixCloumn, std::vector<std::vector<double>> matrix);
void create_new_freeColumn(std::vector<double>& v, std::vector<double>& answer, std::vector<std::vector<double>> matrix);
void keep_4_digits_after_point(std::vector<double>& v);

int main()
{
    setlocale(LC_ALL, "utf-8");

    int m; // количество строк
    int n; // количество столбцов
    double value; // значение элемента массива
    std::vector<std::vector<double>> matrix_s, matrix_p, matrixForChecking; // матрица элементов без столбца свободных членов
    std::vector<double> freeMatrixColumn_s, freeMatrixColumn_p, freeMatrixColumnForChecking; // столбец свободных членов

    printf("Решение СЛАУ методом Гауссаn");
    // Задаём размерность матрицы
    printf("Укажите размерность матрицыn");
    printf("Количество строк: ");
    std::cin >> m;
    matrix_s.resize(m);
    matrix_p.resize(m);
    matrixForChecking.resize(m);
    printf("Количество столбцов: ");
    std::cin >> n;

    create_huge_matrix(matrix_s, 5);
    create_huge_matrix(matrix_p);
    create_huge_matrix(matrixForChecking);

DisplayMap.insert(i, map[i]);

As you can see in the above sample, I’ve tried to use the insert function, but it keeps displaying the same E0304 Error, which is for an overloaded function. In VS2019, the error details are:

Severity    Code    Description Project File    Line    Suppression State
Error (active)  E0304   no instance of overloaded function "std::basic_string<_Elem, _Traits, _Alloc>::insert [with _Elem=char, _Traits=std::char_traits<char>, _Alloc=std::allocator<char>]" matches the argument list

The error says that the arguments don’t match because the different overloads have different arguments.
Can you help me solve this error?
Here’s my full code if you need it:

#include <stdlib.h>
#include <stdio.h>
#include <iostream>
#include <Windows.h>
#include <conio.h>
#include <algorithm>
#include <string>
#include "Data.h"
using namespace std;

int main() {
    SetConsoleDisplayMode(GetStdHandle(STD_OUTPUT_HANDLE), CONSOLE_FULLSCREEN_MODE, 0);
    CONSOLE_SCREEN_BUFFER_INFO csbi;
    int WindowColumns, WindowRows, DisplayBuffer;
    string DisplayMap;
    GetConsoleScreenBufferInfo(GetStdHandle(STD_OUTPUT_HANDLE), &csbi);
    WindowColumns = csbi.srWindow.Right - csbi.srWindow.Left + 1;
    WindowRows = csbi.srWindow.Bottom - csbi.srWindow.Top + 1;
    cout << WindowColumns << "," << WindowRows;
    DisplayBuffer = WindowColumns * WindowRows;
    for (int i = 0; i < WindowColumns; i++) {
        DisplayMap.insert(i, map[i]);
    }
    return 0;
}

Thanks In advance.

EDIT:
Data.h here:

#pragma once

#include <iostream>
#include <String>
using namespace std;
string savedMap = "                              "
"                              "
"                              "
"                              "
"                              ";
string map = savedMap;
int w = 119, a = 97, s = 115, d = 100;
char key_press;
int myPOS = 35;
int MDPOS = myPOS, ascii_value;

Please don’t ask me why I use the namespace std in a header file.

DisplayMap.insert(i, map[i]);

As you can see in the above sample, I’ve tried to use the insert function, but it keeps displaying the same E0304 Error, which is for an overloaded function. In VS2019, the error details are:

Severity    Code    Description Project File    Line    Suppression State
Error (active)  E0304   no instance of overloaded function "std::basic_string<_Elem, _Traits, _Alloc>::insert [with _Elem=char, _Traits=std::char_traits<char>, _Alloc=std::allocator<char>]" matches the argument list

The error says that the arguments don’t match because the different overloads have different arguments.
Can you help me solve this error?
Here’s my full code if you need it:

#include <stdlib.h>
#include <stdio.h>
#include <iostream>
#include <Windows.h>
#include <conio.h>
#include <algorithm>
#include <string>
#include "Data.h"
using namespace std;

int main() {
    SetConsoleDisplayMode(GetStdHandle(STD_OUTPUT_HANDLE), CONSOLE_FULLSCREEN_MODE, 0);
    CONSOLE_SCREEN_BUFFER_INFO csbi;
    int WindowColumns, WindowRows, DisplayBuffer;
    string DisplayMap;
    GetConsoleScreenBufferInfo(GetStdHandle(STD_OUTPUT_HANDLE), &csbi);
    WindowColumns = csbi.srWindow.Right - csbi.srWindow.Left + 1;
    WindowRows = csbi.srWindow.Bottom - csbi.srWindow.Top + 1;
    cout << WindowColumns << "," << WindowRows;
    DisplayBuffer = WindowColumns * WindowRows;
    for (int i = 0; i < WindowColumns; i++) {
        DisplayMap.insert(i, map[i]);
    }
    return 0;
}

Thanks In advance.

EDIT:
Data.h here:

#pragma once

#include <iostream>
#include <String>
using namespace std;
string savedMap = "                              "
"                              "
"                              "
"                              "
"                              ";
string map = savedMap;
int w = 119, a = 97, s = 115, d = 100;
char key_press;
int myPOS = 35;
int MDPOS = myPOS, ascii_value;

Please don’t ask me why I use the namespace std in a header file.

DisplayMap.insert(i, map[i]);

As you can see in the above sample, I’ve tried to use the insert function, but it keeps displaying the same E0304 Error, which is for an overloaded function. In VS2019, the error details are:

Severity    Code    Description Project File    Line    Suppression State
Error (active)  E0304   no instance of overloaded function "std::basic_string<_Elem, _Traits, _Alloc>::insert [with _Elem=char, _Traits=std::char_traits<char>, _Alloc=std::allocator<char>]" matches the argument list

The error says that the arguments don’t match because the different overloads have different arguments.
Can you help me solve this error?
Here’s my full code if you need it:

#include <stdlib.h>
#include <stdio.h>
#include <iostream>
#include <Windows.h>
#include <conio.h>
#include <algorithm>
#include <string>
#include "Data.h"
using namespace std;

int main() {
    SetConsoleDisplayMode(GetStdHandle(STD_OUTPUT_HANDLE), CONSOLE_FULLSCREEN_MODE, 0);
    CONSOLE_SCREEN_BUFFER_INFO csbi;
    int WindowColumns, WindowRows, DisplayBuffer;
    string DisplayMap;
    GetConsoleScreenBufferInfo(GetStdHandle(STD_OUTPUT_HANDLE), &csbi);
    WindowColumns = csbi.srWindow.Right - csbi.srWindow.Left + 1;
    WindowRows = csbi.srWindow.Bottom - csbi.srWindow.Top + 1;
    cout << WindowColumns << "," << WindowRows;
    DisplayBuffer = WindowColumns * WindowRows;
    for (int i = 0; i < WindowColumns; i++) {
        DisplayMap.insert(i, map[i]);
    }
    return 0;
}

Thanks In advance.

EDIT:
Data.h here:

#pragma once

#include <iostream>
#include <String>
using namespace std;
string savedMap = "                              "
"                              "
"                              "
"                              "
"                              ";
string map = savedMap;
int w = 119, a = 97, s = 115, d = 100;
char key_press;
int myPOS = 35;
int MDPOS = myPOS, ascii_value;

Please don’t ask me why I use the namespace std in a header file.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
#include <iostream> #include <iomanip> #include <functional> #include <vector> #include <boost/multiprecision/cpp_bin_float.hpp>   using namespace boost::multiprecision; using namespace std;   typedef number<cpp_bin_float<200>> cpp_dec_float_unlim;   #define double cpp_dec_float_unlim   double dy0dt(const double& t, const double& y_0, const double& y_1, const double& y_2, const double& y_3, double& alpha) {    return double(8.85e4) - y_2*y_0*((double(0.2) - y_0) / (double(1.) - y_1)) + y_0 / double(1e-8); }   double dy1dt(const double& t, const double& y_0, const double& y_1, const double& y_2, const double& y_3, double& alpha) {    return y_0 * y_2; }   double dy2dt(const double& t, const double& y_0, const double& y_1, const double& y_2, const double& y_3, double& alpha) {     return y_0 * y_3; }   double dy3dt(const double& t, const double& y_0, const double& y_1, const double& y_2, const double& y_3, double& alpha) {    return double(1e30)*sqrt(y_0)*exp(double(-alpha) / y_0); }   struct my_data {       double t, y_0, y_1, y_2, y_3;     my_data(double _t, double _y0, double _y1, double _y2, double _y3) : t(_t), y_0(_y0), y_1(_y1), y_2(_y2), y_3(_y3) {}   };   void rungeKutta( double y0, double y1, double y2, double y3, double t0, double max_t, double h, double alpha, std::vector<my_data>& result){      double k1[4], k2[4], k3[4], k4[4];      double t = t0;      std::vector<std::function<double(double, double, double, double, double, double) >> vfunc;    vfunc.push_back(dy0dt);    vfunc.push_back(dy1dt);    vfunc.push_back(dy2dt);    vfunc.push_back(dy3dt);      for (int i = 0; i < ((max_t - t0) / h); i++) {         std::cout << t << "t" << std::setprecision(5) << y0 << "t" << y1 << "t" << y2 << "t" << y3 << std::endl;         for (int j = 0; j < 4; ++j) {          k1[j] = h*vfunc[j](t, y0, y1, y2, y3, alpha);       }         for (int j = 0; j < 4; ++j) {          k2[j] = h*vfunc[j](t + double(0.5)*h, y0 + double(0.5)*k1[0], y1 + double(0.5)*k1[1], y2 + double(0.5)*k1[2], y3 + double(0.5)*k1[3], alpha);       }         for (int j = 0; j < 4; ++j) {          k3[j] = h*vfunc[j](t + double(0.5)*h, y0 + double(0.5)*k2[0], y1 + double(0.5)*k2[1], y2 + double(0.5)*k2[2], y3 + double(0.5)*k3[3], alpha);       }         for (int j = 0; j < 4; ++j) {          k4[j] = h*vfunc[j](t + h, y0 + k3[0], y1 + k3[1], y2 + k3[2], y3 + k3[3], alpha);       }         y0 += (k1[0] + double(2.) * k2[0] + double(2.) * k3[0] + k4[0]) / double(6.);       y1 += (k1[1] + double(2.) * k2[1] + double(2.) * k3[1] + k4[1]) / double(6.);       y2 += (k1[2] + double(2.) * k2[2] + double(2.) * k3[2] + k4[2]) / double(6.);       y3 += (k1[3] + double(2.) * k2[3] + double(2.) * k3[3] + k4[3]) / double(6.);         t = t + h;    }        result.emplace_back(t, y0, y1, y2, y3);   }   void foo() {       double y_0, y_1, y_2, y_3, alpha;       std::cout << "Input y_0: "; std::cin >> y_0; // 1e-10     std::cout << "Input y_1: "; std::cin >> y_1; // 0     std::cout << "Input y_2: "; std::cin >> y_2; // 0     std::cout << "Input y_3: "; std::cin >> y_3; // 0     std::cout << "Input alpha: "; std::cin >> alpha; //0.25       double beg_time, max_time;       std::cout << "Input beg_time: "; std::cin >> beg_time; // 0     cout << "Input max_time: "; std::cin >> max_time; // 1.1e-8       double step;       cout << "Input step: "; std::cin >> step; // 1e-9         vector<my_data> result;     cout << "Runge-Kutta method: " << endl;     rungeKutta(y_0, y_1, y_2, y_3, beg_time, max_time, step, alpha, result);       double a, b, e, xmin;     cout << "Input a: "; cin >> a;   // 8e-2     cout << "Input b: "; cin >> b;   // 5e-1     cout << "Input eps: "; cin >> e; // 1e-3       cout << "Gold method: " << endl;     Gold(a, b, e, xmin);     cout << endl;   }   /******************************************************************************************************************/   int main(){     foo();       system("pause");     return 0; }

So we have this old project that was originally written in MSVC 6.0. The language standards are mostly C-based, although we’ve moved the project over to C++ v17 on VS2017. This project compiled just fine before the latest VS update.

After updating VS to 15.7.0 (and adding the Windows 10 SDK 10.0.17134), the project will still compile, but Intellisense drops hundreds of E0304 errors like the following:

Severity	Code	Source	        Description	
Error (active)	E0304	IntelliSense	no instance of function template "__countof_helper" matches the argument list	
 

Every single one of these calls (or at least every one I looked at) was calling
_countof like this snippet:

TCHAR ErrMsg[ERR_MSG_SIZE] = { (TCHAR)NULL };
...
FormatErrorString(GetLastError(), ErrMsg, _countof(ErrMsg), true);

If I try to «Show Error Help» on the error in the error list, it does nothing.

Has anyone else run into this or have some advice on why or how this has occurred?

Additionally, if it helps…

This project is:

— Targeting Windows 10 as a platform

— 10.0.17134.0 as the Windows SDK Version

— has 64-bit config (UNICODE defined) and 32-bit config (UNICODE
not
defined) profiles

— using «C++ 17 Standard» as the C++ Language Standard

— does not use MFC or CLR

I can include all the miscellaneous options if that helps, but I think that covers the major variables. Some of these options are intentional due to certain constraints in our software environment and/or integration requirements.

Thanks for any feedback.

Возможно, вам также будет интересно:

  • Ошибка e03 стиральная машина вирпул
  • Ошибка e03 стиральная машина vestel
  • Ошибка e03 стиральная машина leran
  • Ошибка e03 стиральная машина hansa
  • Ошибка e03 стиральная машина gorenje

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

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