Find the answer to your Linux question:
Results 1 to 2 of 2
Hi All, i want to know what's the meaning of #ifdef _USRDLL (i think it is related to MFC but not sure) here is my code Code: Code: /*******predictor.cpp*****/ #ifdef ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Sep 2011
    Posts
    4

    #ifdef _USRDLL


    Hi All,
    i want to know what's the meaning of #ifdef _USRDLL
    (i think it is related to MFC but not sure)

    here is my code
    Code:
    Code:
    /*******predictor.cpp*****/
    #ifdef _USRDLL
    #include "../../corenumeric/inc/statuscommunicator.h"
    CStatusCommunicator gPipe;
    #endif
    
    .
    .//here i have my pgm code

    when i execute the pgm compiler is reporting error as
    predictor.cpp:26: error: ‚gPipe‚ was not declared in this scope

    this error is due to failure of condition of #ifdef _USRDLL

    plz guide me how to overcome this error.......

    waiting for your reply........

  2. #2
    Linux Guru Rubberman's Avatar
    Join Date
    Apr 2009
    Location
    I can be found either 40 miles west of Chicago, in Chicago, or in a galaxy far, far away.
    Posts
    11,755
    Quote Originally Posted by shamjs View Post
    Hi All,
    i want to know what's the meaning of #ifdef _USRDLL
    (i think it is related to MFC but not sure)

    here is my code
    Code:
    Code:
    /*******predictor.cpp*****/
    #ifdef _USRDLL
    #include "../../corenumeric/inc/statuscommunicator.h"
    CStatusCommunicator gPipe;
    #endif
    
    .
    .//here i have my pgm code

    when i execute the pgm compiler is reporting error as
    predictor.cpp:26: error: ‚gPipe‚ was not declared in this scope

    this error is due to failure of condition of #ifdef _USRDLL

    plz guide me how to overcome this error.......

    waiting for your reply........
    Yes, this seems to be related to being compiled in an MS environment. I think you need an #else branch in the #ifdef/#endif block that "translates" the MS-specific stuff into ones that will work in Linux. This may not be easy, or even possible without major recoding and/or re-architecting of the code. Writing code that works equally well on MS and Linux/Unix systems requires that the basic code be platform-neutral, which yours is not. I have been doing this for 30 years, so I am familiar with the issues. At the least, you will need to look at the MS statuscommunicator.h file, and determine how to translate its contents into "Linux/Unix" constructs.

    Good luck!

    P.S. FWIW, it is MUCH easier to go from Linux/Unix compatible code to Windows, vs. the other way around...
    Sometimes, real fast is almost as good as real time.
    Just remember, Semper Gumbi - always be flexible!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •