在 C 编译时检测 --prefix 位置

发布于 2024-12-21 12:20:41 字数 146 浏览 3 评论 0原文

我正在使用 C 和 Automake 工具。现在。我找不到检测 --prefix 值的方法 这样我就可以搜索我的应用程序的配置文件。

有办法做到这一点吗?一些我能读懂的#ifdef

提前致谢。

I'm working with C and Automake tools. Now. I can't find a way to detect the --prefix value
so I can search for my config files for my application.

Is there a way to do this? Some #ifdef that I can read?

Thanks in advance.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

极致的悲 2024-12-28 12:20:41

我不想回答我自己的问题,但感谢你们,我弄清楚了如何使其

ok. it was like hits

AM_CPPFLAGS= -D '_ROOT_="$(prefix)"' 

在需要的地方使用单引号和双引号,然后在我的代码中

#ifdef _ROOT_
printf ("valor %s",_ROOT_); 
#endif

I don't like to answer my own question but thanks to you goys i figured it out how to make it work

ok. it was like hits

AM_CPPFLAGS= -D '_ROOT_="$(prefix)"' 

the single and double quotes where needed, then in my code

#ifdef _ROOT_
printf ("valor %s",_ROOT_); 
#endif
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文