CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 7 of 7
  1. #1
    Join Date
    Apr 2013
    Posts
    6

    #import MSVBVM60.DLL unresolved external...

    I have this code!.


    #include "stdafx.h"
    #include <stdlib.h>
    #include "windows.h"
    #import "MSVBVM60.DLL" raw_interfaces_only no_implementation named_guids rename_namespace ("vb6") rename ("EOF", "vbEOF") rename ("RGB", "vbRGB") rename ("GetObject", "vbGetObject")

    using namespace vb6;

    int _tmain(int argc, _TCHAR* argv[])
    {
    VARIANT v565;
    v565.intVal=2;
    float v533;

    *(float *)&v533 = Rnd(&v565);

    return 0;

    }


    When build, with vs2012.. obtain this error..
    "
    Error 1 error LNK2019: unresolved external symbol "float __stdcall vb6::Rnd(struct tagVARIANT *)" (?Rnd@vb6@@YGMPAUtagVARIANT@@@Z) referenced in function _wmain
    Error 2 error LNK1120: 1 unresolved externals
    "

    what is wrong?
    library or statement which I do?

  2. #2
    VictorN's Avatar
    VictorN is offline Super Moderator Power Poster
    Join Date
    Jan 2003
    Location
    Hanover Germany
    Posts
    20,396

    Re: #import MSVBVM60.DLL unresolved external...

    And what is this Rnd(struct tagVARIANT *)?
    Where does it come from?
    Victor Nijegorodov

  3. #3
    Join Date
    Apr 2013
    Posts
    6

    Re: #import MSVBVM60.DLL unresolved external...

    This dll (MSVBVM60.DLL) uses several functions RND one is which I want to use in my c + + program...

    MSVBVM60.DLL is visual basic runtime library...
    Last edited by acanel; April 30th, 2013 at 02:31 AM.

  4. #4
    VictorN's Avatar
    VictorN is offline Super Moderator Power Poster
    Join Date
    Jan 2003
    Location
    Hanover Germany
    Posts
    20,396

    Re: #import MSVBVM60.DLL unresolved external...

    It looks like this function is NOT exported from the library. At least the
    Code:
    >dumpbin /EXPORTS C:\WINDOWS\system32\MSVBVM60.DLL
    doesnt show this function.
    Victor Nijegorodov

  5. #5
    Join Date
    Apr 2013
    Posts
    6

    Re: #import MSVBVM60.DLL unresolved external...

    Thx.
    When i use visual studio 2012 and use this instruction: (sorry my english is so bad....)
    #import "MSVBVM60.DLL" raw_interfaces_only no_implementation named_guids rename_namespace ("vb6") rename ("EOF", "vbEOF") rename ("RGB", "vbRGB") rename ("GetObject", "vbGetObject")

    Generate this file "MSVBVM60.tlh" into this file, this code.

    VARIANT * Number );
    float __stdcall Rnd(
    VARIANT * Number );

    How vstudio generate this code? if this function not here???

  6. #6
    Join Date
    Apr 1999
    Posts
    27,449

    Re: #import MSVBVM60.DLL unresolved external...

    Quote Originally Posted by acanel View Post
    VARIANT * Number );
    float __stdcall Rnd(
    VARIANT * Number );

    How vstudio generate this code? if this function not here???
    The error you're getting is a linker error, not a compiler error.

    All that line that you posted does is make the compiler happy. It doesn't do anything for the linker. The linker must be given the library file where that function exists.

    Regards,

    Paul McKenzie

  7. #7
    Join Date
    Apr 2013
    Posts
    6

    Re: #import MSVBVM60.DLL unresolved external...

    i don't know, which library contain this function ...whoever can help me?

Posting Permissions

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





Click Here to Expand Forum to Full Width

Featured