Unable to find or execute POCC.EXE

Started by Ali, July 28, 2018, 11:40:18 AM

Previous topic - Next topic

Ali

Hi
My name is Ali,

I would like to thank you for this awesome C compiler. I use it on daily basis and I couldn't find any other alternative on Windows. But, I have a little problem. Whenever I try to compile a C file from the PowerShell, an error message would pop saying "Unable to find or execute POCC.EXE."
Here is the line I use for compilation:
cc -Tamd64-coff name.c

The problem only happens with the PowerShell, it works fine with the CMD. I tried both the 8.00 and the newer 9.00 BETA version but still, without any luck.

I have the environment set right, and I use visual code as my text editor.

Any suggestion would be much appreciated

TimoVJL

#1
CC works in Win 8.1 using full path for cc.exe
or using
$env:Path += ";C:\code\PellesC9\bin"

EDIT:
cc.exe have a problem in Windows 10 with Path with spaces in path.
cc mess extension with random chars in pocc filename, like pocc.e???.

PowerShell needs a special way to call program from "C:\Program Files\"
C:\Program` Files\PellesC9\bin\cc.exe
May the source be with you

Ali

It works fine on Windows 10 too, but not with PowerShell

frankie

PwerShell uses the environment inherited from the calling process.
If the calling process change the environment or specifically alter the %PATH% variable removing the references to PellesC binaries you'll not be able to access them.
If you have correctly set the global (system) environment, try to launch PowerShell from the system (i.e. start menu) it should work.
Keep in mind that path and other system settings can be delayed on change so just modifying the system PATH and launch PowerShell from system can require a restart of explore.exe or simply a reboot.
"It is better to be hated for what you are than to be loved for what you are not." - Andre Gide

Ali

I have the path set to:
C:\Program Files\PellesC\Bin

I have also tried to reboot and lunch the PowerShell from the start menu, but nothing seems to work.

TimoVJL

#5
You could make a copy of PellesC to path without spaces and test it there
Also create a bug report for cc.exe usage in PowerShell.

EDIT: for PowersHell experts: how to execute :D
C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.14.26428\bin\Hostx64\x64\cl.exe
May the source be with you

Ali

And it worked! I have made a copy without the spaces and it works just fine. I wonder why the PowerShell messes with the spaces like that....is it a bug in PowerShell? or is it the way it works?

danz68

I am trying to run cc.exe (with full path) with correct arguments from command line (not Power Shell). I confirm that if the path of cc.exe has spaces in it, it doesn't run (Unable to find or execute POCC.EXE). This does not happen when the whole environment is installed in a path without spaces. Then it runs just fine.

frankie

"It is better to be hated for what you are than to be loved for what you are not." - Andre Gide

danz68

that's what I did. it seems cc.exe does not invoke pocc with double quotes paths. Eventually I gave up using "cc" and used directly pocc with double quotes paths and that worked.

frankie

The internal processing of cc could add quotes, or using a CreteProcess() function the executable path is taken directly without need of quotes.
The driver compiler command cc is something coming from long time ago, and can conflict if you have more different compilers installed. To use pocc directly is the preferred solution.
"It is better to be hated for what you are than to be loved for what you are not." - Andre Gide