This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
gcc works well from console, but not from my program
- From: Egor Pugin <egor dot pugin at gmail dot com>
- To: gcc-help at gcc dot gnu dot org
- Date: Wed, 23 May 2018 22:44:45 +0300
- Subject: 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