C compiler fails on Windows

If I include <process.h> header and try to compile (PGI compiler 17.4, x64) a test C program on Windows I get:

PGC-W-0114-More than one type specified (C:/Program Files (x86)/Windows Kits/10/Include/10.0.15063.0/um\commdlg.h: 729)
PGC-W-0143-Useless typedef declaration (no declarators present) (C:/Program Files (x86)/Windows Kits/10/Include/10.0.15063.0/um\commdlg.h: 729)
PGC-W-0043-Redefinition of symbol, LPUINT (C:/Program Files (x86)/Windows Kits/10/Include/10.0.15063.0/um\imm.h: 45)
PGC-S-0040-Illegal use of symbol, __vcrt_bool (C:/Program Files (x86)/Microsoft Visual Studio 14.0/VC/include\vcruntime_startup.h: 40)
PGC-W-0156-Type not specified, 'int' assumed (C:/Program Files (x86)/Microsoft Visual Studio 14.0/VC/include\vcruntime_startup.h: 40)
PGC-S-0040-Illegal use of symbol, __vcrt_bool (C:/Program Files (x86)/Microsoft Visual Studio 14.0/VC/include\vcruntime_startup.h: 41)
PGC-W-0156-Type not specified, 'int' assumed (C:/Program Files (x86)/Microsoft Visual Studio 14.0/VC/include\vcruntime_startup.h: 41)
PGC-S-0040-Illegal use of symbol, __vcrt_bool (C:/Program Files (x86)/Microsoft Visual Studio 14.0/VC/include\vcruntime_startup.h: 41)
PGC-W-0156-Type not specified, 'int' assumed (C:/Program Files (x86)/Microsoft Visual Studio 14.0/VC/include\vcruntime_startup.h: 41)
PGC-S-0040-Illegal use of symbol, __vcrt_bool (C:/Program Files (x86)/Microsoft Visual Studio 14.0/VC/include\vcruntime_startup.h: 42)
PGC-W-0156-Type not specified, 'int' assumed (C:/Program Files (x86)/Microsoft Visual Studio 14.0/VC/include\vcruntime_startup.h: 42)
PGC-S-0040-Illegal use of symbol, __vcrt_bool (C:/Program Files (x86)/Microsoft Visual Studio 14.0/VC/include\vcruntime_startup.h: 43)
PGC-W-0156-Type not specified, 'int' assumed (C:/Program Files (x86)/Microsoft Visual Studio 14.0/VC/include\vcruntime_startup.h: 43)
PGC-S-0040-Illegal use of symbol, __vcrt_bool (C:/Program Files (x86)/Microsoft Visual Studio 14.0/VC/include\vcruntime_startup.h: 44)
PGC-W-0156-Type not specified, 'int' assumed (C:/Program Files (x86)/Microsoft Visual Studio 14.0/VC/include\vcruntime_startup.h: 44)
PGC/x86-64 Windows 17.4-0: compilation completed with severe errors

After removing process.h it compiles.

Hello,

We need more information, like the program that fails,
and all the headers it needs. If it is in some example file, please
point to it.


dave

Here is a test program:

#include <stdio.h>

#include <process.h>

int main (void)
{
	printf ("Hey!\n");
	return 0;
}

I 'm compiling it with the following command:

pgcc ./test.c -o test.exe

As I mentioned before, compilation fails with errors. Let me know if you need more info.

Also, another problem situation with header files.

First file test1.c:

#include <winsock2.h>
#include <ws2tcpip.h>
#include <windows.h>

#include <stdio.h>

int test_func_1 (void)
{
	printf ("Hey - 1!\n");
	return 0;
}

Second test file test2.c:

#include <winsock2.h>
#include <ws2tcpip.h>
#include <windows.h>

#include <stdio.h>

int test_func_2 (void)
{
	printf ("Hey - 2!\n");
	return 0;
}

Now I’m trying to make a DLL with the following commands:

pgcc -c ./test1.c -Bdynamic -o test1.o
pgcc -c ./test2.c -Bdynamic -o test2.o
pgcc -Bdynamic -Mmakedll ./test1.o ./test2.o -o test.dll ws2_32.lib

After the last command I have:

test2.o : error LNK2005: IN6_ADDR_EQUAL already defined in test1.o
test2.o : error LNK2005: IN6_IS_ADDR_UNSPECIFIED already defined in test1.o
test2.o : error LNK2005: IN6_IS_ADDR_LOOPBACK already defined in test1.o
test2.o : error LNK2005: IN6_IS_ADDR_MULTICAST already defined in test1.o
test2.o : error LNK2005: IN6_IS_ADDR_EUI64 already defined in test1.o
test2.o : error LNK2005: IN6_IS_ADDR_SUBNET_ROUTER_ANYCAST already defined in test1.o
test2.o : error LNK2005: IN6_IS_ADDR_SUBNET_RESERVED_ANYCAST already defined in test1.o
test2.o : error LNK2005: IN6_IS_ADDR_ANYCAST already defined in test1.o
test2.o : error LNK2005: IN6_IS_ADDR_LINKLOCAL already defined in test1.o
test2.o : error LNK2005: IN6_IS_ADDR_SITELOCAL already defined in test1.o
test2.o : error LNK2005: IN6_IS_ADDR_GLOBAL already defined in test1.o
test2.o : error LNK2005: IN6_IS_ADDR_V4MAPPED already defined in test1.o
test2.o : error LNK2005: IN6_IS_ADDR_V4COMPAT already defined in test1.o
test2.o : error LNK2005: IN6_IS_ADDR_V4TRANSLATED already defined in test1.o
test2.o : error LNK2005: IN6_IS_ADDR_MC_NODELOCAL already defined in test1.o
test2.o : error LNK2005: IN6_IS_ADDR_MC_LINKLOCAL already defined in test1.o
test2.o : error LNK2005: IN6_IS_ADDR_MC_SITELOCAL already defined in test1.o
test2.o : error LNK2005: IN6_IS_ADDR_MC_ORGLOCAL already defined in test1.o
test2.o : error LNK2005: IN6_IS_ADDR_MC_GLOBAL already defined in test1.o
test2.o : error LNK2005: IN6_SET_ADDR_UNSPECIFIED already defined in test1.o
test2.o : error LNK2005: IN6_SET_ADDR_LOOPBACK already defined in test1.o
test2.o : error LNK2005: IN6ADDR_SETANY already defined in test1.o
test2.o : error LNK2005: IN6ADDR_SETLOOPBACK already defined in test1.o
test2.o : error LNK2005: IN6ADDR_ISANY already defined in test1.o
test2.o : error LNK2005: IN6ADDR_ISLOOPBACK already defined in test1.o
test2.o : error LNK2005: IN6ADDR_ISEQUAL already defined in test1.o
test2.o : error LNK2005: IN6ADDR_ISUNSPECIFIED already defined in test1.o
test2.o : error LNK2005: gai_strerrorA already defined in test1.o
test2.o : error LNK2005: gai_strerrorW already defined in test1.o
test2.o : error LNK2005: setipv4sourcefilter already defined in test1.o
test2.o : error LNK2005: getipv4sourcefilter already defined in test1.o
test2.o : error LNK2005: setsourcefilter already defined in test1.o
test2.o : error LNK2005: getsourcefilter already defined in test1.o
test2.o : error LNK2005: idealsendbacklogquery already defined in test1.o
test2.o : error LNK2005: idealsendbacklognotify already defined in test1.o
test.dll : fatal error LNK1169: one or more multiply defined symbols found

if I remove the

ws2tcpip.h

header from both the example files it compiles fine.

To successfully install 17.4 on Windows, first make sure you have
installed the Visual Studio 2015 Community Edition, as described at https://forums.developer.nvidia.com/t/where-to-find-visual-studio-2015-community-edition/135283/1

Once that is done, install the compilers again. When running the compilers, you can use the DOS Command Window or the Bash Command Window to execute your commands, and the environment
in the Command window will know where the compilers are.

17.4 Windows release will only work with Windows 2015.