我对asmjit还不熟悉(对C++有点陌生),现在我正试图让asmjit在我的C++项目中工作。我使用的是Visual 17和C++17的Windows机器,我第一次尝试使用cmake已经很好了。 但是,我更希望像建议的这里那样将asmjit嵌入到我的项目中(参见配置&构建一节,第一段)。如前所述,我只是将src目录复制到我的项目目录中,并定义了ASMJIT_EMBED和ASMJIT_STATIC标志(虽然我知道只有一个就足够了,但它不会改变任何东西)。然后,我尝试了一个非常简单的测试,如下: 代码语言:javascript复制#define ASMJIT_EMBED // Asmjit is embedded (implies ASMJIT_STATIC).
#define ASMJIT_STATIC // Define to enable static-library build.
#include "src\asmjit\asmjit.h"
int main(int argc, const char* argv[])
{
asmjit::X86Xmm var1;
}但是,代码编译得很好,但是链接器总是抛出unresolved externals错误: 代码语言:javascript复制1>------ Build started: Project: Project2, Configuration: Debug Win32 ------
1>main.cpp
1>d:\eig\arbeit\local_forschung\project2\src\asmjit\base\operand.h(1500): warning C4804: '~': unsafe use of type 'bool' in operation
1>d:\eig\arbeit\local_forschung\project2\src\asmjit\base\operand.h(1527): note: see reference to class template instantiation 'asmjit::TypeIdOfInt' being compiled
1>c:\program files (x86)\microsoft visual studio\2017\community\vc\tools\msvc\14.14.26428\include\filesystem(2447): note: see reference to class template instantiation 'std::chrono::time_point' being compiled
1>c:\program files (x86)\microsoft visual studio\2017\community\vc\tools\msvc\14.14.26428\include\type_traits(520): note: see reference to class template instantiation 'std::basic_string_view' being compiled
1>c:\program files (x86)\microsoft visual studio\2017\community\vc\tools\msvc\14.14.26428\include\type_traits(1358): note: see reference to class template instantiation 'std::is_convertible' being compiled
1> with
1> [
1> _StringViewIsh=const wchar_t *
1> ]
1>c:\program files (x86)\microsoft visual studio\2017\community\vc\tools\msvc\14.14.26428\include\type_traits(1364): note: see reference to class template instantiation 'std::conjunction' being compiled
1> with
1> [
1> _StringViewIsh=const wchar_t *,
1> _Elem=wchar_t
1> ]
1>c:\program files (x86)\microsoft visual studio\2017\community\vc\tools\msvc\14.14.26428\include\xstring(2105): note: see reference to variable template 'const bool conjunction_v' being compiled
1>c:\program files (x86)\microsoft visual studio\2017\community\vc\tools\msvc\14.14.26428\include\xstring(2264): note: see reference to alias template instantiation '_Is_string_view_ish' being compiled
1>d:\eig\arbeit\local_forschung\project2\src\asmjit\base\operand.h(1500): warning C4804: ' |