【发布时间】:2021-02-23 23:15:36
【问题描述】:
lib1 有两个文件
数学.h
inline void hello();
和数学.cpp
#include <iostream>
#include "math.h"
void hello() {
std::cout << "hello from math";
}
lib2 是一个 c++ 2a 模块库:
export module Bar;
import "math.h";
import std.core;
export namespace bar {
void BarFunc() {
hello();
}
}
视觉工作室 16.8.0 编译器会说:(Bar.ixx.obj) : error LNK2001: unresolved external symbol "void __cdecl hello(void)" (?hello@@YAXXZ)
【问题讨论】:
标签: c++ visual-studio module header-files c++20