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

MinGW timeapi.h issue #459

Open
JKooAllied opened this issue May 2, 2024 · 3 comments
Open

MinGW timeapi.h issue #459

JKooAllied opened this issue May 2, 2024 · 3 comments
Labels

Comments

@JKooAllied
Copy link

Hello,

I followed Wiki. After mingw32-make, I am getting this issue:
libplctag\src\platform\windows\platform.c:48:21: fatal error: timeapi.h: No such file or directory
#include <timeapi.h>

@kyle-github
Copy link
Member

Hmm. It looks like it is missing in some versions of MinGW. I found this notice on the main MinGW SourceForge site:

https://sourceforge.net/p/mingw-w64/mailman/message/37409800/

That is from 2022. It looks like timeapi.h should be included with MinGW. It is one of the header files provided with Visual C/C++ as well.

When was your version of MinGW created?

@JKooAllied
Copy link
Author

Hmm. It looks like it is missing in some versions of MinGW. I found this notice on the main MinGW SourceForge site:

https://sourceforge.net/p/mingw-w64/mailman/message/37409800/

That is from 2022. It looks like timeapi.h should be included with MinGW. It is one of the header files provided with Visual C/C++ as well.

When was your version of MinGW created?

I am using x86_64-win32-seh. I changed Cmake file from -m32 to -m64 in order to make it work with cmake command.
MinGW-W64 GCC-8.1.0

@kyle-github
Copy link
Member

Based on what I find online, version 8.1 is very old. Looks like the underlying GCC version is from 2018 which is six year ago. I would strongly suggest updating MinGW and GCC to the latest version. There were some problems a few years ago with missing header files in MinGW's version of GCC.

You can find downloads here.

Is there a reason that you cannot use the free version of Visual Studio? Microsoft has free downloads and the licensing for the produced binaries is quite reasonable. With Microsoft's creation of WSL (WLS?) with a Linux environment within Windows, it looks like most of the interest in things like MinGW has dropped.

My suggestions (in order of preference):

  • Use the latest free version of Visual Studio. It supports CMake out of the box.
  • Update to the latest version of MinGW/GCC. Version 8 GCC is no longer supported by GNU.
  • Develop within the WSL environment. You can use Ubuntu and other flavors of Linux and it is trivial to set up a very solid development environment. You can cross compile for Windows from that environment but it is not that simple to get working.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants