如何强制emmake使用config.h文件并进行预处理
How to force emmake use config.h file and do preprocess?
我正在尝试用emscripten(最新)构建项目,我已经完成了emconfigure ./configure。现在试着做emmake make。但是它找不到在预处理指令中需要的new.h文件,我确信本机配置是一个很好的配置文件。它用本地make编译。所以问题是如何让emmake做正确的预处理?
#if defined(UNDER_CE)
# ifndef __WCEALT_H__
inline void * operator new(size_t, void * ptr) { return ptr; }
# endif
#elif defined(AUTOCONF) && defined(HAVE_STDINCLUDES)
# include <new>
#else
# include <new.h>
#endif
PS:也许有人知道如何在编译前做预处理?删除无用的代码?像g++ -e
或类似的东西,但我找不到一个好的工作流程与大型项目。
PS: Output emmake:
libtool: compile: /Users/tau0/reader/emsdk_portable/emscripten/1.16.0/em++ -DHAVE_CONFIG_H -I.. -I. -DNDEBUG -Wall -O3 -Wno-non-virtual-dtor -c GOS.cpp -fno-common -DPIC -o .libs/GOS.o
In file included from GOS.cpp:63:
In file included from ./GException.h:120:
./DjVuGlobal.h:72:11: fatal error: 'new.h' file not found
# include <new.h>
^
1 error generated.
Emconfigure默认禁用stl,因此请检查您的新config.h中的HAVE_STDINCLUDES。
相关文章:
- 预处理的 C/C++ 文件是否特定于计算机?
- 使用 GCC 对 C 文件进行部分预处理(不删除 "define" 指令)
- Eclipse 问题 - 编译期间不考虑 .c 和 .cpp 文件中定义的预处理
- Howo 使用 cl 预处理为 masm 组装生成一个单独的文件
- 我有一个预处理的 C/C++ 源文件 (cacti.i).如何从这个 .i 文件生成可执行二进制文件,以便我可以像 ./
- Visual Studio C - 无法输出预处理文件
- 如何在预处理时读取文件
- 预处理一个自定义文本文件,以使用Boost Spirit删除注释
- 将预处理更改为文件后出现错误1错误LNK1104
- 如何通过预处理文件来访问O(1)中文件中的一行
- 如何在大型项目中预处理具有多个 #include 文件的单个源文件
- 有没有办法使用 clang 有效地编译已经预处理过的文件
- 如何在linux下编译c/cpp代码,给出经过预处理的汇编文件和编译后的目标文件
- C预处理文件中这些不熟悉的行是什么
- 编译先前预处理的文件会更改输出
- 如何将宏仅作为预处理步骤扩展到C++文件
- visual msvsc++,如何用*编译已经预处理过的文件.我扩展
- 当头文件被预处理时是否有一个预处理器选项显示?
- 如何强制emmake使用config.h文件并进行预处理
- 在 VC++ 2010 中使用 MSBuild 对文件执行自定义预处理