Results 1 to 4 of 4

Thread: Problem regarding DLL

  1. #1
    Join Date
    Sep 2006
    Posts
    339
    Thanks
    15
    Thanked 21 Times in 16 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Problem regarding DLL

    Hi guys,
    I'm in a great problem and need urgent help

    I have two modules in my project 1) CMBEDIT 2) SYNTHESIS_TOOL

    I have these files common between these two modules
    i) ct.h
    ii) ct.cpp
    iii) route.h
    iv) route.cpp
    v) basemolecule.h
    vi) basemolecule.cpp
    vi) some more etc etc but the above are basic one

    No I have to create dll( DYnamic Link Library ) which will act as a repository for those common files.

    When I execute CMBEDIT, it should call (dll) and make use of those files, vice versa When I execute SYNTHESIS_TOOL, it should call same (dll) and make use of those files.

    Now I'm able to create the Dll named (myDll) and also able to compile. It creates *.dll and *.lib files. I have included myDll into my module(CMBEDIT). Finally when I execute my module(CMBEDIT) containing myDll, I get the following run time error

    "ENTRY POINT NOT DEFINED"
    "The procedure entry point?otherringnbr@atompair@@SAHAAVbasemolecule@@H HH@Z could not be located in the dynamic link library myDll.dll"

    Below is the class declaration for the above error which contains otherringnbr defined in it

    Prototype of class
    Qt Code:
    1. #include "../myDll.h"
    2. class MYDLL_API basemolecule; //some other class
    3.  
    4. #define ap atompair::apinstance
    5.  
    6. class MYDLL_API atompair
    7. {
    8. public:
    9.  
    10. static atompair apinstance;
    11.  
    12. static int allringsthesame(basemolecule& mol,int x,int y);
    13. static int allsaturatedcarbonsbetween(basemolecule&,int x,int y);
    14. static int anothercommonring(basemolecule&,int ring1,int x,int y);
    15. static int aziridineformationpossible(basemolecule& mol,int x,int y);
    16. static int bondbalance(basemolecule& mol,rownumber x,rownumber y);
    17. static int bettercarbanion(basemolecule&,int x,int y);
    18. static int bettermeta(basemolecule& mol,int x,int y);
    19. static int betternucleophile(basemolecule& mol,int x,int y/*,int re*/);
    20. static rownumber betterortho(basemolecule& mol,rownumber middleatom,
    21. rownumber y,rownumber enteringatom); //2001/2/26/at
    22. static int bicyclonumber(basemolecule&,int x,int y);
    23. static int otherringnbr(basemolecule& mol,int ringnum,int x,int y);
    24. static int otherringnbr(basemolecule& mol,int ringnum,int x,int y,int z);
    25. };
    To copy to clipboard, switch view to plain text mode 

    Any help will be highly appreciated

    Thanx in advance

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    5,372
    Thanks
    28
    Thanked 976 Times in 912 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Problem regarding DLL

    How did you define MYDLL_API macro?

  3. #3
    Join Date
    Sep 2006
    Posts
    6
    Thanks
    1
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Problem regarding DLL

    A couple of possibilities.

    1.) Is the DLL in the SAME directory as the executable you are using to open up the DLL?

    If not, then you'll get a run time error similar to that because the program cannot pick up the DLL. To solve this, just copy your DLL to the same location as the program executable.

    2.) (as questioned) Are you defining the imports/exports correctly?

    this would be something like:

    Qt Code:
    1. #ifdef MYDLL_EXPORTS
    2. #define MYDLL_API __declspec(dllexport)
    3. #else
    4. #define MYDLL_API __declspec(dllimport)
    5. #endif
    To copy to clipboard, switch view to plain text mode 

    You need to set MYDLL_EXPORTS as a pre-processor definition in your DLL project, but leave it blank in the application.

  4. #4
    Join Date
    Sep 2006
    Posts
    339
    Thanks
    15
    Thanked 21 Times in 16 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Problem regarding DLL

    Hi guys,
    Thanks for your interests. It was a silly mistake made by me. I had not included correct DLL in my executable directory due to which I was getting that error. I have fixed the problem and the module works fine.

    Thanks

Similar Threads

  1. QTimer problem ... it runs but never triggs
    By yellowmat in forum Newbie
    Replies: 4
    Last Post: 4th July 2006, 12:54
  2. Grid Layout Problem
    By Seema Rao in forum Qt Programming
    Replies: 2
    Last Post: 4th May 2006, 12:45
  3. Problem with bitBlt
    By yellowmat in forum Newbie
    Replies: 1
    Last Post: 5th April 2006, 14:08
  4. fftw problem
    By lordy in forum General Programming
    Replies: 1
    Last Post: 16th March 2006, 21:36
  5. Replies: 16
    Last Post: 7th March 2006, 15:57

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.