cancel
Showing results for 
Search instead for 
Did you mean: 

RFC SDK on Windows with GCC

Former Member
0 Kudos

Has anyone used the RFC SDK on Windows with the gcc compiler instead of MS Visual C?

If so, how did you get the program to link with the library file librfc32.lib?

Alan.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

I had done that, but I get the following errors when building my program.

undefined reference to `RfcOpenEx@8'

undefined reference to `RfcCall@16'

undefined reference to `RfcListen@4'

undefined reference to `RfcReceive@16'

undefined reference to `RfcClose@4'

undefined reference to `RfcLastErrorEx@4'

Note, the program compiles successfully using MSVC.

Former Member
0 Kudos

Hi Alan,

It occurs to me that librfc32.lib is a static library with stubs to call out the to the associated dll file.

Perhaps it just needs to be linked statically.

Try replacing the <i>-lrfc</i> with <i><path to library>/librfc32.lib</i>

Maybe you have already done this and get the same answer.

If it doesn't work, can you post the link line and the output?

Cheers,

Paul.

Former Member
0 Kudos

Paul,

I had tried that also. I turns out, I had to use reimp on the .lib file to create a library suitable for gcc.

Apparently MSVC and gcc sometimes assume a different number of underscores at the beginning of function names in libraries, depending on wether they were defined as __stdcall or __cdecl.

The possibilities are outlined here http://www.mingw.org/mingwfaq.shtml#faq-msvcdll

Anyway, I got it to work. Thanks for your suggestions.

Alan.

Former Member
0 Kudos

Hi Alan,

Glad you got it working. Wish I could have actually helped

Thanks for the information on MinGW, I'll be adding it to my own bag of tricks.

Cheers,

Paul.

Former Member
0 Kudos

Hello Mr. Gorman,

I'm quite new in SAP, may I ask your help regarding how have you made C++ connect to SAP. I'm trying the tutorials that I found in the SAP NW RFC SDK 7.20:

I've downloaded the SDK, copied the libraries and DLLs in system32 (Windows 7), tried to compile the demo C++ codes included in the NW RFC SDK in Eclipse/Netbeans using Mingw/Cygwin compilers (latest versions), but still no luck.

Thanks in advance!

Franco

Answers (1)

Answers (1)

Former Member
0 Kudos

I have not used gcc on windows but if it conforms to the same usage as on other platforms, the following should work.

Add <i>-L<path to library></i> and <i>-lrfc32</i> to the link line.

Where <i><path to library></i> is the location of the librfc32.lib file.

As I said, I have not used gcc on windows. Also, I don't know what you have tried to date. If you can provide some more details it may help define the problem.

Cheers,

Paul.