Compiling from the command line?

Started by Quin, May 02, 2025, 03:17:39 AM

Previous topic - Next topic

Quin

Hi,
I'm trying to compile a basic C program from the command line using CC, and having trouble.
I figured I'd use cc because my PoIDE can compile large C programs just fine, so CC should work. However, trying:
cc /Ze main.c
I just get a .obj file; no executable is generated. I couldn't tell from the CC docs how to generate an executable file.
I also looked at the pomake docs, it may be a better fit for what I want to do if CC doesn't fit my needs, but I'm honestly unsure, I'm coming from WinLibs with GCC and mingw32-make...  :-[
Any advice here would be much appreciated!
Use the assembly, Luke.

TimoVJL

#1
Sadly cc don't work in v13
So bugs exist
May the source be with you

Quin

Hi Timo,
Ah, makes sense. Thanks for the info.
Use the assembly, Luke.

John Z

Quote from: Quin on May 02, 2025, 03:17:39 AMI'm trying to compile a basic C program from the command line using CC,

If you want to do command line processing without cc you would need to use pocc.exe, polink.exe, and porc.exe.  There are some batch files that can be used. They have not yet been tested in V13 though.

John Z

TimoVJL

#4
That was actually a bug report from cc.exe.
Naturally we should test everything.
May the source be with you

Quin

Quote from: John Z on May 02, 2025, 04:09:54 PMIf you want to do command line processing without cc you would need to use pocc.exe, polink.exe, and porc.exe.  There are some batch files that can be used. They have not yet been tested in V13 though.

John Z
Hi John Z,
Thanks for this, I see the batch files you mean. I'll try them later today, although the reason I went with cc originally is because it fetches settings from my poide, which I know works.
In fact, I actually currently use poide to compile my C code, I just can't use it to edit it. I was more curious if there's a way for me to do this without needing to open the IDE at all.
Also out of curiosity, why batch scripts and not pomake makefiles?
Thanks!
Use the assembly, Luke.

John Z

Hi Quin,

The batch files were developed to mitigate the bug when running WIN11 24H2. I'm not sure but maybe pomake was also affected by the alignment bug as well.

The batch files can be used without opening or using the IDE but they, or at least the master, needed to be edited for the build parameters.  The only one a little tedious is the file needed for linking.  So there is an Add-In to help with that, but if not using the IDE at all the file can be manually generated.

John Z

Vortex

The \PellesC\bin folder hosts two batch files named povars64.bat and povars32.bat They set the environment variables facilitating the command-line work.
Code it... That's all...

TimoVJL

#8
cc.exe is handy, as it read INCLUDE and LIB from registry.

I tried with this too:
Windows Registry Editor Version 5.00

[HKEY_CURRENT_USER\Software\Classes\*\shell\Open With CC\command]
@="\"cmd.exe\" \"/k C:\\code\\PellesC12\\bin\\cc.exe -Ze \"%1\""
May the source be with you

John Z

So just to clarify, because I became confused myself.

CC does not currently work in V13, there is a bug report.

To learn/use CC use the Pelle C version 12 release, and presumably not on WIN 11 24H2

Right?

John Z

Quin

@John, your understanding is the same as mine, so let's hope we're both correct :D
Use the assembly, Luke.