Library Linking

Titus_Groan

Member
Under Oneworld I am editing a business function, B0000955. I have inserted code that requires a library to be linked during compile time.

I am using Visual C++ as the compiler interface and the Project->Settings selector does not contain link information.

Is there a generic Makefile out there that I have to alter in order to instruct JDE to link in this file when the business function is being built?

Any Ideas?

Mike
 
The makefile is generated by BusBuild. The solution I was given by JDE, was to dynamically link to your dll if it's not supported by BusBuild.
 
ag is right, use LoadLibrary(). Busbuild doesn't give you the flexibility you need to use the linker.
 
I have completed an implementation of the prepayment functionality last year, along with a few other interfaces to C++ libraries.

The only way to interface to a third-party DLL is by using the loadlibrary function. There are two things you need to be aware of:

1- The byte alignment of the third party DLL is critical if you plan to run the code on the enterprise server. The byte alignment of a workstation is NOT the same as the byte alignment of the enterprise server. I have had APPLICATION CRASH in the past because of misalignment. It is thus possible that you'll have to use the "#pragma pack " instruction in your header files to match the third party DLL's alignment

2- LoadLibrary is a Windows only function, as far as I know. So if you are in a multi-platform environment, add the following to your code where needed:
#ifdef JDENV_PC
// your windows code here
#endif

There is a good article about byte alignment in the Knowledge garden.

Hope this helps!
 
Back
Top