当前位置:网站首页>Debug: generic related "unresolved external symbols"
Debug: generic related "unresolved external symbols"
2022-07-27 08:00:00 【This dish;】
We are temp.h The function is declared in temp.cpp To implement functions in , That's fine , But only limited to ordinary functions , On function template , This kind of behavior is not desirable ;
Why report a mistake
This is about the compilation and linking process , First compile temp.h file , The compiler interprets function declarations , Then the compiler will leave a marker symbol , When compiling to the implementation file , Will link its function address , But we know that , Function templates are not instantiated during compilation , So I can't find the address .
Of course , There will be no error when we do not instantiate this function , Because this is only equivalent to writing a function declaration , Functions that are not implemented , But when we implicitly instantiate the function template , You're going to report a mistake , Because the function address doesn't exist at all ;
How to solve
It's simple , We just need to put the declaration and implementation of the function together , In this way, the compiler will not address when compiling to the implementation file ;
Of course, we need to limit the scope of the function , I'm going to add a... In front of it static Modifier
边栏推荐
- 数据提取1
- What are the software tuning methods? Let's see what Feiteng technology experts say about dragon lizard technology
- What is a rebound shell? What's the use of bouncing shells?
- Do me a favor ~ don't pay attention, don't log in, a questionnaire in less than a minute
- 抽象工厂模式
- Mqtt instruction send receive request subscription
- Gossip: is rotting meat in the pot to protect students' rights and interests?
- 二零二零年终总结
- Redison 3.17.5 release, officially recommended redis client
- Redisson 3.17.5 发布,官方推荐的 Redis 客户端
猜你喜欢

linux能不能安装sqlserver

【已解决】新版Pycharm(2022)连接服务器进行上传文件报错“Command rsync is not found in PATH”,无法同步文件
![[resolved] the new version of pychart (2022) connects to the server to upload files and reports an error of](/img/13/573d8ae55eb25580a5628b469dfab3.png)
[resolved] the new version of pychart (2022) connects to the server to upload files and reports an error of "command Rsync is not found in path", and the files cannot be synchronized

数据提取1

The integrated real-time HTAP database stonedb, how to replace MySQL and achieve nearly 100 times the improvement of analysis performance

How to update PIP3? And running PIP as the 'root' user can result in broken permissions and conflicting behavior

「翻译」SAP变式物料的采购如何玩转?看看这篇你就明白了

HU相关配置

C#委托的使用案例

Enhancement: BTE process introduction
随机推荐
C# 事件用法案例 订阅事件+=
C语言:随机生成数+希尔排序
Gossip: it's really important to have a rod in your hand and a net on your shoulder. As for how many fish are in the basket?
linux中mysql表名区不区分大小写
Five day travels to Beijing
RPC remote procedure call
slf4j如何进行logback配置呢?
Lua iterator
What other methods are available for MySQL index analysis besides explain
模仿大佬制作的宿舍门禁系统(三)
Day111. Shangyitong: integrate nuxt framework, front page data, hospital details page
Framework of electronic mass production project -- basic idea
数据提取1
OpenGL shader learning notes: varying variables
How to update PIP3? And running PIP as the 'root' user can result in broken permissions and conflicting behavior
Promise details
Comprehensive analysis of ADC noise-01-types of ADC noise and ADC characteristics
【小程序】uniapp发行微信小程序上传失败Error: Error: {'errCode':-10008,'errMsg':'invalid ip...
QingChuang technology joined dragon lizard community to build a new ecosystem of intelligent operation and maintenance platform
linux能不能安装sqlserver