Re: Linmking problem
From: rj (rj_at_)
Date: 08/05/04
- Next message: Owen: "Re: wrong struct definition"
- Previous message: Victor Bazarov: "Re: wrong struct definition"
- In reply to: Victor Bazarov: "Re: Linmking problem"
- Next in thread: Victor Bazarov: "Re: Linmking problem"
- Reply: Victor Bazarov: "Re: Linmking problem"
- Messages sorted by: [ date ] [ thread ]
Date: Thu, 5 Aug 2004 14:59:23 -0500
Ok i tried what you said and yes the code doesn t even work on the new
project i get the same message in that too.
testgsm.obj : error LNK2001: unresolved external symbol "struct gsm_state *
__cdecl gsm_create(void)" (?gsm_create@@YGPAUgsm_state@@XZ)
Here is how i am using it
//got my include
#include "gsm.h"
// all of the compiler code from wizard
//my code
gsm g = gsm_create();
----------------------------------------------------------------------------
--------------------------------------------
/*
* Copyright 1992 by Jutta Degener and Carsten Bormann, Technische
* Universitaet Berlin. See the accompanying file "COPYRIGHT" for
* details. THERE IS ABSOLUTELY NO WARRANTY FOR THIS SOFTWARE.
*/
/*$Header: /home/cvsroot/speakfreely/GSM/INC/GSM.H,v 1.1.1.1 2002/01/05
02:21:05 bcw Exp $*/
#ifndef GSM_H
#define GSM_H
#define NeedFunctionPrototypes 1
#ifdef __cplusplus
# define NeedFunctionPrototypes 1
#endif
#if __STDC__
# define NeedFunctionPrototypes 1
#endif
#ifdef _NO_PROTO
# undef NeedFunctionPrototypes
#endif
#undef GSM_P /* gnu stdio.h actually defines this... */
#if NeedFunctionPrototypes
# define GSM_P( protos ) protos
#else
# define GSM_P( protos ) ( /* protos */ )
#endif
#ifdef NeedFunctionPrototypes
# include <stdio.h> /* for FILE * */
#endif
/* AUTO_SPARC_HACK added by John Walker. If defined, USE_FLOAT_MUL
automatically set when compiling on a Sparc. This lets most
people avoid editing the Makefile. */
#ifdef AUTO_SPARC_HACK
#ifdef sparc
#define USE_FLOAT_MUL
#define FAST
#endif
#endif
/*
* Interface
*/
typedef struct gsm_state * gsm;
typedef short gsm_signal; /* signed 16 bit */
typedef unsigned char gsm_byte;
typedef gsm_byte gsm_frame[33]; /* 33 * 8 bits */
#define GSM_MAGIC 0xD /* 13 kbit/s RPE-LTP
*/
#define GSM_PATCHLEVEL 2
#define GSM_MINOR 0
#define GSM_MAJOR 1
#define GSM_OPT_VERBOSE 1
#define GSM_OPT_FAST 2
extern gsm gsm_create GSM_P((void));
extern void gsm_destroy GSM_P((gsm));
extern int gsm_print GSM_P((FILE *, gsm, gsm_byte *));
extern int gsm_option GSM_P((gsm, long, long *));
extern void gsm_encode GSM_P((gsm, gsm_signal *, gsm_byte *));
extern int gsm_decode GSM_P((gsm, gsm_byte *, gsm_signal *));
extern int gsm_explode GSM_P((gsm, gsm_byte *, gsm_signal *));
extern void gsm_implode GSM_P((gsm, gsm_signal *, gsm_byte *));
#undef GSM_P
#endif /* GSM_H */
----------------------------------------------------------------------------
--------------------------------------------------------------------
"Victor Bazarov" <v.Abazarov@comAcast.net> wrote in message
news:OwhM48xeEHA.636@TK2MSFTNGP12.phx.gbl...
> 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
- Next message: Owen: "Re: wrong struct definition"
- Previous message: Victor Bazarov: "Re: wrong struct definition"
- In reply to: Victor Bazarov: "Re: Linmking problem"
- Next in thread: Victor Bazarov: "Re: Linmking problem"
- Reply: Victor Bazarov: "Re: Linmking problem"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|