Re: First time scons user: Can't get a simple example working on windows machine

Bill Deegan <[email protected]>
Newsgroups gmane.comp.programming.tools.scons.user
Message-ID <CAEyG4CE0L3-AekpJw=_7=XuSO5QYcbpT7MJpRzA8ATEdsboCNw@mail.gmail.com>
For the record (This was resolved on discord server)

On windows you'll need to run as
scons helloworld.exe

This is due to the actual target from

env.Program(target='helloworld', source=['helloworld.c']) # build targets

Being : helloworld.exe since on windows there's a Environment() variable
PROGRAMSUFFIX which is automatically appended to any target which doesn't
include it modifying the target file name.

If you wanted to always be able to have a command line argument
(target/alias) for scons regardless of the platform.
x=env.Program('helloworld','helloworld.c')
env.Alias("helloworld_app",x)

would work.

On Wed, Aug 24, 2022 at 4:56 AM A A <[email protected]> wrote:

> Warning, I’m crossposting from stackexchange:
> https://stackoverflow.com/questions/73471918/basic-scons-example-throwing-do-not-know-how-to-make-file-target-helloworld-e
>
> I’m trying to follow this
> <https://github.com/SCons/scons/wiki/SconsTutorial1> tutorial to build a
> simple C program using SCons. I created a file called SConstruct which
> contains the following:
>
> env = Environment() # construction environment
> env.Program(target='helloworld', source=['helloworld.c']) # build targets
>
> I created a file called helloworld.c which includes the following:
>
> #include <stdio.h>
>
> int main()
> {
>     printf("Hello World.");
> }
>
> Then I tried building from Powershell as follows:
>
> scons helloworld
>
> Unfortunately I got the following output
>
> scons: Reading SConscript files ...
> scons: done reading SConscript files.
> scons: Building targets ...
> scons: building terminated because of errors.
> scons: *** Do not know how to make File target `helloworld` (..\scons-tutorial\helloworld). Stop.
>
> I followed the steps in the tutorial very closely, so I’m not sure what
> else I can do at this point. What am I doing wrong here?
>
> _______________________________________________
> Scons-users mailing list
> [email protected]
> https://pairlist4.pair.net/mailman/listinfo/scons-users
>

_______________________________________________
Scons-users mailing list
[email protected]
https://pairlist4.pair.net/mailman/listinfo/scons-users
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.