public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
* Mingw-w64 for example...
@ 2023-07-10 20:11 Nasser Rowhani
  2023-07-11  6:23 ` LIU Hao
  0 siblings, 1 reply; 3+ messages in thread
From: Nasser Rowhani @ 2023-07-10 20:11 UTC (permalink / raw)
  To: gcc-help

[-- Attachment #1: Type: text/plain, Size: 2258 bytes --]

Hi..

Is it possible to reconfigure gcc after it being built?
Like mingw-w64 is taking from its own include directory.
I want it to point to windows sdk instead. Is it possible?
I got errors i couldn't understand when i set the -I (i letter) and the -l
(small letter L)
options on gcc compiler. is it of any use if i show you? thanks..

It's mentioned in the manual that the compiler options l and I have
precedence over the
configuration. so how come it's complaining;

C:\mystuff\delme>gcc mingw.c -l "C:\Program Files (x86)\Windows
Kits\10\Lib\10.0.22621.0\um\x64\user32.lib" -I "C:\Program Files
(x86)\Windows Kits\10\Include\10.0.22621.0\um"

In file included from
C:/mystuff/winlibs-x86_64-posix-seh-gcc-13.1.0-llvm-16.0.5-mingw-w64ucrt-11.0.0-r5/mingw64/x86_64-w64-mingw32/include/minwindef.h:163,
                 from
C:/mystuff/winlibs-x86_64-posix-seh-gcc-13.1.0-llvm-16.0.5-mingw-w64ucrt-11.0.0-r5/mingw64/x86_64-w64-mingw32/include/windef.h:9,
                 from C:\Program Files (x86)\Windows
Kits\10\Include\10.0.22621.0\um/windows.h:175,
                 from mingw.c:4:
C:\Program Files (x86)\Windows
Kits\10\Include\10.0.22621.0\um/winnt.h:101:10: fatal error: kernelspecs.h:
No such file or directory
  101 | #include <kernelspecs.h>
      |          ^~~~~~~~~~~~~~~
compilation terminated.



i don't even know what the error means! it's saying something along the
lines of:
 1 file included from, and then the next from, which means what? etc.. and
then after mingw.c:4: there is what?

all i know is that windows.h was included in my project, and then i presume
windef.h was included from within the windows.h file?
how did it achieve changing directories? windows.h is in the includes i
mentioned in the compiler options..etc.. there's also a further
proof that it shouldn't have switched folders,that winnt is still in the
specified include folder which is maybe included from windows.h...
can you see the contradiction between last two files specified ? and first
file(minwinder.h)?

sorry if i'm not clear or if i'm not asking the right person :)
the code:


#include <stdio.h>
#include <windows.h>

int main(int argc, char *argv[])
{
  printf("asdklfjasldfka\n");
  MessageBoxA(NULL, "hi.....", "caption", MB_OK);
  return 0;
}

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Mingw-w64 for example...
  2023-07-10 20:11 Mingw-w64 for example Nasser Rowhani
@ 2023-07-11  6:23 ` LIU Hao
  2023-07-11  8:30   ` Xi Ruoyao
  0 siblings, 1 reply; 3+ messages in thread
From: LIU Hao @ 2023-07-11  6:23 UTC (permalink / raw)
  To: Nasser Rowhani, gcc-help


[-- Attachment #1.1: Type: text/plain, Size: 1089 bytes --]

在 2023/7/11 04:11, Nasser Rowhani via Gcc-help 写道:
> Hi..
> 
> Is it possible to reconfigure gcc after it being built?

No, but usually you need not do, because GCC can find headers and libraries by relative path.

You ask because you are doing it wrong. Use GCC with mingw-w64 headers. Do not use GCC with 
Microsoft headers. [I am not meant to be offensive, but] you have been asking this silly question in 
#mingw-w64 for two days. Please stop that.

I have already given you an answer: Compiling Microsoft headers with GCC is not supported. There are 
a bunch of MSVC extensions that are not supported by GCC, such as `__forceinline`, `__int64`, 
`__pragma(pack, ...)`; and MS headers do include standard C headers, such as <ctype.h> and 
<stddef.h>; they also include compiler-specific headers such as <intrin.h>.

So, don't do that; it's not supported; and never will be. You say you have plenty of time, okay I'm 
glad to hear that, because I have very little. Go squander it yourself and stop wasting our time. 
Good luck.

-- 
Best regards,
LIU Hao


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 840 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Mingw-w64 for example...
  2023-07-11  6:23 ` LIU Hao
@ 2023-07-11  8:30   ` Xi Ruoyao
  0 siblings, 0 replies; 3+ messages in thread
From: Xi Ruoyao @ 2023-07-11  8:30 UTC (permalink / raw)
  To: LIU Hao, Nasser Rowhani, gcc-help

On Tue, 2023-07-11 at 14:23 +0800, LIU Hao via Gcc-help wrote:
> 在 2023/7/11 04:11, Nasser Rowhani via Gcc-help 写道:
> > Hi..
> > 
> > Is it possible to reconfigure gcc after it being built?
> 
> No, but usually you need not do, because GCC can find headers and libraries by relative path.

Generally, actually "maybe", by hacking the spec files.

But regarding the specific topic, LIU Hao is correct that you cannot use
mingw-gcc with MS headers.  It is *mingw*-gcc, not "windows-gcc" anyway.

> You ask because you are doing it wrong. Use GCC with mingw-w64 headers. Do not use GCC with 
> Microsoft headers. [I am not meant to be offensive, but] you have been asking this silly question in 
> #mingw-w64 for two days. Please stop that.
> 
> I have already given you an answer: Compiling Microsoft headers with GCC is not supported. There are 
> a bunch of MSVC extensions that are not supported by GCC, such as `__forceinline`, `__int64`, 
> `__pragma(pack, ...)`; and MS headers do include standard C headers, such as <ctype.h> and 
> <stddef.h>; they also include compiler-specific headers such as <intrin.h>.
> 
> So, don't do that; it's not supported; and never will be. You say you have plenty of time, okay I'm 
> glad to hear that, because I have very little. Go squander it yourself and stop wasting our time. 
> Good luck.
> 
> -- 
> Best regards,
> LIU Hao
> 

-- 
Xi Ruoyao <xry111@xry111.site>
School of Aerospace Science and Technology, Xidian University

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2023-07-11  8:30 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-07-10 20:11 Mingw-w64 for example Nasser Rowhani
2023-07-11  6:23 ` LIU Hao
2023-07-11  8:30   ` Xi Ruoyao

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).