[英]How to create dll from app source in c++ builder 6?
I have legacy code in C++Builder 6. I try to create a DLL from source code, but only one thing which I have on output is an EXE. 我在C ++ Builder 6中有遗留代码。我尝试从源代码创建DLL,但是输出中只有一件事是EXE。 I tried to change the application target extension and entry point, but nothing helps. 我试图更改应用程序目标扩展名和入口点,但没有任何帮助。
I think about compiling from console, but there is some errors in the project, that I can't see when compiling in the IDE. 我考虑从控制台进行编译,但是项目中存在一些错误,在IDE中进行编译时看不到。 I have linker errors, which I can't fix. 我有链接器错误,无法修复。
At least all code are "extern C"
and I need lib
and dll
. 至少所有代码都是"extern C"
,我需要lib
和dll
。
How can I compile a DLL from the app source? 如何从应用程序源编译DLL?
A DLL
needs certain pre-defined functions and the project Wizard creates them for you automatically, so DLL
需要某些预定义的功能,并且项目向导会自动为您创建它们,因此
Start a new fresh project as a DLL/library project. 启动一个新的新项目,作为DLL /库项目。
Create a simple function that you can test. 创建一个可以测试的简单功能。
Compile the DLL
and load it (and call the test function) from an .exe
in another project to check that it's working. 编译DLL
并从另一个项目的.exe
加载它(并调用测试函数)以检查其是否正常工作。
Copy the essential parts of your old code, bit by bit, from the old .exe
project into the correct places in the new DLL/library project. 从旧的.exe
项目中一点一点地复制旧代码的基本部分到新的DLL /库项目中的正确位置。
Done. 做完了
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.