Thread: DLL call - Think I'm close

  1. #1
    Registered User
    Join Date
    Aug 2005
    Posts
    80

    DLL call - Think I'm close

    Hi,

    I've been pounding my head on this for over a week. Any help would be greatly appreciated.

    I need to call a dll named BIOWDLL.DLL from within my C++ program. I put the BIOWDLL.DLL in my system32 folder and
    the BIOWDLL.lib file in my main project folder.

    Next, I declare the function in my header named biowin.h:
    Code:
    __declspec ( dllexport )int WINAPI GetSrcBIOWIN (PSTR cSmilePass,
       PSTR cChemical, PSTR EstLin, PSTR EstNon, PSTR EstUlt, PSTR EstPrim,
       PSTR UltTime, PSTR PrimTime, PSTR EstMitiLin, PSTR EstMitiNon,
       PSTR DetailResults, PSTR numLines, PSTR ErrorMess);
    Finally, I declare the variables in my my main function and try
    to call the dll. I'm passing the dll the first two arguments:

    Code:
    int Ret1;
    
    Ret1 = GetSrcBIOWIN("O=C","ChemName",
                    EstLin,EstNon,EstUlt,EstPrim,
                    UltTime,PrimTime,EstMitiLin,EstMitiNon,
                    Details,numLines,ErrMess);
    When I try to compile, I get the following error:

    Code:
    main.obj : error LNK2001: unresolved external symbol "int __stdcall GetSrcBIOWIN(char *,char *,char *,char *,char *,char *,char *,char *,char *,char *,char *,char *,char *)"(?GetSrcBIOWIN@@YGHPAD000000000000@Z)

    I believe the problem has to do with the program finding the library/dll. I've tried researching this, but have had little luck.

  2. #2
    Registered User
    Join Date
    Jan 2005
    Posts
    847
    You must link to the lib file
    Code:
    #pragma comment(lib,"BIOWDLL.lib")

  3. #3
    Registered User
    Join Date
    Aug 2005
    Posts
    80
    Thanks for your help. I added the following code below the includes:
    Code:
    #pragma comment (lib,"BIOWDLL.lib")
    However, I ran it and still get the linking error. I added extern "C" to the front of the declaration to see if it would do anything and got the following error:

    Code:
    Linking...
    BIOWDLL.lib : fatal error LNK1106: invalid file or disk full: cannot seek to 0x3d85d8c2
    Does this give any insight. Not sure what to do.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. How to get RSSI value, send to sensor, sensor receive package, repackage it?
    By techissue2008 in forum Networking/Device Communication
    Replies: 1
    Last Post: 03-04-2009, 10:13 AM
  2. Calling a DLL
    By jamez05 in forum C++ Programming
    Replies: 1
    Last Post: 01-05-2006, 11:13 AM
  3. C++ .NET - "inconsistent dll linkage" - What's that?
    By BrianK in forum Windows Programming
    Replies: 2
    Last Post: 03-16-2004, 10:16 AM
  4. Using class with DLL
    By greg2 in forum C++ Programming
    Replies: 2
    Last Post: 09-12-2003, 05:24 AM
  5. Function Call From DLL
    By (TNT) in forum Windows Programming
    Replies: 5
    Last Post: 05-05-2002, 09:33 PM