stange -I 与 make 和 bad -L 的效果
我正在尝试构建一个自动化构建系统。 我花了一些时间将一个工作的 wii 通用 makefile 更改为一个工作的 win32(使用 mingw32)makefile。
我的制作在这里 http://pastie.org/319482
奇怪的效果是,如果我删除前面的ABS_INCL(第 31 行)中的路径构建不起作用,并抱怨缺少第一个路径指定的标头。 它为什么要这样做? 我无法追踪问题。
下一个问题是,当我放入需要 libcurl 的代码时,我仍然可以编译,但不再按预期链接。 我将curl添加到我的库(第47行)和路径(第53行)中,看起来我正确地包含了它,并且库的顺序正确(我在将wii转换为win32时尝试尽可能少地接触)并且我看不出问题所在。 有谁知道为什么会发生这种情况?
这是用于测试的简单源
#include <stdio.h>
void main2();
int main( int argc, const char* argv[])
{
int a=0;
printf("hey");
main2();
return 0;
}
#include <curl/curl.h>
void main2()
{
CURL *curl = curl_easy_init();
curl_easy_cleanup(curl);
}
I am trying to build an automated build system. It took me a little while to change a working wii generic makefile to a working win32 (using mingw32) makefile.
my make is here http://pastie.org/319482
The weird effect is, if i remove the a preceding the paths in ABS_INCL (line 31) the build doesnt work and complains about missing a header which is specified by the first path. Why is it doing this? i cant track the problem down.
The next issue is when i dropped in code that requires libcurl, i can still compile but no longer link as expected. I added curl to my libs (line 47) and the path (line 53) and it looks like i am including it right and the lib is in the right order (i tried to touch as little as possible while converting wii to win32) and i cant see the problem. Does anyone know why this is happening?
here is simple source to test with
#include <stdio.h>
void main2();
int main( int argc, const char* argv[])
{
int a=0;
printf("hey");
main2();
return 0;
}
#include <curl/curl.h>
void main2()
{
CURL *curl = curl_easy_init();
curl_easy_cleanup(curl);
}
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
你在这里得不到很多答案——我要冒险告诉你,这是因为你的标题写得很糟糕。 当它向下滚动主页时,我已经读了大约 20 遍,但我仍然没有真正理解它。 有一个明显的拼写错误,我想进去修复它,但是“-l”和“-L”很奇怪,我不知道你要去哪里。
所以,大多数人都会看到这一点,然后就空白并继续前进。 假设他们通过了这一点,您未能将 makefile 中包含的有用信息添加到问题中,因此您必须离开并在其他站点上阅读它。
最后,还有一个障碍,你的 makefile 太长,不容易阅读和吸收。 因此,假设像我这样真正有决心的人去阅读它,就很难判断问题出在哪里。 您需要将其编辑到大约十行或更少,然后假设您无法找出问题,那么您可以仅发布显示问题中的那几行,然后使用合适的标题和一些好的描述性文字,您可能会得到答案。
我猜你的问题的答案并不是那么难,你已经成功地混淆了它,以至于大多数人都不会打扰。
You're not getting a lot of answers here - I'm going to go out on a limb and tell you it's because of your really badly written title. I've read it maybe 20 times as it scrolled down the home page and I still don't really get it. There is the obvious spelling mistake, and I want to go in and fix that but then there is the whole weirdness with the "-l" and "-L" and I can't tell where you are going with that.
So, most people will look at that and just blank out and move on. Assuming they get past that, you failed to add the useful information contained within your makefile to the question and so you've gotta go off and read it on the other site.
Finally, as one more hurdle, your makefile is too long to easily read and absorb. So assuming someone like me who is really kind of determined goes and reads it, it's too difficult to tell where the problem could lie within that. You need to edit it down to probably ten lines or less, and then assuming you haven't been able to figure out the problem, you could then post just those few lines that showed the problem in your question and then with a decent title and some good descriptive text, you'll probably get your answer.
I'm guessing the answer to your question isn't even that hard, you've successfully managed to obfuscate it to the point that most people wont even bother.