在c ++中从CreateProcess调用NASM [英] Calling NASM from CreateProcess within c++

查看:87
本文介绍了在c ++中从CreateProcess调用NASM的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用NASM上的CreateProcess从我的cpp代码中组装一个.asm源。

当我使用Windows命令提示符 nasm -f obj hello.asm ,源组装好的结果是大约300kb .obj文件,但当我使用cmd / c nasm -f obj hello.asm作为createProcess 2nd在c ++中的参数,它导致了一个不完整的60kb .obj文件。

没有产生错误,我只是无法弄清楚出了什么问题。

解决方案

谢谢,发现我的错误......我没有关闭将.asm源写入磁盘的 ofstream ,因此NASM正在组装一个空的.asm文件

I am trying to assemble a .asm source from within my cpp code using CreateProcess on NASM.
When I used Windows Command Prompt nasm -f obj hello.asm, the source assembled well resulting is about 300kb .obj file but when I use "cmd /c nasm -f obj hello.asm" as createProcess 2nd parameter within c++, it resulted in an incomplete 60kb .obj file.
No error was produced and I just can't figure out what is wrong.

解决方案

Thank you, found my error... I wasn't closing the ofstream that writes the .asm source to disk so NASM was assembling an empty .asm file


这篇关于在c ++中从CreateProcess调用NASM的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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