poco 切换到 MT 链接错误 Visual Studio 2019

如何解决poco 切换到 MT 链接错误 Visual Studio 2019

我无法在我已经创建的项目中运行 POCO。我用示例 Websocket 做了一个新项目,试图将它配置为成功构建 => 应用程序能够启动和工作。但是当我尝试使用 OpenCV 在我的另一个项目中实施相同的步骤时,我遇到了很多错误。

我用于构建两个项目的代码:

#define POCO_STATIC
#include "pocoWebSocket.h"

#include <iostream>
#include <string>
using namespace std;

int main(int argc,char** argv)
{
    std::cout << std::endl<< "I am alive!" << std::endl;
    WebSocketServer app;
    std::cout << "app run" << std::endl;
    return app.run(argc,argv);
    //visit http://localhost:9980
}

项目设置为:

  • C/C++/代码生成/运行时库:/MT
  • C/C++ / General / Additional Include Directories: C:\src\POCO\Foundation\include;C:\src\POCO\Net\include;C:\src\POCO\Util\include;%(AdditionalIncludeDirectories)

在链接器中:

  • 一般/附加库目录: C:\src\POCO\buildMT\lib\Debug;C:\src\POCO\buildMT\lib\Release;%(AdditionalLibraryDirectories)
  • 输入/附加依赖项: crypt32.lib ws2_32.lib iphlpapi.lib PocoNetmt.lib PocoFoundationmt.lib

当我用 OpenCV 对项目做同样的事情时,我会得到这些错误:有什么建议吗?

Build started...
1>------ Build started: Project: StitchingApp,Configuration: Debug x64 ------
1>main.cpp
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0\shared\windef.h(190,3): error C2059: syntax error: 'constant'
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0\shared\windef.h(192,9): error C2059: syntax error: 'constant'
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0\shared\windef.h(193,9): error C2059: syntax error: 'constant'
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0\um\wingdi.h(1102,13): error C3646: 'szlDevice': unknown override specifier
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0\um\wingdi.h(1102,22): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0\um\wingdi.h(1103,13): error C3646: 'szlMillimeters': unknown override specifier
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0\um\wingdi.h(1103,27): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0\um\winuser.h(7715,16): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0\um\winuser.h(7715,16): error C2143: syntax error: missing ')' before 'constant'
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0\um\winuser.h(7715,16): error C2143: syntax error: missing ';' before 'constant'
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0\um\winuser.h(7715,16): error C2059: syntax error: 'constant'
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0\um\winuser.h(7718,36): error C2059: syntax error: ')'
1>trStitcher.cpp
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0\shared\windef.h(190,36): error C2059: syntax error: ')'
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0\um\winspool.h(873,13): error C3646: 'Size': unknown override specifier
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0\um\winspool.h(873,17): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0\um\winspool.h(879,13): error C3646: 'Size': unknown override specifier
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0\um\winspool.h(879,17): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0\um\winspool.h(902,25): error C3646: 'Size': unknown override specifier
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0\um\winspool.h(902,29): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0\um\winspool.h(914,25): error C3646: 'Size': unknown override specifier
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0\um\winspool.h(914,29): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0\um\oleidl.h(1262,34): error C2061: syntax error: identifier 'SIZEL'
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0\um\oleidl.h(1266,36): error C2061: syntax error: identifier 'SIZEL'
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0\um\oleidl.h(1524,11): error C3646: 'sizel': unknown override specifier
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0\um\oleidl.h(1524,16): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0\um\oleidl.h(2668,24): error C2059: syntax error: 'constant'
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0\um\oleidl.h(3207,36): error C2061: syntax error: identifier 'LPSIZEL'
1>trStitcher_calculation.cpp
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0\shared\windef.h(190,27): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0\um\wingdi.h(1113,13): error C3646: 'szlMicrometers': unknown override specifier
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0\um\wingdi.h(1113,27): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0\um\wingdi.h(4009,67): error C2061: syntax error: identifier 'LPSIZE'
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0\um\wingdi.h(5143,98): error C2061: syntax error: identifier 'LPSIZE'
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0\um\wingdi.h(5612,13): error C3646: 'szlExtent': unknown override specifier
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0\um\wingdi.h(5612,22): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0\um\winuser.h(7715,36): error C2061: syntax error: identifier 'LPSIZEL'
1>trStitcher_core.cpp
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0\shared\windef.h(190,67): error C2061: syntax error: identifier 'LPSIZE'
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0\um\wingdi.h(4033,71): error C2061: syntax error: identifier 'LPSIZE'
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0\um\wingdi.h(5143,22): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0\um\wingdi.h(5666,13): error C3646: 'szlCorner': unknown override specifier
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0\um\wingdi.h(5666,22): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0\um\wingdi.h(5777,13): error C3646: 'szlStroke': unknown override specifier
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0\um\wingdi.h(5777,22): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0\um\winuser.h(4547,14): error C2059: syntax error: 'constant'
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0\um\winuser.h(4562,11): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0\um\winuser.h(4562,11): error C2059: syntax error: 'constant'
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0\um\winuser.h(4562,22): error C2238: unexpected token(s) preceding ';'
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0\um\winuser.h(7715,36): error C2061: syntax error: identifier 'LPSIZEL'
1>E:\JOB\StitchingProject\StitchingApp\src\trStitcher_core.cpp(15,29): warning C4267: '=': conversion from 'size_t' to 'int',possible loss of data
1>E:\JOB\StitchingProject\StitchingApp\src\trStitcher_core.cpp(281,102): warning C4244: 'argument': conversion from 'double' to '_Tp',possible loss of data
1>        with
1>        [
1>            _Tp=int
1>        ]
1>E:\JOB\StitchingProject\StitchingApp\src\trStitcher_core.cpp(281,70): warning C4244: 'argument': conversion from 'double' to '_Tp',possible loss of data
1>        with
1>        [
1>            _Tp=int
1>        ]
1>trStitcher_IO_processing.cpp
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0\shared\windef.h(190,22): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0\um\winuser.h(4562,17): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0\um\winspool.h(914,36): error C2061: syntax error: identifier 'LPSIZEL'
1>E:\JOB\StitchingProject\StitchingApp\src\trStitcher_IO_processing.cpp(15,34): warning C4244: '=': conversion from 'double' to '_Tp',possible loss of data
1>        with
1>        [
1>            _Tp=float
1>        ]
1>E:\JOB\StitchingProject\StitchingApp\src\trStitcher_IO_processing.cpp(21,30): warning C4244: '=': conversion from 'double' to '_Tp',possible loss of data
1>        with
1>        [
1>            _Tp=float
1>        ]
1>E:\JOB\StitchingProject\StitchingApp\src\trStitcher_IO_processing.cpp(33,62): warning C4244: 'argument': conversion from 'double' to '_Tp',possible loss of data
1>        with
1>        [
1>            _Tp=int
1>        ]
1>E:\JOB\StitchingProject\StitchingApp\src\trStitcher_IO_processing.cpp(33,36): warning C4244: 'argument': conversion from 'double' to '_Tp',possible loss of data
1>        with
1>        [
1>            _Tp=int
1>        ]
1>E:\JOB\StitchingProject\StitchingApp\src\trStitcher_IO_processing.cpp(201,116): warning C4244: 'argument': conversion from 'double' to '_Tp',77): warning C4244: 'argument': conversion from 'double' to '_Tp',possible loss of data
1>        with
1>        [
1>            _Tp=int
1>        ]
1>Generating Code...
1>Done building project "StitchingApp.vcxproj" -- FAILED.
========== Build: 0 succeeded,1 failed,0 up-to-date,0 skipped ==========

解决方法

C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0\shared\windef.h(190,3):

186: typedef struct tagSIZE
187: {
188:    LONG        cx;
189:    LONG        cy;
190: } SIZE,*PSIZE,*LPSIZE;
     ^ ^
     1 3

在您的代码或使用的库中的某处,定义了冲突的宏 SIZE。

,

有人给了我很大的耳光...当我教我的朋友如何编码时,我不小心定义了 SIZE 和其他东西,并意外地将它保存到我的解决方案中....我还不得不评论一些更多的东西来制作它起作用了。

感谢你们给我的小推动,谢谢。

这是我必须编辑的文件,评论的文件没有评论,config.h:

#pragma once
#ifndef STITCHING_CONFIG
#define STITCHING_CONFIG
#include <stdio.h>
#include <iostream> 
#include <string>
#include <vector>
//static const uint32_t SupportedWidth[] = { 320,480,640,800,960,1120,1600,1920,2048,2592,3264,3840,4224 };
//static const uint32_t SupportedHeight[] = { 240,360,600,720,840,1200,1080,1536,1944,2448,2160,3156 };


//#define PORT 8004
//#define FPS 1.0
//#define SIZE 7
#define INPUTRESIZE 0.5
#define OUTPUTRESIZE 1.0
#define NUMBEROFIMAGES 3

#define DEBUGID 0
#define DEBUGON false
#define DEBUGTIMESON false
#define DEBUGSTITCHINGINFO true
#define SLOWDEBUGON false
#define RUNVAL 0

#if RUNVAL == 0
#define DEBUGMODESTITCHINGAPP
#elif RUNVAL == 1
#define TESTING
#elif RUNVAL == 2
#define RUNCALIBRATION
#else 
#define RUNSTITCHINGAPP 
#endif
#endif

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。

相关推荐


依赖报错 idea导入项目后依赖报错,解决方案:https://blog.csdn.net/weixin_42420249/article/details/81191861 依赖版本报错:更换其他版本 无法下载依赖可参考:https://blog.csdn.net/weixin_42628809/a
错误1:代码生成器依赖和mybatis依赖冲突 启动项目时报错如下 2021-12-03 13:33:33.927 ERROR 7228 [ main] o.s.b.d.LoggingFailureAnalysisReporter : *************************** APPL
错误1:gradle项目控制台输出为乱码 # 解决方案:https://blog.csdn.net/weixin_43501566/article/details/112482302 # 在gradle-wrapper.properties 添加以下内容 org.gradle.jvmargs=-Df
错误还原:在查询的过程中,传入的workType为0时,该条件不起作用 &lt;select id=&quot;xxx&quot;&gt; SELECT di.id, di.name, di.work_type, di.updated... &lt;where&gt; &lt;if test=&qu
报错如下,gcc版本太低 ^ server.c:5346:31: 错误:‘struct redisServer’没有名为‘server_cpulist’的成员 redisSetCpuAffinity(server.server_cpulist); ^ server.c: 在函数‘hasActiveC
解决方案1 1、改项目中.idea/workspace.xml配置文件,增加dynamic.classpath参数 2、搜索PropertiesComponent,添加如下 &lt;property name=&quot;dynamic.classpath&quot; value=&quot;tru
删除根组件app.vue中的默认代码后报错:Module Error (from ./node_modules/eslint-loader/index.js): 解决方案:关闭ESlint代码检测,在项目根目录创建vue.config.js,在文件中添加 module.exports = { lin
查看spark默认的python版本 [root@master day27]# pyspark /home/software/spark-2.3.4-bin-hadoop2.7/conf/spark-env.sh: line 2: /usr/local/hadoop/bin/hadoop: No s
使用本地python环境可以成功执行 import pandas as pd import matplotlib.pyplot as plt # 设置字体 plt.rcParams[&#39;font.sans-serif&#39;] = [&#39;SimHei&#39;] # 能正确显示负号 p
错误1:Request method ‘DELETE‘ not supported 错误还原:controller层有一个接口,访问该接口时报错:Request method ‘DELETE‘ not supported 错误原因:没有接收到前端传入的参数,修改为如下 参考 错误2:cannot r
错误1:启动docker镜像时报错:Error response from daemon: driver failed programming external connectivity on endpoint quirky_allen 解决方法:重启docker -&gt; systemctl r
错误1:private field ‘xxx‘ is never assigned 按Altʾnter快捷键,选择第2项 参考:https://blog.csdn.net/shi_hong_fei_hei/article/details/88814070 错误2:启动时报错,不能找到主启动类 #
报错如下,通过源不能下载,最后警告pip需升级版本 Requirement already satisfied: pip in c:\users\ychen\appdata\local\programs\python\python310\lib\site-packages (22.0.4) Coll
错误1:maven打包报错 错误还原:使用maven打包项目时报错如下 [ERROR] Failed to execute goal org.apache.maven.plugins:maven-resources-plugin:3.2.0:resources (default-resources)
错误1:服务调用时报错 服务消费者模块assess通过openFeign调用服务提供者模块hires 如下为服务提供者模块hires的控制层接口 @RestController @RequestMapping(&quot;/hires&quot;) public class FeignControl
错误1:运行项目后报如下错误 解决方案 报错2:Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.8.1:compile (default-compile) on project sb 解决方案:在pom.
参考 错误原因 过滤器或拦截器在生效时,redisTemplate还没有注入 解决方案:在注入容器时就生效 @Component //项目运行时就注入Spring容器 public class RedisBean { @Resource private RedisTemplate&lt;String
使用vite构建项目报错 C:\Users\ychen\work&gt;npm init @vitejs/app @vitejs/create-app is deprecated, use npm init vite instead C:\Users\ychen\AppData\Local\npm-