problem linking dll in C++

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Brian Su

    problem linking dll in C++

    Hello guys, I would appreciate it if you C++ Gurus could
    help me out a little here.

    I downloaded some source code from online and I can't compile
    it because it requires a .dll file. The author did include the
    source code for the .dll file as well.

    I'm using Visual C++ so I clicked New -> Win32 Dynamic Link Library.
    Then I made a new c/c++ header file and I copied and paste the code
    into it. And I also made a new c/c++ source file and copied and paste
    the code into it.
    After all that I clicked compile then build. It worked fine and it
    generated the .dll file, but it didn't generate the .lib file as well

    I don't understand how can I link the main program to the .dll file
    if it doesn't have the .lib file?

    How do I generate the .lib file? and how to link a program to a .dll
    file? where should I put the .dll file in and what do I click in V
    C++?

    I would really really appreciate your feedbacks.
    Thanks so much guys.

    Brian.
  • Jeremy Cowles

    #2
    Re: problem linking dll in C++

    FYI: the microsoft news server is MSnews.microsof t.com (notice the MS before
    news.microsoft. com).

    news://msnews.microsoft.com/microsoft.public.vc.*

    HTH,
    Jeremy


    "John Harrison" <john_andronicu s@hotmail.com> wrote in message
    news:bhqf4u$1vk 4u$1@ID-196037.news.uni-berlin.de...[color=blue]
    >
    > "Brian Su" <happyguy@strea myx.com> wrote in message
    > news:h7f1kv8hvt knhd7u9c16uoud1 jakk8cafq@4ax.c om...[color=green]
    > > Hello guys, I would appreciate it if you C++ Gurus could
    > > help me out a little here.
    > >
    > > I downloaded some source code from online and I can't compile
    > > it because it requires a .dll file. The author did include the
    > > source code for the .dll file as well.
    > >
    > > I'm using Visual C++ so I clicked New -> Win32 Dynamic Link Library.
    > > Then I made a new c/c++ header file and I copied and paste the code
    > > into it. And I also made a new c/c++ source file and copied and paste
    > > the code into it.
    > > After all that I clicked compile then build. It worked fine and it
    > > generated the .dll file, but it didn't generate the .lib file as well
    > >
    > > I don't understand how can I link the main program to the .dll file
    > > if it doesn't have the .lib file?
    > >
    > > How do I generate the .lib file? and how to link a program to a .dll
    > > file? where should I put the .dll file in and what do I click in V
    > > C++?
    > >
    > > I would really really appreciate your feedbacks.
    > > Thanks so much guys.
    > >
    > > Brian.[/color]
    >
    > Your question is a 'How do I operate my compiler?' type question. This[/color]
    group[color=blue]
    > is for question about the C++ language, which has nothing to say about[/color]
    dlls,[color=blue]
    > or linking.
    >
    > Try a group that is about your compiler,
    > news:microsoft. public.vc.ide_g eneral for instance. You can find this on[/color]
    the[color=blue]
    > news://news.microsoft.com server, if your own news server doesn't carry[/color]
    it.[color=blue]
    >
    > john
    >
    >
    >[/color]

    Comment

    • John Harrison

      #3
      Re: problem linking dll in C++


      "Jeremy Cowles" <jeremy.cowle s[nosp@m]asifl.com> wrote in message
      news:e750b.5243 0$K4.2655325@tw ister.tampabay. rr.com...[color=blue]
      > FYI: the microsoft news server is MSnews.microsof t.com (notice the MS[/color]
      before[color=blue]
      > news.microsoft. com).
      >
      > news://msnews.microsoft.com/microsoft.public.vc.*
      >
      > HTH,
      > Jeremy
      >[/color]

      Actually both names work (at least the last time I tried they did).

      john


      Comment

      Working...