简体   繁体   English

命令行程序作为“从属”调用被认为是动态链接的吗?

[英]Command line program invoked as a “slave” considered dynamically linked?

I'm trying to get clarification on exactly what dynamically linked means. 我试图弄清楚动态链接的确切含义。 I understand if my program links to a separate .dll and makes function calls at run time, that's dynamically linked. 我知道我的程序是否链接到单独的.dll并在运行时进行函数调用,所以该链接是动态链接的。 But say my program invokes a separate .exe via command line. 但是说我的程序通过命令行调用了一个单独的.exe。 That .exe can act as a slave by passing "-slave" in the command line and a handle to a window in my app which it communicates to. 该.exe可以通过在命令行中传递“ -slave”并将其句柄传递到与之通信的我的应用程序中的窗口来充当从属。 My program then sends it commands, for example: -dothis or -dothat and the output is sent to my program's window. 然后,我的程序向其发送命令,例如:-dothis或-dothat,并将输出发送到我程序的窗口。 Is that considered dynamically linked? 是否认为它是动态链接的?

I ask because the .exe I'm using via command line is an open-source GPL program and my program is not. 我问是因为我通过命令行使用的.exe是开源GPL程序,而我的程序不是。 My understanding is that if I don't actually link to any GPL libraries, I'm not in violation of the license. 我的理解是,如果我实际上未链接到任何GPL库,则不会违反许可证。

Thanks 谢谢

Is that considered dynamically linked? 是否认为它是动态链接的?

No. You are dynamically linking to another program only if you load its code in your own process's address space. 否。仅当将另一个程序的代码加载到自己进程的地址空间中时,才可以动态链接到另一个程序。

Your suggested solution of running the GPLed program as a separate process and then communicating with it using standard IPC facilities is exactly how this problem is solved in the field. 您建议的将GPLed程序作为一个单独的进程运行,然后使用标准IPC设施与其通信的解决方案,正是在现场解决此问题的方法。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM