我正在编写一个c ++库并测试它,我使用命令行工具编译它而不使用任何ide,当我编译库并且测试程序没有发现错误时,但是当我运行程序时它有时会生成错误并且有时可以正常工作,当我得到一个错误时,它是:"找不到指定的过程"我在我的库头文件中使用了dllexport,并在我的测试中链接了pragma comment(lib,...),我的编译命令就像thiis:
cl -o library.dll quaternion.cpp /link /DLL
cl program.cpp
Run Code Online (Sandbox Code Playgroud)
完整的运行输出:
q = 10 + 10 i + 10 j + 10 k
p = 1 + 1 i + 1 j + 1 k
testing *= operator:
q = -20 + 20 i + 20 j + 20 k
testing * operator:
q = -20 + 20 i + 20 j + 20 k
testing /= operator:
q = 10
testing / operator:
q = 10
testing += …Run Code Online (Sandbox Code Playgroud)