This is the mail archive of the gcc-help@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

gcc works well from console, but not from my program


Hi!

Summary

I'm spawning gcc from my program via fork/exec* (via libuv) and it fails.
When I run the same command from bash (ubuntu 18.04), it works.
How can I debug the issue? Any guesses how to resolve it?

Details

All of gcc commands invoked from my program works well except this
one. When I add -include option (-includesw/driver/cpp/sw.h), gcc
fails with
cc1plus: fatal error: sw/driver/cpp/sw.h: No such file or directory
compilation terminated.

When I add full path, gcc sees that include, incudes it and then
completely miss any include from that file:
/home/egor/dev/cppan3/include/sw/driver/cpp/sw.h:4:10: fatal error:
solution.h: No such file or directory
 #include <solution.h>
          ^~~~~~~~~~~~
compilation terminated.

Include paths are present on command line and correct (everything is
passed via -I, also tried with -isystem). Both variants above works
well from bash.
-include file is not precompiled.
libuv spawns gcc process with same environment as my app.

Full command: https://pastebin.com/2UryXrUM

-- 
Egor Pugin


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]