繁体   English   中英

修改.cpp文件的内容

[英]Modifying the contents of a .cpp file

更新:我现在可以使用make编译.cpp文件(我可以看到编译输出)。 但是,这些更改似乎没有生效。 运行make之后,我重新启动计算机,但仍然没有任何更改。

您可能知道,我对c ++的经验非常有限。 我目前正在开发一个项目(OpenBTS),并且在构建并安装项目后,在其中一个.cpp文件中发现了错误。 我的问题是,如何修改.cpp文件的内容(用f.eks更改JSON数据引用的字符串)并进行构建,以便以后可以看到更改?

我目前尝试以下方法:

1.
make 'filename.cpp'
make: Nothing to be done for 'filename.cpp'

2.
make 'filename'
g++ 'filename.cpp' -o 'filename'
In file included from 'filename.cpp:29:0:
'filname.h':26:21: fatal error: Timeval.h: No such file or directory
#include <Timeval.h>
compilation terminated.

3. Run make from root directory:
Nothing to be done for 'all.'

4. Run make clean and make from root. This rebuilds the project but the
changes are still not in effect (I can see that the JSON String is not
changed at the webserver).

5. Run ./build.sh script. Still no changes. 

关于2.方法,由于项目已成功构建和编译,当我尝试使用单个文件尝试编译器找不到头文件时,怎么会这样呢? 我唯一更改的是从“ ARFCN”到“ ARFCNtest”的字符串。 因为大约有50个相互依赖的头文件,所以将include从<>更改为“”并将每个文件复制到同一目录似乎是浪费和不必要的操作?

更改未生效,因为编译失败。 请参阅您在问题中引用的错误消息。 修复并重建。

顺便说一句,不需要重新启动计算机。 如果Makefile正确表达了依赖关系,那么即使make clean也没有必要。 (由于它试图重新编译您修改的源文件,因此在这种情况下似乎是这样做的。)

暂无
暂无

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

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