Re: Linmking problem

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance

From: Victor Bazarov (v.Abazarov_at_comAcast.net)
Date: 08/05/04


Date: Thu, 05 Aug 2004 15:05:37 -0400

rj wrote:
> I have a got a library (actually the whole dang project) that compiles fine
> with vc++6.0 (visual studio). It produced a lib file as it should. I took
> the lib and one of the header file that has all the functions defined with
> extern. i have added the header file in my new project and have added the
> lib in to the project ->settings->link area. But when i try to use one of
> the functions i get link errors saying
> "SoundIn.obj : error LNK2001: unresolved external symbol "struct gsm_state *
> __cdecl gsm_create(void)" (?gsm_create@@YAPAUgsm_state@@XZ)"
>
> what am i doing worng. i am attaching the header and lib

(a) The lib is not attached (but don't bother, I don't open attachments
     anyway).

(b) If you don't post the code that _uses_ that library, what use to post
     the library and the header?

Create another project where you'll use the code from your library, only
not as a library, but directly: add all the source files from your library
to the same project. Everything else should be the same. If it compiles
and links, then you got a problem setting the other project up. If it
does not compile and/or link, the problem is in the code, so make sure it
builds correctly before you attempt using your "whole dang project" as
a library again.

Victor



Relevant Pages

  • Linmking problem
    ... I have a got a library that compiles fine ... with vc++6.0 (visual studio). ... It produced a lib file as it should. ... i have added the header file in my new project and have added the ...
    (microsoft.public.vc.language)
  • Re: Problem with a DLL and a Static Library
    ... In the header file of the LIB, ... I've inlcuded the sameheader file in the DLL ...
    (microsoft.public.vc.language)
  • Re: where can I find WZCQueryInterface?
    ... I am facing a similar problem of not finding the lib & header file for ... DeviceIoControl, but am still curious about the WZCQueryInterface ... or the lib are on my system. ...
    (microsoft.public.pocketpc.wireless)
  • Re: Specific details on building and using dll and lib files
    ... dll or lib files. ... to have the dll, lib, as well as header file. ... I would need to have both the lib and header file. ... the compiler has no idea what exists or how to access it... ...
    (comp.programming)
  • Re: Unresolved external due to incorrect signature
    ... The library builds just fine and creates a lib. ... The dll project ... >> compiles fine but has an unresolved external ... care of some other things that needed fixing as well. ...
    (microsoft.public.vc.language)