473,320 Members | 1,802 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

Linking errors. - VC++ - Unresolved external Symbol

mp
Hi,

I have a Static library application in vc++ which generates
Parser.lib.

I have written a exe application in vc++ that links to Parser.lib.
This does some processing. (This project generates processor.exe) I
have given the path to Parser.lib in the additional library resources
in the linker settings and included a header file Parser.h. This
works perfectly.

But the actual requirement is that I should have processor.lib instead
of processor.exe so that I can call it from another project. So I
created a Static library and followed the same steps (including the
header and giving the path to the Parser.lib) THis generated
Processor.lib

NOW THE PROBLEM IS WHEN I link PROCESSOR.LIB from a exe project
(caller). I gave the include files and path to Processor.lib, but I
get the error:

unresolved external symbol "int __cdecl check(void)

(check() is a function in the Static Library Processor.lib )

Why does this happen?

It works when I have a Parser.lib and Processor.exe

But when I call Parser.lib <- Processor.lib <- caller (exe project) it
fails. Why is that ?
PLEASE HELP!
Jul 22 '05 #1
2 2161
is your function declared as __declspec(dllexport). And also when you are
reading the h file in your exe project the dllexport thing needs not be
there. Anyway I do this when I am creating a library

#if !defined( _AFXDLL )
#define DllExport

#else

#define DllExport __declspec( dllexport)

#endif // !defined( _AFXDLL ) || defined( _XT_STATICLINK )

class DllExport MyClass

{
};
or

void DllExport MyFunc();

Ali R.
"mp" <pu******@hotmail.com> wrote in message
news:df**************************@posting.google.c om...
Hi,

I have a Static library application in vc++ which generates
Parser.lib.

I have written a exe application in vc++ that links to Parser.lib.
This does some processing. (This project generates processor.exe) I
have given the path to Parser.lib in the additional library resources
in the linker settings and included a header file Parser.h. This
works perfectly.

But the actual requirement is that I should have processor.lib instead
of processor.exe so that I can call it from another project. So I
created a Static library and followed the same steps (including the
header and giving the path to the Parser.lib) THis generated
Processor.lib

NOW THE PROBLEM IS WHEN I link PROCESSOR.LIB from a exe project
(caller). I gave the include files and path to Processor.lib, but I
get the error:

unresolved external symbol "int __cdecl check(void)

(check() is a function in the Static Library Processor.lib )

Why does this happen?

It works when I have a Parser.lib and Processor.exe

But when I call Parser.lib <- Processor.lib <- caller (exe project) it
fails. Why is that ?
PLEASE HELP!

Jul 22 '05 #2
mp
Hi,

The problem was that of calling a C program from a C++ program. I
dint notice that I missed this detail.

After I added this to the caller project it works fine.

#include<stdio.h>
#ifdef __cplusplus /* identifies C++ */
extern "C" { // tell the C++ compiler that you have C decls

#include "C:\vlib\parser.h"
}
#endif

Thanks for the response.

MP
"Ali R." <no****@nospam.com> wrote in message news:<cO***************@newssvr24.news.prodigy.com >...
is your function declared as __declspec(dllexport). And also when you are
reading the h file in your exe project the dllexport thing needs not be
there. Anyway I do this when I am creating a library

#if !defined( _AFXDLL )
#define DllExport

#else

#define DllExport __declspec( dllexport)

#endif // !defined( _AFXDLL ) || defined( _XT_STATICLINK )

class DllExport MyClass

{
};
or

void DllExport MyFunc();

Ali R.
"mp" <pu******@hotmail.com> wrote in message
news:df**************************@posting.google.c om...
Hi,

I have a Static library application in vc++ which generates
Parser.lib.

I have written a exe application in vc++ that links to Parser.lib.
This does some processing. (This project generates processor.exe) I
have given the path to Parser.lib in the additional library resources
in the linker settings and included a header file Parser.h. This
works perfectly.

But the actual requirement is that I should have processor.lib instead
of processor.exe so that I can call it from another project. So I
created a Static library and followed the same steps (including the
header and giving the path to the Parser.lib) THis generated
Processor.lib

NOW THE PROBLEM IS WHEN I link PROCESSOR.LIB from a exe project
(caller). I gave the include files and path to Processor.lib, but I
get the error:

unresolved external symbol "int __cdecl check(void)

(check() is a function in the Static Library Processor.lib )

Why does this happen?

It works when I have a Parser.lib and Processor.exe

But when I call Parser.lib <- Processor.lib <- caller (exe project) it
fails. Why is that ?
PLEASE HELP!

Jul 22 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Usman | last post by:
Hi I've a COM compiled in visual studio 6 that is internally using zlib library (an opensource library for compression). I've no problem compiling that code. But when I moved to visual...
4
by: Sanjay Kumar | last post by:
Folks ! I am working with VC++ after a long time and having problem linking latest xerces 2.7 in VC++ 2005 Express Edition. I have done following: 1. downloaded and unpacked the the...
0
by: Adam Clauss | last post by:
I have managed C++ library (is bridging between a Win32 .dll and a C# application). All was well when compiled under VS2003, but I am running into a series of linking errors when compiling...
0
by: Philip Lowman | last post by:
I am in the process of trying to migrate a couple of build solutions to Visual Studio Express 2005 from VS 2003 Professional and I am running into a weird C/C++ runtime library linking issue when...
5
by: eberesche | last post by:
Hello, as a novice in ASN.1 I have me to a project in C ++ under use of ASN.1 - structures risquély. One of my colleagues means, this would deal something with masochism ;-). Result should be a DLL...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.