C2371: 'DSB3102270Qtys' : redefinition; different basic types



Active Member
Hello people,

I'm using EnterpriseOne 9.1, Tools Release and I made a copy of 2 Std MBF: B3102270.h and B3102270.c, copied the data structures to another 55, and when I compile the custom one's I'm getting the following error:

C:\E910_1\AMDV91\include\b3102270.h(182) : error C2371: 'DSB3102270Qtys' : redefinition; different basic types
C:\E910_1\AMDV91\include\b5531022.h(102) : see declaration of 'DSB3102270Qtys'
C:\E910_1\AMDV91\include\b3102270.h(182) : error C2371: 'LPDSB3102270Qtys' : redefinition; different basic types
C:\E910_1\AMDV91\include\b5531022.h(102) : see declaration of 'LPDSB3102270Qtys'
C:\E910_1\AMDV91\include\b3102270.h(190) : error C2371: 'DSB3102270IDX' : redefinition; different basic types

So, to get rid of this error, I implemented the following code in both files (b3102270.h and b5531022.h):

#ifndef LPDSB3102270Qtys
#define LPDSB3102270Qtys
typedef struct /* Structure to store calculated quantities */
MATH_NUMERIC mnpjcm; /* Project Hard Commitment Quantities */
MATH_NUMERIC mnDifference;
ID idF4101Ptr;
ID idF4102Ptr;
}DSB3102270Qtys, *LPDSB3102270Qtys;

I believe that is not the best approach, so, I can't understand why this is happening since I not included the b3102270.h file in the code anymore (b5531022.h) and when I compile the original BSFN b3102270.c (and b3102270.h) the compile process is completed without any errors.

Latter, I discovered if I comment the following include, I'm get rid of the error but some warnings appears since the DSTR to support them probably are inside in the include file:

#include <xt4111z1.h>
#include <xt4312z1.h>

The basic idea is to change the behavior of b3102270 STD function without impact the std modules. This is not the first time that I did this, but never with a huge function like this, and is the first time that I get this error.

I can post the source code if is needed since this is a JDE STD BSF function.

The reason to change this function is to record the reason code of material issues in Manufacturing Module (copy of P31113 - Work Order Inventory Issues) since the std APP didn't do that.

Thank you,

Last edited:

If I'm understanding what you're trying to do, I would say you're making it more complicated than it needs to be.

First of all, I wouldn't copy all the code in the B3102270.h into your new B55.h. In your custom .h file, just #include <B3102270.h>. There is no need to duplicate all those definitions in your custom copy.

Now depending on exactly what changes you will be making to your custom copy, it may not be necessary (or desirable) to create copies of the DSTR objects either. If your custom copy doesn't require any new data structure parameters, you could simply define your custom functions to use the base DSTR objects. If you would rather use custom copies of the DSTR objects, which is fine and a bit more flexible should you ever want to add parameters, then you would only need to paste the typedefs of the new DSTR objects into your custom .h file.

In a nutshell, your custom .h would just include the b3102270.h (and any other includes your custom code requires that is not already included in b3102270.h). Do NOT copy all code from the base b3102270.h into your custom .h.
If you create new DSTR objects, paste those typedefs into your custom .h.

That should be all the complexity needed.

One more thing... if there are internal functions defined (I3102270_xxxxxx), you will need to deal with those in one of 2 ways:
  1. do nothing in your code ... don't define them in your .h and don't copy the implementation of those functions in your .c. This option requires that you change the Parent DLL of your custom function to match the Parent DLL of the base function (if you choose this option and you have already successfully built your function(s) into a different parent DLL, I believe you will need to run the stand-alone version of busbuild and perform a complete rebuild of your custom dll after reassigning the parent dll to match the base)
  2. define a copy of all the internal function prototypes in your custom .h using a different name (I5502270_xxxxxx). Copy all the c-code of those function implementations from the base to your custom. Do a mass update changing all occurrences of "I3102270_" to "I5502270_".
Last edited: