Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

nob build fails on windows when called without file extension #29

Open
OetkenPurveyorOfCode opened this issue Sep 27, 2023 · 1 comment

Comments

@OetkenPurveyorOfCode
Copy link

Running nob without .exe file extension fails.

w:\musializer>nob build
[INFO] renaming nob -> nob.old
[ERROR] could not rename nob to nob.old: 2

The application takes its name from argv[0] which is nob and tries to rename a file name nob that does not exist. (Hint: The file name is nob.exe)

The build system should append the appropriate file extension to support being called without .exe.

One way to achieve this functionality would be:

    char pathbuf[MAX_PATH];
    GetModuleFileNameA(NULL, pathbuf, MAX_PATH);

To retrieve the binary path instead of using argv[0].

I think one should consider what should happen when the executable is called with a relative path.

w:\musializer>cd build
w:\musializer\build>..\nob.exe
[ERROR] Could not open file nob.c: 2

I think the build system could assume that nob.exe and nob.c are always in the same directory. To support calling the build system from a different working directory, the directory the binary lives in should be prepended to the file name of the source file to generate the full source file path.

@davehorner
Copy link
Contributor

just ran into this [ERROR] Could not open file nob.c: 2 error. thank you for your issue. adding .exe did work.

I am now at something with my shellapi.

[INFO] CMD: cl.exe /I ./raylib/raylib-4.5.0/src/ /Fobuild\ /Febuild\musializer.exe ./src/musializer.c ./src/plug.c ./src/ffmpeg_windows.c /link /LIBPATH:build/raylib/win64-msvc raylib.lib Winmm.lib gdi32.lib User32.lib Shell32.lib
Microsoft (R) C/C++ Optimizing Compiler Version 19.37.32824 for x86
Copyright (C) Microsoft Corporation.  All rights reserved.

musializer.c
plug.c
C:\Program Files (x86)\Windows Kits\10\\include\10.0.22621.0\\um\shellapi.h(68): error C2061: syntax error: identifier 'DECLSPEC_IMPORT'
C:\Program Files (x86)\Windows Kits\10\\include\10.0.22621.0\\um\shellapi.h(68): error C2059: syntax error: ';'
C:\Program Files (x86)\Windows Kits\10\\include\10.0.22621.0\\um\shellapi.h(68): error C2143: syntax error: missing '{' before '*'
C:\Program Files (x86)\Windows Kits\10\\include\10.0.22621.0\\um\shellapi.h(68): error C2061: syntax error: identifier 'CommandLineToArgvW'
C:\Program Files (x86)\Windows Kits\10\\include\10.0.22621.0\\um\shellapi.h(68): error C2059: syntax error: ';'
C:\Program Files (x86)\Windows Kits\10\\include\10.0.22621.0\\um\shellapi.h(68): error C2146: syntax error: missing ')' before identifier 'lpCmdLine'
C:\Program Files (x86)\Windows Kits\10\\include\10.0.22621.0\\um\shellapi.h(68): error C2061: syntax error: identifier 'lpCmdLine'
C:\Program Files (x86)\Windows Kits\10\\include\10.0.22621.0\\um\shellapi.h(68): error C2059: syntax error: ','
C:\Program Files (x86)\Windows Kits\10\\include\10.0.22621.0\\um\shellapi.h(68): error C2059: syntax error: ')'
C:\Program Files (x86)\Windows Kits\10\\include\10.0.22621.0\\um\shellapi.h(82): error C2061: syntax error: identifier 'DECLSPEC_IMPORT'
C:\Program Files (x86)\Windows Kits\10\\include\10.0.22621.0\\um\shellapi.h(82): error C2059: syntax error: ';'
C:\Program Files (x86)\Windows Kits\10\\include\10.0.22621.0\\um\shellapi.h(82): error C2061: syntax error: identifier 'STDAPICALLTYPE'
C:\Program Files (x86)\Windows Kits\10\\include\10.0.22621.0\\um\shellapi.h(82): error C2146: syntax error: missing ')' before identifier 'hDrop'
C:\Program Files (x86)\Windows Kits\10\\include\10.0.22621.0\\um\shellapi.h(82): error C2061: syntax error: identifier 'hDrop'
C:\Program Files (x86)\Windows Kits\10\\include\10.0.22621.0\\um\shellapi.h(82): error C2059: syntax error: ';'
C:\Program Files (x86)\Windows Kits\10\\include\10.0.22621.0\\um\shellapi.h(82): error C2059: syntax error: ','
C:\Program Files (x86)\Windows Kits\10\\include\10.0.22621.0\\um\shellapi.h(82): error C2059: syntax error: ')'
C:\Program Files (x86)\Windows Kits\10\\include\10.0.22621.0\\um\shellapi.h(84): error C2061: syntax error: identifier 'DECLSPEC_IMPORT'
C:\Program Files (x86)\Windows Kits\10\\include\10.0.22621.0\\um\shellapi.h(84): error C2059: syntax error: ';'
C:\Program Files (x86)\Windows Kits\10\\include\10.0.22621.0\\um\shellapi.h(84): error C2061: syntax error: identifier 'STDAPICALLTYPE'
C:\Program Files (x86)\Windows Kits\10\\include\10.0.22621.0\\um\shellapi.h(84): error C2146: syntax error: missing ')' before identifier 'hDrop'
C:\Program Files (x86)\Windows Kits\10\\include\10.0.22621.0\\um\shellapi.h(84): error C2061: syntax error: identifier 'hDrop'
C:\Program Files (x86)\Windows Kits\10\\include\10.0.22621.0\\um\shellapi.h(84): error C2059: syntax error: ';'
C:\Program Files (x86)\Windows Kits\10\\include\10.0.22621.0\\um\shellapi.h(84): error C2059: syntax error: ','
C:\Program Files (x86)\Windows Kits\10\\include\10.0.22621.0\\um\shellapi.h(84): error C2059: syntax error: ')'
C:\Program Files (x86)\Windows Kits\10\\include\10.0.22621.0\\um\shellapi.h(90): error C2061: syntax error: identifier 'DECLSPEC_IMPORT'
C:\Program Files (x86)\Windows Kits\10\\include\10.0.22621.0\\um\shellapi.h(90): error C2059: syntax error: ';'
C:\Program Files (x86)\Windows Kits\10\\include\10.0.22621.0\\um\shellapi.h(90): error C2061: syntax error: identifier 'STDAPICALLTYPE'
C:\Program Files (x86)\Windows Kits\10\\include\10.0.22621.0\\um\shellapi.h(90): error C2146: syntax error: missing ')' before identifier 'hDrop'
C:\Program Files (x86)\Windows Kits\10\\include\10.0.22621.0\\um\shellapi.h(90): error C2061: syntax error: identifier 'hDrop'
C:\Program Files (x86)\Windows Kits\10\\include\10.0.22621.0\\um\shellapi.h(90): error C2059: syntax error: ';'
C:\Program Files (x86)\Windows Kits\10\\include\10.0.22621.0\\um\shellapi.h(90): error C2059: syntax error: ','
C:\Program Files (x86)\Windows Kits\10\\include\10.0.22621.0\\um\shellapi.h(90): error C2059: syntax error: ')'
C:\Program Files (x86)\Windows Kits\10\\include\10.0.22621.0\\um\shellapi.h(91): error C2061: syntax error: identifier 'DECLSPEC_IMPORT'
C:\Program Files (x86)\Windows Kits\10\\include\10.0.22621.0\\um\shellapi.h(91): error C2059: syntax error: ';'
C:\Program Files (x86)\Windows Kits\10\\include\10.0.22621.0\\um\shellapi.h(91): error C2061: syntax error: identifier 'DragFinish'
C:\Program Files (x86)\Windows Kits\10\\include\10.0.22621.0\\um\shellapi.h(91): error C2059: syntax error: ';'
C:\Program Files (x86)\Windows Kits\10\\include\10.0.22621.0\\um\shellapi.h(91): error C2146: syntax error: missing ')' before identifier 'hDrop'
C:\Program Files (x86)\Windows Kits\10\\include\10.0.22621.0\\um\shellapi.h(91): error C2061: syntax error: identifier 'hDrop'
C:\Program Files (x86)\Windows Kits\10\\include\10.0.22621.0\\um\shellapi.h(91): error C2059: syntax error: ')'
C:\Program Files (x86)\Windows Kits\10\\include\10.0.22621.0\\um\shellapi.h(92): error C2061: syntax error: identifier 'DECLSPEC_IMPORT'
C:\Program Files (x86)\Windows Kits\10\\include\10.0.22621.0\\um\shellapi.h(92): error C2059: syntax error: ';'
C:\Program Files (x86)\Windows Kits\10\\include\10.0.22621.0\\um\shellapi.h(92): error C2061: syntax error: identifier 'DragAcceptFiles'
C:\Program Files (x86)\Windows Kits\10\\include\10.0.22621.0\\um\shellapi.h(92): error C2059: syntax error: ';'
C:\Program Files (x86)\Windows Kits\10\\include\10.0.22621.0\\um\shellapi.h(92): error C2146: syntax error: missing ')' before identifier 'hWnd'
C:\Program Files (x86)\Windows Kits\10\\include\10.0.22621.0\\um\shellapi.h(92): error C2061: syntax error: identifier 'hWnd'
C:\Program Files (x86)\Windows Kits\10\\include\10.0.22621.0\\um\shellapi.h(92): error C2059: syntax error: ','
C:\Program Files (x86)\Windows Kits\10\\include\10.0.22621.0\\um\shellapi.h(92): error C2059: syntax error: ')'
C:\Program Files (x86)\Windows Kits\10\\include\10.0.22621.0\\um\shellapi.h(94): error C2061: syntax error: identifier 'DECLSPEC_IMPORT'
C:\Program Files (x86)\Windows Kits\10\\include\10.0.22621.0\\um\shellapi.h(94): error C2059: syntax error: ';'
C:\Program Files (x86)\Windows Kits\10\\include\10.0.22621.0\\um\shellapi.h(94): error C2061: syntax error: identifier 'STDAPICALLTYPE'
C:\Program Files (x86)\Windows Kits\10\\include\10.0.22621.0\\um\shellapi.h(94): error C2146: syntax error: missing ')' before identifier 'hwnd'
C:\Program Files (x86)\Windows Kits\10\\include\10.0.22621.0\\um\shellapi.h(94): error C2061: syntax error: identifier 'hwnd'
C:\Program Files (x86)\Windows Kits\10\\include\10.0.22621.0\\um\shellapi.h(94): error C2059: syntax error: ';'
C:\Program Files (x86)\Windows Kits\10\\include\10.0.22621.0\\um\shellapi.h(94): error C2059: syntax error: ','
C:\Program Files (x86)\Windows Kits\10\\include\10.0.22621.0\\um\shellapi.h(95): error C2059: syntax error: ')'
C:\Program Files (x86)\Windows Kits\10\\include\10.0.22621.0\\um\shellapi.h(96): error C2061: syntax error: identifier 'DECLSPEC_IMPORT'
C:\Program Files (x86)\Windows Kits\10\\include\10.0.22621.0\\um\shellapi.h(96): error C2059: syntax error: ';'
C:\Program Files (x86)\Windows Kits\10\\include\10.0.22621.0\\um\shellapi.h(96): error C2061: syntax error: identifier 'STDAPICALLTYPE'
C:\Program Files (x86)\Windows Kits\10\\include\10.0.22621.0\\um\shellapi.h(96): error C2146: syntax error: missing ')' before identifier 'hwnd'
C:\Program Files (x86)\Windows Kits\10\\include\10.0.22621.0\\um\shellapi.h(96): error C2061: syntax error: identifier 'hwnd'
C:\Program Files (x86)\Windows Kits\10\\include\10.0.22621.0\\um\shellapi.h(96): error C2059: syntax error: ';'
C:\Program Files (x86)\Windows Kits\10\\include\10.0.22621.0\\um\shellapi.h(96): error C2059: syntax error: ','
C:\Program Files (x86)\Windows Kits\10\\include\10.0.22621.0\\um\shellapi.h(97): error C2059: syntax error: ')'
C:\Program Files (x86)\Windows Kits\10\\include\10.0.22621.0\\um\shellapi.h(104): error C2061: syntax error: identifier 'DECLSPEC_IMPORT'
C:\Program Files (x86)\Windows Kits\10\\include\10.0.22621.0\\um\shellapi.h(104): error C2059: syntax error: ';'
C:\Program Files (x86)\Windows Kits\10\\include\10.0.22621.0\\um\shellapi.h(104): error C2061: syntax error: identifier 'STDAPICALLTYPE'
C:\Program Files (x86)\Windows Kits\10\\include\10.0.22621.0\\um\shellapi.h(104): error C2146: syntax error: missing ')' before identifier 'lpFile'
C:\Program Files (x86)\Windows Kits\10\\include\10.0.22621.0\\um\shellapi.h(104): error C2061: syntax error: identifier 'lpFile'
C:\Program Files (x86)\Windows Kits\10\\include\10.0.22621.0\\um\shellapi.h(104): error C2059: syntax error: ';'
C:\Program Files (x86)\Windows Kits\10\\include\10.0.22621.0\\um\shellapi.h(104): error C2059: syntax error: ','
C:\Program Files (x86)\Windows Kits\10\\include\10.0.22621.0\\um\shellapi.h(104): error C2059: syntax error: ')'
C:\Program Files (x86)\Windows Kits\10\\include\10.0.22621.0\\um\shellapi.h(106): error C2061: syntax error: identifier 'DECLSPEC_IMPORT'
C:\Program Files (x86)\Windows Kits\10\\include\10.0.22621.0\\um\shellapi.h(106): error C2059: syntax error: ';'
C:\Program Files (x86)\Windows Kits\10\\include\10.0.22621.0\\um\shellapi.h(106): error C2061: syntax error: identifier 'STDAPICALLTYPE'
C:\Program Files (x86)\Windows Kits\10\\include\10.0.22621.0\\um\shellapi.h(106): error C2146: syntax error: missing ')' before identifier 'lpFile'
C:\Program Files (x86)\Windows Kits\10\\include\10.0.22621.0\\um\shellapi.h(106): error C2061: syntax error: identifier 'lpFile'
C:\Program Files (x86)\Windows Kits\10\\include\10.0.22621.0\\um\shellapi.h(106): error C2059: syntax error: ';'
C:\Program Files (x86)\Windows Kits\10\\include\10.0.22621.0\\um\shellapi.h(106): error C2059: syntax error: ','
C:\Program Files (x86)\Windows Kits\10\\include\10.0.22621.0\\um\shellapi.h(106): error C2059: syntax error: ')'
C:\Program Files (x86)\Windows Kits\10\\include\10.0.22621.0\\um\shellapi.h(113): error C2061: syntax error: identifier 'DECLSPEC_IMPORT'
C:\Program Files (x86)\Windows Kits\10\\include\10.0.22621.0\\um\shellapi.h(113): error C2059: syntax error: ';'
C:\Program Files (x86)\Windows Kits\10\\include\10.0.22621.0\\um\shellapi.h(113): error C2061: syntax error: identifier 'STDAPICALLTYPE'
C:\Program Files (x86)\Windows Kits\10\\include\10.0.22621.0\\um\shellapi.h(113): error C2146: syntax error: missing ')' before identifier 'hWnd'
C:\Program Files (x86)\Windows Kits\10\\include\10.0.22621.0\\um\shellapi.h(113): error C2061: syntax error: identifier 'hWnd'
C:\Program Files (x86)\Windows Kits\10\\include\10.0.22621.0\\um\shellapi.h(113): error C2059: syntax error: ';'
C:\Program Files (x86)\Windows Kits\10\\include\10.0.22621.0\\um\shellapi.h(113): error C2059: syntax error: ','
C:\Program Files (x86)\Windows Kits\10\\include\10.0.22621.0\\um\shellapi.h(113): error C2059: syntax error: ')'
C:\Program Files (x86)\Windows Kits\10\\include\10.0.22621.0\\um\shellapi.h(114): error C2061: syntax error: identifier 'DECLSPEC_IMPORT'
C:\Program Files (x86)\Windows Kits\10\\include\10.0.22621.0\\um\shellapi.h(114): error C2059: syntax error: ';'
C:\Program Files (x86)\Windows Kits\10\\include\10.0.22621.0\\um\shellapi.h(114): error C2061: syntax error: identifier 'STDAPICALLTYPE'
C:\Program Files (x86)\Windows Kits\10\\include\10.0.22621.0\\um\shellapi.h(114): error C2146: syntax error: missing ')' before identifier 'hWnd'
C:\Program Files (x86)\Windows Kits\10\\include\10.0.22621.0\\um\shellapi.h(114): fatal error C1003: error count exceeds 100; stopping compilation
ffmpeg_windows.c
./src/ffmpeg_windows.c(79): warning C4047: 'initializing': 'FFMPEG *' differs in levels of indirection from 'int'
Generating Code...
[ERROR] command exited with exit code 2

OetkenPurveyorOfCode pushed a commit to OetkenPurveyorOfCode/musializer that referenced this issue Oct 22, 2023
To support loading filenames with unicode characters on windows, declare UTF-8
support in the manifest file.
OetkenPurveyorOfCode pushed a commit to OetkenPurveyorOfCode/musializer that referenced this issue Oct 22, 2023
To support loading filenames with unicode characters on windows, declare UTF-8
support in the manifest file.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants