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

Windows tcc 'mmreg.h' not found #9

Open
jcweaver997 opened this issue Sep 1, 2022 · 17 comments
Open

Windows tcc 'mmreg.h' not found #9

jcweaver997 opened this issue Sep 1, 2022 · 17 comments
Labels
bug Something isn't working cc-tinycc

Comments

@jcweaver997
Copy link

v version: V 0.3.1 728b198
raylib.v version: v0.3.0 commit 7f752f1e230910652221a61633236edfe7e42956
Hi, following the installation steps I encountered the following error:

PS C:\Users\Jweaver\Documents\git\vtest> cd C:\Users\Jweaver\.vmodules\irishgreencitrus\raylibv
PS C:\Users\Jweaver\.vmodules\irishgreencitrus\raylibv> v run installraylib.vsh
Cloning Raylib v4.2.0 to C:\Users\Jweaver\AppData\Local\Temp/raylib_01GBWYQB2ZDQDS635YN4P6C1A3 ...
This may take a few minutes depending on the speed of your internet connection.
Cloning completed.
Compiling Raylib with V's tcc...
Building raudio...
In file included from raudio.c:136:
In file included from c:/users/jweaver/documents/git/v/thirdparty/tcc/include/winapi/windows.h:17:
c:/users/jweaver/documents/git/v/thirdparty/tcc/include/_mingw.h:137: warning: NOSERVICE redefined
In file included from raudio.c:136:
In file included from c:/users/jweaver/documents/git/v/thirdparty/tcc/include/winapi/windows.h:17:
c:/users/jweaver/documents/git/v/thirdparty/tcc/include/_mingw.h:138: warning: NOMCX redefined
In file included from raudio.c:154:
raudio.c:154: error: include file 'mmreg.h' not found

V panic: Building raudio failed.
Command:
"C:\Users\Jweaver\Documents\git\v\thirdparty\tcc\tcc.exe" -Wall -D_DEFAULT_SOURCE -DPLATFORM_DESKTOP -DGRAPHICS_API_OPENGL_33 -Wno-missing-braces -Werror=pointer-arith -fno-strict-aliasing  -std=c99 -fPIC -O1 -Werror=implicit-function-declaration -I. -Iexternal/glfw/include -Iexternal/glfw/deps/mingw -I"C:\Users\Jweaver\Documents\git\v\thirdparty\tcc\tcc.exe" -c raudio.c
v hash: 728b198
C:/Users/Jweaver/AppData/Local/Temp/v_0/installraylib.8936925449095169056.tmp.c:8399: at _v_panic: Backtrace
C:/Users/Jweaver/AppData/Local/Temp/v_0/installraylib.8936925449095169056.tmp.c:20756: by main__main
C:/Users/Jweaver/AppData/Local/Temp/v_0/installraylib.8936925449095169056.tmp.c:21223: by wmain
004b77f0 : by ???
004b7953 : by ???
7ffea5437034 : by ??
@irishgreencitrus
Copy link
Owner

Can you run with
export VERBOSE=1

@jcweaver997
Copy link
Author

PS C:\Users\Jweaver\.vmodules\irishgreencitrus\raylibv> $env:VERBOSE = '1'
PS C:\Users\Jweaver\.vmodules\irishgreencitrus\raylibv> v run installraylib.vsh
Cloning Raylib v4.2.0 to C:\Users\Jweaver\AppData\Local\Temp/raylib_01GBZ8KA5VA2TRH2JDKPE8TVXD ...
This may take a few minutes depending on the speed of your internet connection.
> command: git clone --branch 4.2.0 --depth 1 --single-branch https://github.com/raysan5/raylib.git "C:\Users\Jweaver\AppData\Local\Temp/raylib_01GBZ8KA5VA2TRH2JDKPE8TVXD"
> result: Cloning into 'C:\Users\Jweaver\AppData\Local\Temp/raylib_01GBZ8KA5VA2TRH2JDKPE8TVXD'...
Note: switching to 'bf2ad9df5fdcaa385b2a7f66fd85632eeebbadaa'.

You are in 'detached HEAD' state. You can look around, make experimental
changes and commit them, and you can discard any commits you make in this
state without impacting any branches by switching back to a branch.

If you want to create a new branch to retain commits you create, you may
do so (now or later) by using -c with the switch command. Example:

  git switch -c <new-branch-name>

Or undo this operation with:

  git switch -

Turn off this advice by setting config variable advice.detachedHead to false

Updating files: 100% (865/865), done.

Cloning completed.
Compiling Raylib with V's tcc...
Building raudio...
> command: "C:\Users\Jweaver\Documents\git\v\thirdparty\tcc\tcc.exe" -Wall -D_DEFAULT_SOURCE -DPLATFORM_DESKTOP -DGRAPHICS_API_OPENGL_33 -Wno-missing-braces -Werror=pointer-arith -fno-strict-aliasing  -std=c99 -fPIC -O1 -Werror=implicit-function-declaration -I. -Iexternal/glfw/include -Iexternal/glfw/deps/mingw -I"C:\Users\Jweaver\Documents\git\v\thirdparty\tcc\tcc.exe" -c raudio.c
> result: In file included from raudio.c:136:
In file included from c:/users/jweaver/documents/git/v/thirdparty/tcc/include/winapi/windows.h:17:
c:/users/jweaver/documents/git/v/thirdparty/tcc/include/_mingw.h:137: warning: NOSERVICE redefined
In file included from raudio.c:136:
In file included from c:/users/jweaver/documents/git/v/thirdparty/tcc/include/winapi/windows.h:17:
c:/users/jweaver/documents/git/v/thirdparty/tcc/include/_mingw.h:138: warning: NOMCX redefined
In file included from raudio.c:154:
raudio.c:154: error: include file 'mmreg.h' not found

In file included from raudio.c:136:
In file included from c:/users/jweaver/documents/git/v/thirdparty/tcc/include/winapi/windows.h:17:
c:/users/jweaver/documents/git/v/thirdparty/tcc/include/_mingw.h:137: warning: NOSERVICE redefined
In file included from raudio.c:136:
In file included from c:/users/jweaver/documents/git/v/thirdparty/tcc/include/winapi/windows.h:17:
c:/users/jweaver/documents/git/v/thirdparty/tcc/include/_mingw.h:138: warning: NOMCX redefined
In file included from raudio.c:154:
raudio.c:154: error: include file 'mmreg.h' not found

V panic: Building raudio failed.
Command:
"C:\Users\Jweaver\Documents\git\v\thirdparty\tcc\tcc.exe" -Wall -D_DEFAULT_SOURCE -DPLATFORM_DESKTOP -DGRAPHICS_API_OPENGL_33 -Wno-missing-braces -Werror=pointer-arith -fno-strict-aliasing  -std=c99 -fPIC -O1 -Werror=implicit-function-declaration -I. -Iexternal/glfw/include -Iexternal/glfw/deps/mingw -I"C:\Users\Jweaver\Documents\git\v\thirdparty\tcc\tcc.exe" -c raudio.c
v hash: 728b198
C:/Users/Jweaver/AppData/Local/Temp/v_0/installraylib.10925987983991690099.tmp.c:8399: at _v_panic: Backtrace
C:/Users/Jweaver/AppData/Local/Temp/v_0/installraylib.10925987983991690099.tmp.c:20756: by main__main
C:/Users/Jweaver/AppData/Local/Temp/v_0/installraylib.10925987983991690099.tmp.c:21223: by wmain
004b77f0 : by ???
004b7953 : by ???
7ffea5437034 : by ???

@irishgreencitrus
Copy link
Owner

There seems to be an error in the -I flags, it points to the exe (which is incorrect). I'll check the script to see if this is how it is programmed

@irishgreencitrus
Copy link
Owner

Have a check, this should be fixed now.
If not feel free to reopen

@jcweaver997
Copy link
Author

Seems like line 41 in installraylib.vsh is incorrect, I believe it should be ccinclude = '${@VEXEROOT}/thirdparty/tcc/include'

Even with this change, I still get the same result:

PS C:\Users\Jweaver\.vmodules\irishgreencitrus\raylibv> v run installraylib.vsh
Cloning Raylib v4.2.0 to C:\Users\Jweaver\AppData\Local\Temp/raylib_01GCCQNR8BPWA5P5BCAMPVWB1Z ...
This may take a few minutes depending on the speed of your internet connection.
Cloning completed.
Compiling Raylib with V's tcc...
Building raudio...
In file included from raudio.c:136:
In file included from c:/users/jweaver/documents/git/v/thirdparty/tcc/include/winapi/windows.h:17:
C:/Users/Jweaver/Documents/git/v/thirdparty/tcc/include/_mingw.h:137: warning: NOSERVICE redefined
In file included from raudio.c:136:
In file included from c:/users/jweaver/documents/git/v/thirdparty/tcc/include/winapi/windows.h:17:
C:/Users/Jweaver/Documents/git/v/thirdparty/tcc/include/_mingw.h:138: warning: NOMCX redefined
In file included from raudio.c:154:
raudio.c:154: error: include file 'mmreg.h' not found

V panic: Building raudio failed.
Command:
"C:\Users\Jweaver\Documents\git\v\thirdparty\tcc\tcc.exe" -Wall -D_DEFAULT_SOURCE -DPLATFORM_DESKTOP -DGRAPHICS_API_OPENGL_33 -Wno-missing-braces -Werror=pointer-arith -fno-strict-aliasing  -std=c99 -fPIC -O1 -Werror=implicit-function-declaration -I. -Iexternal/glfw/include -Iexternal/glfw/deps/mingw -I"C:\Users\Jweaver\Documents\git\v\thirdparty\tcc\include" -c raudio.c
v hash: 1c63ce4
C:/Users/Jweaver/AppData/Local/Temp/v_0/installraylib.14338076356001959561.tmp.c:8398: at _v_panic: Backtrace
C:/Users/Jweaver/AppData/Local/Temp/v_0/installraylib.14338076356001959561.tmp.c:20736: by main__main
C:/Users/Jweaver/AppData/Local/Temp/v_0/installraylib.14338076356001959561.tmp.c:21203: by wmain
004b7708 : by ???
004b786b : by ???
7ff8887d7034 : by ???

That being said, I don't believe mmreg.h and a few other header files are located in "thirdparty/tcc/include". I manually added them from C:\Program Files (x86)\Windows Kits\10\Include\10.0.19041.0 but got stuck when I came across strings.h which is used in miniaudio.h. I'm not sure where this header is or even if it exists for windows or tcc. The miniaudio docs say there is no need to link anything in windows https://github.com/mackron/miniaudio#building.

However, after looking at miniaudio.h:

#if !defined(_MSC_VER) && !defined(__DMC__)
    #include <strings.h>    /* For strcasecmp(). */
    #include <wchar.h>      /* For wcslen(), wcsrtombs() */
#endif

Seems like we need to define a strcasecmp function for miniaudio and modify this define for tcc on windows in raylib/src/external/miniaudio.h. I'm not really sure the best way to go about it.
Im also not familiar with tcc, maybe a tcc option could fix this somehow.

@irishgreencitrus
Copy link
Owner

I'm going to start more windows testing, let me know if you have any more information.
TCC doesn't seem to have mmreg.h, as far as I can see.

@boris-741
Copy link

boris-741 commented Sep 14, 2022

@jcweaver997
Copy link
Author

Hi, I tried adding the winapi full, and it did get a lot farther. This is the new output:

Compiling Raylib with V's tcc...
Building raudio...
Building rcore...
In file included from rcore.c:142:
In file included from external/msf_gif.h:249:
external/msf_gif.h:249: error: include file 'emmintrin.h' not found

V panic: Building rcore failed.

@boris-741
Copy link

pay attention raysan5/raylib#435 (comment)

@irishgreencitrus irishgreencitrus added bug Something isn't working cc-tinycc labels Sep 15, 2022
@irishgreencitrus irishgreencitrus changed the title Windows installraylib.vsh raudio build failed: include file 'mmreg.h' not found Windows tcc 'mmreg.h' not found Sep 15, 2022
@MightyPancake
Copy link

I just downloaded the missing header from the internet, that's a workaround.

@irishgreencitrus
Copy link
Owner

I just downloaded the missing header from the internet, that's a workaround.

Can you post the link here?
If this works I could just bundle the header with this library and I think this issue would be solved.

@MightyPancake
Copy link

MightyPancake commented Dec 16, 2022

I just downloaded the missing header from the internet, that's a workaround.

Can you post the link here? If this works I could just bundle the header with this library and I think this issue would be solved.

For me, the following files were missing:
image
I just copied strings.h, mmreg.h and mmsystem.h from winlibs copy of mingw64 (https://winlibs.com/)
And the rest of the files... I just googled them and got them from the internet :)
xmmintrin.h (https://sites.uclouvain.be/SystInfo/usr/include/xmmintrin.h.html)
emmintrin.h (https://raw.githubusercontent.com/gcc-mirror/gcc/master/gcc/config/i386/emmintrin.h)
mmintrin.h (https://raw.githubusercontent.com/gcc-mirror/gcc/master/gcc/config/arm/mmintrin.h)

Hope that answers your question!

EDIT: Doing this worked for me at least

@irishgreencitrus
Copy link
Owner

I'll look at this fix ASAP, thanks @MightyPancake!

@MightyPancake
Copy link

You're welcome!

@irishgreencitrus
Copy link
Owner

I've added these files into my local version, but we're still missing libraries apparently (notably user32)
If anyone's reading this and still can't get it working, I recommend to use gcc solely for now, as it seems to have all the support necessary.
Any help in setting that up is welcome in discussions for those reading in the future if this issue is still not closed.

@MightyPancake
Copy link

I've added these files into my local version, but we're still missing libraries apparently (notably user32) If anyone's reading this and still can't get it working, I recommend to use gcc solely for now, as it seems to have all the support necessary. Any help in setting that up is welcome in discussions for those reading in the future if this issue is still not closed.

I've uploaded my copy of user32.def here: https://easyupload.io/37chpi

You can check if adding that helps. I believe this file was provided with V's tcc though, so that's weird... Let me know if it works!

@Wajinn
Copy link

Wajinn commented Jan 23, 2023

Depending on what a person is doing on Windows, if using the default TCC, they might need the full winapi.

TCC's full winapi (named as- winapi-full-for-0.9.27.zip) can be found here . Download and extract to somewhere that doesn't include spaces (to avoid issues).

You can then do an alternative run/compile, which would use where you put the full winapi at, with the below (example).

v -cc tcc -cflags "-isystem path\to\full-winapi\include\winapi" run example.v

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working cc-tinycc
Projects
None yet
Development

No branches or pull requests

5 participants