开发者

gcc #include <> and #include "", can I compile without changing one to the other?

I have been asked to recompile a rather old library of EMG processing cold so it works on modern Macs rather than the ancient SunOS workstation it is currently running on. It's been a painful road for someone not very experienced with makefiles, but after reading all over the internet this has me stumped.

The makefiles (generated by imake) are calling gcc with the following arguments for each source file, but are failing with 'Undefined symbols' errors:

gcc -I[First Include Path] -I[Second Include Path] -I. -c [File Name].c
gcc -o [Output File Name] [Include a bunch of libraries] -lm

What I assume is the root of the problem is ALL of the #include statements use <> for the system libraries, .h in the include directories, and the .h in the same directory as the .c file being compiled. I know its wrong, but thats the way it is. If I change them to "" for only the .h in the same directory as the .c being compiled then everything works out fine.

Of course I would rather not do this individually for hundreds of files. So, is there some change I can make so gcc will look in the current directory for #include <>? as from reading up on the search path I gather it does not by default?

Or am I doomed to continue with my current plan of some sort of hack j开发者_如何学Goob bulk find and replace?


In my experience #include "" will also work for system headers. So you can try replace all #include <> to #include "", if you don't care differentiating local and system headers.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜