PGI User Forum
 SearchSearch   MemberlistMemberlist     RegisterRegister   ProfileProfile    Log inLog in 

CUDA-x86.

Linking with ole32
Goto page 1, 2  Next
 
Post new topic   Reply to topic    PGI User Forum Forum Index -> Programming and Compiling
View previous topic :: View next topic  
Author Message
ed_k



Joined: 12 Jul 2013
Posts: 4

PostPosted: Fri Jul 12, 2013 9:31 am    Post subject: Linking with ole32 Reply with quote

I have a Fortran program that needs to parse XML. I wrote a thin C wrapper around the MSXML api that takes care of converting the BSTRs. I call the C routines from the Fortran code. I did not create a lib. The C is compiled to an OBJ and then linked with the Fortran OBJs at link time. It all works well when I use the 32 bit version of the PGI compilers.

When I try the 64 bit PGI compilers I get a link error. I am linking with ole32.lib and oleaut32.lib that are provided with PGI in the Microsoft SDKs.
Here is the link error:
araXML.obj : error LNK2019: unresolved external symbol __imp_SysAllocStringLen referenced in function convertStringToBSTR
araXML.obj : error LNK2019: unresolved external symbol __imp_CoInitialize referenced in function xmldomdocinitialize_
araXML.obj : error LNK2019: unresolved external symbol CLSID_DOMDocument30 referenced in function xmldomdocinitialize_
araXML.obj : error LNK2019: unresolved external symbol IID_IXMLDOMDocument referenced in function xmldomdocinitialize_
araXML.obj : error LNK2019: unresolved external symbol __imp_CoCreateInstance referenced in function xmldomdocinitialize_
araXML.obj : error LNK2019: unresolved external symbol __imp_CoUninitialize referenced in function xmldomdocrelease_
araXML.obj : error LNK2019: unresolved external symbol __imp_VariantInit referenced in function xmldomdocloadfile_
araXML.obj : error LNK2019: unresolved external symbol __imp_SysFreeString referenced in function xmldomdocloadfile_
araXML.obj : error LNK2019: unresolved external symbol __imp_SysStringLen referenced in function xmldomnodegetnodename_
test.exe : fatal error LNK1120: 9 unresolved externals

Any ideas?
Back to top
View user's profile
ed_k



Joined: 12 Jul 2013
Posts: 4

PostPosted: Fri Jul 12, 2013 1:03 pm    Post subject: Reply with quote

UPDATE:
If I link with the ole.lib and oleAut32.lib from C:\Program Files\Microsoft SDKs\Windows\v6.0A\Lib\x64 instead of the ones that shipped with PGI then I reduce the link errors down to the following:
araXML.obj : error LNK2019: unresolved external symbol CLSID_DOMDocument30 referenced in function xmldomdocinitialize_
araXML.obj : error LNK2019: unresolved external symbol IID_IXMLDOMDocument referenced in function xmldomdocinitialize_
test.exe : fatal error LNK1120: 2 unresolved externals
Back to top
View user's profile
ed_k



Joined: 12 Jul 2013
Posts: 4

PostPosted: Fri Jul 12, 2013 1:31 pm    Post subject: Reply with quote

UPDATE2:
If I link with msxml6.lib from C:\Program Files\Microsoft SDKs\Windows\v6.0A\Lib\x64 instead of the one that shipped with PGI (C:\Program Files\PGI\Microsoft Open Tools 10\PlatformSDK\lib\AMD64) then it resolves the last two link errors.

Summary: If I try to use the Microsoft SDK libraries that were installed with PGI then I get some link errors. If I use the ones that were already on my Windows 7 64 bit machine then everything links and runs fine.
Back to top
View user's profile
mkcolg



Joined: 30 Jun 2004
Posts: 6134
Location: The Portland Group Inc.

PostPosted: Fri Jul 12, 2013 3:00 pm    Post subject: Reply with quote

Hi ed_k,

Open Tools 10's Platform SDK and the Microsoft SDK v6.0A are different version of the libraries. Open Tools 10 is from VS2010 and I beleive v6.0A is from VS2008. Though, I'm not possitive this is the cause of your issue. More likely how you compiled your C object caused the symbol names to change (i.e. did you use /MD?). The symbols you list all have the "__imp" prefix meaning these are the "_DLL" symbols.

- Mat
Back to top
View user's profile
ed_k



Joined: 12 Jul 2013
Posts: 4

PostPosted: Mon Jul 15, 2013 7:44 am    Post subject: Reply with quote

Mat,
I don't understand your suggestion. According to the -help documentation, --MD causes the compiler to "Print makefile dependencies to .d file". How would that cause symbol names to change?
I added the -MD and then looked at the generated .d file. It contains a lot of references to .h files in the PGI/Microsoft Open Tools/10/PlatformSDK/include directory. However, I still have to link with the libraries from C:\Program Files\Microsoft SDKs\Windows\v6.0A\Lib\x64 instead of the ones that shipped with PGI.
I am using a .bat file to compile. Here is the line that calls the C compiler:
pgcc -w -pc 64 -c -MD -g %%f

Here is what .d file contains:
araXML.obj : araXML.c \
/C/Program\ Files/PGI/Microsoft\ Open\ Tools\ 10/PlatformSDK/include/windows.h \
/C/Program\ Files/PGI/Microsoft\ Open\ Tools\ 10/PlatformSDK/include/sdkddkver.h \
/C/Program\ Files/PGI/Microsoft\ Open\ Tools\ 10/include/excpt.h \
/C/Program\ Files/PGI/win64/12.9/include/crtdefs.h \
/C/Program\ Files/PGI/win64/12.9/include/crtdefs10.h \
/C/Program\ Files/PGI/win64/12.9/include/sal.h \
/C/Program\ Files/PGI/win64/12.9/include/sal10.h \
/C/Program\ Files/PGI/win64/12.9/include/vadefs.h \
/C/Program\ Files/PGI/win64/12.9/include/vadefs10.h \
/C/Program\ Files/PGI/win64/12.9/include/stdarg.h \
/C/Program\ Files/PGI/win64/12.9/include/windef.h \
/C/Program\ Files/PGI/win64/12.9/include/WinDef10.h \
/C/Program\ Files/PGI/win64/12.9/include/winnt.h \
/C/Program\ Files/PGI/win64/12.9/include/WinNT10.h \
/C/Program\ Files/PGI/Microsoft\ Open\ Tools\ 10/include/ctype.h \
/C/Program\ Files/PGI/Microsoft\ Open\ Tools\ 10/PlatformSDK/include/specstrings.h \
/C/Program\ Files/PGI/Microsoft\ Open\ Tools\ 10/PlatformSDK/include/sal_supp.h \
/C/Program\ Files/PGI/Microsoft\ Open\ Tools\ 10/PlatformSDK/include/specstrings_supp.h \
/C/Program\ Files/PGI/Microsoft\ Open\ Tools\ 10/PlatformSDK/include/specstrings_strict.h \
/C/Program\ Files/PGI/Microsoft\ Open\ Tools\ 10/PlatformSDK/include/driverspecs.h \
/C/Program\ Files/PGI/Microsoft\ Open\ Tools\ 10/PlatformSDK/include/sdv_driverspecs.h \
/C/Program\ Files/PGI/Microsoft\ Open\ Tools\ 10/PlatformSDK/include/kernelspecs.h \
/C/Program\ Files/PGI/Microsoft\ Open\ Tools\ 10/PlatformSDK/include/DriverSpecs.h \
/C/Program\ Files/PGI/win64/12.9/include/basetsd.h \
/C/Program\ Files/PGI/win64/12.9/include/BaseTsd10.h \
/C/Program\ Files/PGI/Microsoft\ Open\ Tools\ 10/PlatformSDK/include/guiddef.h \
/C/Program\ Files/PGI/Microsoft\ Open\ Tools\ 10/include/string.h \
/C/Program\ Files/PGI/Microsoft\ Open\ Tools\ 10/PlatformSDK/include/pshpack4.h \
/C/Program\ Files/PGI/Microsoft\ Open\ Tools\ 10/PlatformSDK/include/poppack.h \
/C/Program\ Files/PGI/Microsoft\ Open\ Tools\ 10/PlatformSDK/include/pshpack2.h \
/C/Program\ Files/PGI/Microsoft\ Open\ Tools\ 10/PlatformSDK/include/pshpack8.h \
/C/Program\ Files/PGI/Microsoft\ Open\ Tools\ 10/PlatformSDK/include/ktmtypes.h \
/C/Program\ Files/PGI/Microsoft\ Open\ Tools\ 10/PlatformSDK/include/winbase.h \
/C/Program\ Files/PGI/Microsoft\ Open\ Tools\ 10/PlatformSDK/include/winerror.h \
/C/Program\ Files/PGI/Microsoft\ Open\ Tools\ 10/PlatformSDK/include/wingdi.h \
/C/Program\ Files/PGI/Microsoft\ Open\ Tools\ 10/PlatformSDK/include/pshpack1.h \
/C/Program\ Files/PGI/Microsoft\ Open\ Tools\ 10/PlatformSDK/include/winuser.h \
/C/Program\ Files/PGI/Microsoft\ Open\ Tools\ 10/PlatformSDK/include/tvout.h \
/C/Program\ Files/PGI/Microsoft\ Open\ Tools\ 10/PlatformSDK/include/winnls.h \
/C/Program\ Files/PGI/Microsoft\ Open\ Tools\ 10/PlatformSDK/include/wincon.h \
/C/Program\ Files/PGI/Microsoft\ Open\ Tools\ 10/PlatformSDK/include/winver.h \
/C/Program\ Files/PGI/Microsoft\ Open\ Tools\ 10/PlatformSDK/include/SpecStrings.h \
/C/Program\ Files/PGI/Microsoft\ Open\ Tools\ 10/PlatformSDK/include/verrsrc.h \
/C/Program\ Files/PGI/Microsoft\ Open\ Tools\ 10/PlatformSDK/include/winreg.h \
/C/Program\ Files/PGI/Microsoft\ Open\ Tools\ 10/PlatformSDK/include/reason.h \
/C/Program\ Files/PGI/Microsoft\ Open\ Tools\ 10/PlatformSDK/include/winnetwk.h \
/C/Program\ Files/PGI/Microsoft\ Open\ Tools\ 10/PlatformSDK/include/wnnc.h \
/C/Program\ Files/PGI/Microsoft\ Open\ Tools\ 10/PlatformSDK/include/cderr.h \
/C/Program\ Files/PGI/Microsoft\ Open\ Tools\ 10/PlatformSDK/include/dde.h \
/C/Program\ Files/PGI/Microsoft\ Open\ Tools\ 10/PlatformSDK/include/ddeml.h \
/C/Program\ Files/PGI/Microsoft\ Open\ Tools\ 10/PlatformSDK/include/dlgs.h \
/C/Program\ Files/PGI/Microsoft\ Open\ Tools\ 10/PlatformSDK/include/lzexpand.h \
/C/Program\ Files/PGI/Microsoft\ Open\ Tools\ 10/PlatformSDK/include/mmsystem.h \
/C/Program\ Files/PGI/Microsoft\ Open\ Tools\ 10/PlatformSDK/include/nb30.h \
/C/Program\ Files/PGI/Microsoft\ Open\ Tools\ 10/PlatformSDK/include/rpc.h \
/C/Program\ Files/PGI/Microsoft\ Open\ Tools\ 10/PlatformSDK/include/rpcdce.h \
/C/Program\ Files/PGI/Microsoft\ Open\ Tools\ 10/PlatformSDK/include/rpcdcep.h \
/C/Program\ Files/PGI/Microsoft\ Open\ Tools\ 10/PlatformSDK/include/rpcnsi.h \
/C/Program\ Files/PGI/Microsoft\ Open\ Tools\ 10/PlatformSDK/include/rpcnterr.h \
/C/Program\ Files/PGI/Microsoft\ Open\ Tools\ 10/PlatformSDK/include/rpcasync.h \
/C/Program\ Files/PGI/Microsoft\ Open\ Tools\ 10/PlatformSDK/include/shellapi.h \
/C/Program\ Files/PGI/Microsoft\ Open\ Tools\ 10/PlatformSDK/include/winperf.h \
/C/Program\ Files/PGI/Microsoft\ Open\ Tools\ 10/PlatformSDK/include/winsock.h \
/C/Program\ Files/PGI/Microsoft\ Open\ Tools\ 10/PlatformSDK/include/inaddr.h \
/C/Program\ Files/PGI/Microsoft\ Open\ Tools\ 10/PlatformSDK/include/wincrypt.h \
/C/Program\ Files/PGI/Microsoft\ Open\ Tools\ 10/PlatformSDK/include/bcrypt.h \
/C/Program\ Files/PGI/Microsoft\ Open\ Tools\ 10/PlatformSDK/include/ncrypt.h \
/C/Program\ Files/PGI/Microsoft\ Open\ Tools\ 10/PlatformSDK/include/winefs.h \
/C/Program\ Files/PGI/Microsoft\ Open\ Tools\ 10/PlatformSDK/include/winscard.h \
/C/Program\ Files/PGI/Microsoft\ Open\ Tools\ 10/PlatformSDK/include/wtypes.h \
/C/Program\ Files/PGI/Microsoft\ Open\ Tools\ 10/PlatformSDK/include/rpcndr.h \
/C/Program\ Files/PGI/Microsoft\ Open\ Tools\ 10/PlatformSDK/include/rpcnsip.h \
/C/Program\ Files/PGI/Microsoft\ Open\ Tools\ 10/PlatformSDK/include/rpcsal.h \
/C/Program\ Files/PGI/Microsoft\ Open\ Tools\ 10/PlatformSDK/include/basetsd.h \
/C/Program\ Files/PGI/Microsoft\ Open\ Tools\ 10/PlatformSDK/include/winioctl.h \
/C/Program\ Files/PGI/Microsoft\ Open\ Tools\ 10/PlatformSDK/include/winsmcrd.h \
/C/Program\ Files/PGI/Microsoft\ Open\ Tools\ 10/PlatformSDK/include/winspool.h \
/C/Program\ Files/PGI/Microsoft\ Open\ Tools\ 10/PlatformSDK/include/prsht.h \
/C/Program\ Files/PGI/Microsoft\ Open\ Tools\ 10/PlatformSDK/include/ole2.h \
/C/Program\ Files/PGI/Microsoft\ Open\ Tools\ 10/PlatformSDK/include/objbase.h \
/C/Program\ Files/PGI/win64/12.9/include/stdlib.h \
/C/Program\ Files/PGI/Microsoft\ Open\ Tools\ 10/include/stdlib.h \
/C/Program\ Files/PGI/Microsoft\ Open\ Tools\ 10/include/limits.h \
/C/Program\ Files/PGI/Microsoft\ Open\ Tools\ 10/PlatformSDK/include/unknwn.h \
/C/Program\ Files/PGI/Microsoft\ Open\ Tools\ 10/PlatformSDK/include/objidl.h \
/C/Program\ Files/PGI/Microsoft\ Open\ Tools\ 10/PlatformSDK/include/cguid.h \
/C/Program\ Files/PGI/Microsoft\ Open\ Tools\ 10/PlatformSDK/include/urlmon.h \
/C/Program\ Files/PGI/Microsoft\ Open\ Tools\ 10/PlatformSDK/include/oleidl.h \
/C/Program\ Files/PGI/Microsoft\ Open\ Tools\ 10/PlatformSDK/include/servprov.h \
/C/Program\ Files/PGI/Microsoft\ Open\ Tools\ 10/PlatformSDK/include/msxml.h \
/C/Program\ Files/PGI/Microsoft\ Open\ Tools\ 10/PlatformSDK/include/oaidl.h \
/C/Program\ Files/PGI/Microsoft\ Open\ Tools\ 10/PlatformSDK/include/propidl.h \
/C/Program\ Files/PGI/Microsoft\ Open\ Tools\ 10/PlatformSDK/include/oleauto.h \
/C/Program\ Files/PGI/Microsoft\ Open\ Tools\ 10/PlatformSDK/include/commdlg.h \
/C/Program\ Files/PGI/win64/12.9/include/stralign.h \
/C/Program\ Files/PGI/win64/12.9/include/StrAlign10.h \
/C/Program\ Files/PGI/Microsoft\ Open\ Tools\ 10/PlatformSDK/include/winsvc.h \
/C/Program\ Files/PGI/Microsoft\ Open\ Tools\ 10/PlatformSDK/include/mcx.h \
/C/Program\ Files/PGI/Microsoft\ Open\ Tools\ 10/PlatformSDK/include/imm.h \
/C/Program\ Files/PGI/Microsoft\ Open\ Tools\ 10/PlatformSDK/include/ime_cmodes.h \
/C/Program\ Files/PGI/Microsoft\ Open\ Tools\ 10/PlatformSDK/include/OAIdl.h \
/C/Program\ Files/PGI/Microsoft\ Open\ Tools\ 10/PlatformSDK/include/msxml6.h \
/C/Program\ Files/PGI/Microsoft\ Open\ Tools\ 10/include/stdio.h \
/C/Program\ Files/PGI/win64/12.9/include/swprintf.inl
Back to top
View user's profile
Display posts from previous:   
Post new topic   Reply to topic    PGI User Forum Forum Index -> Programming and Compiling All times are GMT - 7 Hours
Goto page 1, 2  Next
Page 1 of 2

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © phpBB Group