Re: Newbie question: Need for header file when linking to static library

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



You failed to mention where that message comes from. If you are a beginner, and want
advice on an error message, it is absolutely critical that you copy the error message *IN
ITS ENTIRETY* from the window and paste it into the message. For example, you have not
stated if this is a compiler error (in which case, the failure to have specified header
file included in your compilation is the problem). If it failed during linking, it might
have said something like "somename@yzzzwz identifier not found", in which case it means
you have a DLL which has C-style entry points and you did not use the header file, which
should declare them as C-style entry points; otherwise C++ naming conventions are used.

So, in the absence of any useful information that would help us analyze your problem,
either you have failed to include the proper header file during the build process, or you
failed to specify the proper name specification during the build process, or it is failing
to find the library file (possibly because your specification of it to the linker is not
correct).

Please provide ALL necessary information.

A proper header file, by the way, typically has something like

#ifdef __cplusplus
extern "C" {
#endif

void SomeFunction();
void OtherFunction();
#ifdef __cplusplus
}
#endif

or

#ifdef __cplusplus
#define SOMENAME extern "C"
#else
#define SOMENAME
#endif

SOMENAME void SomeFunction();
SOMENAME void OtherFunction();

failure to do this will mean that your C++ program cannot be linked with a C-based DLL.
joe

On Sat, 07 Nov 2009 10:40:39 -0600, me@xxxxxxxx wrote:



Hi

I'm trying to use a 3rd party static library file. It's called
swedll32.lib..I've added it to my MFC Project.

When I try to call a function, I get: "identifier not found"

Don't I need a "swedll32.h" file to go along with the swedll32.lib
file?

All I have is a swedll32.dll and a swedll32.lib file.


thanks

Tony C.
Joseph M. Newcomer [MVP]
email: newcomer@xxxxxxxxxxxx
Web: http://www.flounder.com
MVP Tips: http://www.flounder.com/mvp_tips.htm
.



Relevant Pages

  • Re: Problems when adding a new source code
    ... #ifndef JME_EMAIL_HPP ... I hope that if in the future someone gets the same error message and ... Alwyn wrote: ...
    (alt.comp.lang.learn.c-cpp)
  • Re: vim and VIMRUNTIME
    ... Since yesterday i get the following error message when starting vim: ... I try to change the path in line 12 and then the first error message is ... by patent law on written works. ...
    (Debian-User)
  • Re: Xmkmf/make problem
    ... > I have several Xlib programs that compiled successfully on earlier ... > get an error message: ... > It looks as though this header file, and several others, have been moved ... the best option is to fix the broken programs. ...
    (freebsd-questions)
  • Re: Progress Bar For Sql server query
    ... > Then, perform an asynchronous fetching. ... > LOCAL loTherm ... > ERROR Message() ... > ENDIF ...
    (microsoft.public.fox.programmer.exchange)
  • vim and VIMRUNTIME
    ... I try to change the path in line 12 and then the first error message is ... Michael Ott, e-mail: ...
    (Debian-User)