通过带有.h文件的CL命令执行Win32应用程序 [英] Executing Win32 application via CL command with .h file

查看:115
本文介绍了通过带有.h文件的CL命令执行Win32应用程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,

对于通过命令提示符执行win32 Project的问题,我有很好的解决方案,但是当我处理.h文件时,问题变得非常棘手.

我以前的有用文章
通过CL命令执行Win32应用程序 [ Richard MacCutchan [ CPallini [ ^ ].

提出的问题:-

我的Win32 API具有3个.cpp文件和2个.h(头文件)

我的 int main()函数具有函数AddTwoNumber()
ManupulateValue类的哪个成员函数
现在
当我像
发出命令时 cl main.cpp
然后我出现了链接错误
无法解析的外部符号AddTwoNumber()

然后我像
cl main.cpp ManupulateValue.cpp
主编译成功,但是在编译ManupulateValue.cpp时又出现了错误
解析符号GetRamdom()
GetRamdom()是GetValue.h头文件的成员.

现在我的问题:-
我如何将.h文件链接到我的编译过程中,以便.h文件也可以包含.

Hi all,

I got very well solution for my problem of executing win32 Project via Command Prompt but problem goes really hard when i deal .h files.

My previous useful post
Executing Win32 application via CL command[^]

For feedback on above post i really Thanks Richard MacCutchan[^] and CPallini[^] both of them.

Question Arised:-

I have Win32 API with 3 .cpp file and 2 .h(header files)

My int main() function has function call AddTwoNumber()
Which member function of ManupulateValue Class
Now
When i trown command like
cl main.cpp
then i got linking error
Unresolved external symbol AddTwoNumber()

Then I trown command like
cl main.cpp ManupulateValue.cpp
main compile successfully but while compiling ManupulateValue.cpp i got again liking error
UnResolve symbol GetRamdom()
GetRamdom() is Member of GetValue.h header file.

Now My question:-
How i link .h file to my compile process so that .h file can also get include.

推荐答案

请停止重新发布相同的问题;我已经在此处回答了 [本节 [ ^ ] MSDN.
Please stop reposting the same question; I have already answered this here[^]. If you really do not understand how compiling and linking works then read this section[^] on MSDN.


这篇关于通过带有.h文件的CL命令执行Win32应用程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆