visual-studio-2010visual-c++unresolved-externalsaprfcnetweaver

unresolved externals SAP NetWeaver RFC SDK 7.1 client example Visual Studio 2010


I'm trying to compile the companyClient.c in a visual studio 2010 project, but even if I link properly to the library sapnwrfc.lib I still get several unresolved externals:

Error  1   error LNK2019: unresolved external symbol _RfcCloseConnection@8 referenced in function _errorHandling   C:\Users\Attila\Desktop\SAP_NWR_RFC\SAP_NWR_RFC\companyClient.obj   SAP_NWR_RFC
Error  2   error LNK2019: unresolved external symbol _RfcSAPUCToUTF8@24 referenced in function _nlsui_main C:\Users\Attila\Desktop\SAP_NWR_RFC\SAP_NWR_RFC\companyClient.obj   SAP_NWR_RFC
Error  3   error LNK2019: unresolved external symbol _RfcDestroyFunction@8 referenced in function _nlsui_main  C:\Users\Attila\Desktop\SAP_NWR_RFC\SAP_NWR_RFC\companyClient.obj   SAP_NWR_RFC
Error  4   error LNK2019: unresolved external symbol _RfcGetString@24 referenced in function _nlsui_main   C:\Users\Attila\Desktop\SAP_NWR_RFC\SAP_NWR_RFC\companyClient.obj   SAP_NWR_RFC
Error  5   error LNK2019: unresolved external symbol _RfcGetStructure@16 referenced in function _nlsui_main    C:\Users\Attila\Desktop\SAP_NWR_RFC\SAP_NWR_RFC\companyClient.obj   SAP_NWR_RFC
Error  6   error LNK2019: unresolved external symbol _RfcInvoke@12 referenced in function _nlsui_main  C:\Users\Attila\Desktop\SAP_NWR_RFC\SAP_NWR_RFC\companyClient.obj   SAP_NWR_RFC
Error  7   error LNK2019: unresolved external symbol _RfcSetChars@20 referenced in function _nlsui_main    C:\Users\Attila\Desktop\SAP_NWR_RFC\SAP_NWR_RFC\companyClient.obj   SAP_NWR_RFC
Error  8   error LNK2019: unresolved external symbol _RfcCreateFunction@8 referenced in function _nlsui_main   C:\Users\Attila\Desktop\SAP_NWR_RFC\SAP_NWR_RFC\companyClient.obj   SAP_NWR_RFC
Error  9   error LNK2019: unresolved external symbol _RfcGetFunctionDesc@12 referenced in function _nlsui_main C:\Users\Attila\Desktop\SAP_NWR_RFC\SAP_NWR_RFC\companyClient.obj   SAP_NWR_RFC
Error  10  error LNK2019: unresolved external symbol _RfcOpenConnection@12 referenced in function _nlsui_main  C:\Users\Attila\Desktop\SAP_NWR_RFC\SAP_NWR_RFC\companyClient.obj   SAP_NWR_RFC
Error  11  error LNK1120: 10 unresolved externals      C:\Users\Attila\Desktop\SAP_NWR_RFC\Debug\SAP_NWR_RFC.exe   SAP_NWR_RFC

Can you tell me please if I'm missing anything here?

I followed the guide in the pdf documentation, and also I've read: (http://help.sap.com/saphelp_nwpi71/helpdata/en/22/0430ba488911d189490000e829fbbd/frameset.htm) / NetWeaver RFC SDK/Programming with the NW RFC API/Working with the NW RFC SDK Files

I'd be grateful for any kind of help.


Solution

  • I had the same issue. Make sure you are compiling to the OS, not the chip. If the OS is 32-bit, use the 32 bit compile/link options found here, if the chip and OS are 64-bit, follow the instructions for the 64-bit entry:

    https://websmp230.sap-ag.de/sap(bD1lbiZjPTAwMQ==)/bc/bsp/spn/sapnotes/index2.htm?numm=1056696