[Scons-users] First time scons user: Can't get a simple example working on windows machine
Bill Deegan
bill at baddogconsulting.com
Wed Aug 24 16:19:11 EDT 2022
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 <amine.aboufirass at gmail.com> 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
> Scons-users at scons.org
> https://pairlist4.pair.net/mailman/listinfo/scons-users
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://pairlist4.pair.net/pipermail/scons-users/attachments/20220824/e2a6fa67/attachment.htm>
More information about the Scons-users
mailing list