unresolved __imp__SetFilePointerEx@16

I compile win32 project for exe:

call "C:\Program Files\PGI\win32\7.1-6\pgi_env.bat"

pgcpp -winapp main.cpp user32.lib Shell32.lib Gdi32.lib comctl32.lib Kernel32.lib Comdlg32.lib Ole32.lib advapi32.lib

I get hundrets of warnings.

And this errors from linker:

main.obj : error LNK2019: unresolved external symbol __imp__SetFilePointerEx@16 referenced in function _Pos__17TMFS_Media_HandleFL
main.obj : error LNK2019: unresolved external symbol __imp__ChildWindowFromPoint@8 referenced in function _WM_WINDOWPOSCHANGING___17TMFS_Win32_ScrollFP6HWND__UiT2l
main.obj : error LNK2019: unresolved external symbol _IID_IPicture referenced in function ___sti___8_main_cpp_Class_
main.obj : error LNK2019: unresolved external symbol __imp__OleLoadPicture@20 referenced in function ___sti___8_main_cpp_Class_
C:\temp/pgcpp5dPW77JMPFVz7.exe : fatal error LNK1120: 4 unresolved externals

What i need change for success

May be i do something wrong?

With simple project:

#include <windows.h>
WINAPI WinMain(HINSTANCE hi, HINSTANCE, LPSTR, int)
{
  MessageBox(0, "123", "123", 0);
  return 0;
}

I get this warnings:

F:\\FileSystems\Exe\_pgi>call "C:\Program Files\PGI\win32\7.1-6\pgi_env.bat"
PGI Workstation 7.1-6 (32-bit)
main.cpp:
"C:\PROGRA~1\PGI/win32/7.1-6/include/basetsd.h", line 346: warning: conversion
          from integer to smaller pointer
      return((void * POINTER_64) (unsigned __int64) (ULONG_PTR)p );
             ^

"C:\PROGRA~1\PGI/win32/7.1-6/include/winnt.h", line 608: warning: missing
          return statement at end of non-void function "Int64ShllMod32"
  }
  ^

"C:\PROGRA~1\PGI/win32/7.1-6/include/winnt.h", line 622: warning: missing
          return statement at end of non-void function "Int64ShraMod32"
  }
  ^

"C:\PROGRA~1\PGI/win32/7.1-6/include/winnt.h", line 636: warning: missing
          return statement at end of non-void function "Int64ShrlMod32"
  }
  ^

"C:/Program Files/PGI/Microsoft Open Tools 8/PlatformSDK/include/rpcnterr.h", line 4: warning:
          nested comment is not allowed
  /**                                                     **/
  ^

"C:/Program Files/PGI/Microsoft Open Tools 8/PlatformSDK/include/rpcndr.h", line 265: warning:
          use of a type with no linkage to declare a function
  NDRSContextMarshall (
  ^

"C:/Program Files/PGI/Microsoft Open Tools 8/PlatformSDK/include/rpcndr.h", line 274: warning:
          use of a type with no linkage to declare a function
  NDRSContextUnmarshall (
  ^

"C:/Program Files/PGI/Microsoft Open Tools 8/PlatformSDK/include/rpcndr.h", line 282: warning:
          use of a type with no linkage to declare a function
  NDRSContextMarshallEx (
  ^

"C:/Program Files/PGI/Microsoft Open Tools 8/PlatformSDK/include/rpcndr.h", line 292: warning:
          use of a type with no linkage to declare a function
  NDRSContextMarshall2 (
  ^

"C:/Program Files/PGI/Microsoft Open Tools 8/PlatformSDK/include/rpcndr.h", line 304: warning:
          use of a type with no linkage to declare a function
  NDRSContextUnmarshallEx (
  ^

"C:/Program Files/PGI/Microsoft Open Tools 8/PlatformSDK/include/rpcndr.h", line 313: warning:
          use of a type with no linkage to declare a function
  NDRSContextUnmarshall2(
  ^

"C:/Program Files/PGI/Microsoft Open Tools 8/PlatformSDK/include/rpcndr.h", line 1400: warning:
          use of a type with no linkage to declare a function
  NdrServerContextMarshall(
  ^

"C:/Program Files/PGI/Microsoft Open Tools 8/PlatformSDK/include/rpcndr.h", line 1409: warning:
          use of a type with no linkage to declare a function
  NdrServerContextNewMarshall(
  ^

"C:/Program Files/PGI/Microsoft Open Tools 8/PlatformSDK/include/rpcndr.h", line 1431: warning:
          calling convention specified more than once
  RPC_ENTRY
  ^

"C:/Program Files/PGI/Microsoft Open Tools 8/PlatformSDK/include/rpcndr.h", line 1441: warning:
          calling convention specified more than once
  RPC_ENTRY
  ^

"C:/Program Files/PGI/Microsoft Open Tools 8/PlatformSDK/include/rpcndr.h", line 1692: warning:
          use of a type with no linkage to declare a function
  NdrServerContextUnmarshall(
  ^

"C:/Program Files/PGI/Microsoft Open Tools 8/PlatformSDK/include/rpcndr.h", line 1701: warning:
          use of a type with no linkage to declare a function
  NdrContextHandleInitialize(
  ^

"C:/Program Files/PGI/Microsoft Open Tools 8/PlatformSDK/include/rpcndr.h", line 1709: warning:
          use of a type with no linkage to declare a function
  NdrServerContextNewUnmarshall(
  ^

"C:\PROGRA~1\PGI/win32/7.1-6/include/stralign.h", line 101: warning: use of
          function "wcscpy" (declared at line 250 of "C:/Program
          Files/PGI/Microsoft Open Tools 8/include/string.h") is deprecated
      return wcscpy(Destination, Source);
             ^

"main.cpp", line 3: warning: omission of explicit type is nonstandard ("int"
          assumed)
  WINAPI WinMain(HINSTANCE hi, HINSTANCE, LPSTR, int)
  ^

NOTE: your trial license will expire in 6 days, 0.82 hours.

Hi,

I compile your program and it creates the program main.exe just fine. It runs and pops up message box “123”.

For the warnings, you can ignore them. I get those too.

How did you get and install compilers? What is the name of the .exe file you download?

If you run in a fresh directory with just main.cpp in that directory, would it work?

Hongyon

Hi :)

Same result.
I think warning is “bad sign”.

Try this example:

#include <windows.h>

int WINAPI WinMain(HINSTANCE hi, HINSTANCE, LPSTR, int)
{  
  LARGE_INTEGER q;  q.QuadPart = 0;
  //  
  SetFilePointerEx(0, q, NULL, FILE_BEGIN);
  //
  return 0;
}

I get all old warnings plus:

main.obj : error LNK2019: unresolved external symbol __imp__SetFilePointerEx@16 referenced in function _WinMain@16



I register on cite. And download trial version to test it.

pgiws-716.exe

Its fresh dir. Only main.cpp and run.cmd.

Hi,

The warnings comes from Microsoft include files which we include as part of our distribution and we don’t modify them. They can be ignored. One of the obvious warnings is the nested comment. If you look in the source file, you will know why and I think it is safe to ignore.

For error to SetFilePointerEx@16, I have filed TPR#14921 for this. I will keep you posted on the tpr here once it is fixed. You can e-mail trs@pgroup.com if you would like to know its status.


Thank you,
Hongyon

Thanks

Hi,

This problem will be fixed in our 7.2-2 release.

Thank you,
Hongyon