| | |
fatal error LNK1120:
Please support our C++ advertiser: Intel Parallel Studio Home
![]() |
•
•
Join Date: Nov 2008
Posts: 12
Reputation:
Solved Threads: 0
Hi, I have these errors:
--------------------Configuration: IP_devllink_06 - Win32 Debug--------------------
Linking...
IP_devlink_06.obj : error LNK2001: unresolved external symbol _DLClose@4
IP_devlink_06.obj : error LNK2001: unresolved external symbol _DLOpen@24
Debug/IP_devllink_06.exe : fatal error LNK1120: 2 unresolved externals
Error executing link.exe.
IP_devllink_06.exe - 3 error(s), 0 warning(s)
The probloem is that I am including my header in the project, and the name of these functions are the same (DLOpen and DLClose) when I compile, it runs well but when I try to Build the Link doesn't work
Any idea to solve it?
Thanks in advance.
--------------------Configuration: IP_devllink_06 - Win32 Debug--------------------
Linking...
IP_devlink_06.obj : error LNK2001: unresolved external symbol _DLClose@4
IP_devlink_06.obj : error LNK2001: unresolved external symbol _DLOpen@24
Debug/IP_devllink_06.exe : fatal error LNK1120: 2 unresolved externals
Error executing link.exe.
IP_devllink_06.exe - 3 error(s), 0 warning(s)
The probloem is that I am including my header in the project, and the name of these functions are the same (DLOpen and DLClose) when I compile, it runs well but when I try to Build the Link doesn't work
Any idea to solve it?
Thanks in advance.
Please post at least head of your header file...
Until then, this: googleing!
says this:
Until then, this: googleing!
says this:
•
•
•
•
Linker Tools Error LNK2001
unresolved external symbol "symbol"
Code references something (such as a function, variable, or label) that the linker can't find in the libraries and object files.
Possible causes
* What the code asks for doesn't exist (the symbol is spelled incorrectly or uses the wrong case, for example).
* The code asks for the wrong thing (you are using mixed versions of the libraries, some from one version of the product, others from another version).
This error message is followed by fatal error LNK1120.
Last edited by Sci@phy; Nov 11th, 2008 at 5:19 pm.
•
•
Join Date: Nov 2008
Posts: 12
Reputation:
Solved Threads: 0
this is my header code, and I am including in the project:
[/********************************************************************/
/* */
/* C/C++ Header File (c) 2001 Avaya Global SME Solutions */
/* */
/* Contents:- */
/* IP Office Dev link DLL provides an interface for managing */
/* the IP Office product ranges from a Windows PC. */
/********************************************************************/
#ifndef _DEVLINK_H_
#define _DEVLINK_H_
typedef char TEXT;
#define DEVLINK_SUCCESS - 0
#define DEVLINK_UNSPECIFIEDFAIL 1
#define DEVLINK_LICENCENOTFOUND 2
#define DEVLINK_COMMS_OPERATIONAL 0
#define DEVLINK_COMMS_NORESPONSE 1
#define DEVLINK_COMMS_REJECTED 2
#define DEVLINK_COMMS_MISSEDPACKETS 3
#ifdef __cplusplus
extern "C"
{
#endif
typedef void (CALLBACK * CALLLOGEVENT)(
LONG pbxh,
TEXT * info
);
typedef void (CALLBACK * COMMSEVENT)(
LONG pbxh,
DWORD comms_state,
DWORD parm1
);
LONG PASCAL DLOpen( HANDLE pbxh
, TEXT * pbx_address
, TEXT * pbx_password
, TEXT * reserved1
, TEXT * reserved2
, COMMSEVENT cb
);
LONG PASCAL DLClose( LONG pbxh );
LONG PASCAL DLRegisterType2CallDeltas( LONG pbxh, CALLLOGEVENT cb );
#ifdef __cplusplus
};
#endif
#endif // _DEVLINK_H_]
I have the same name for these (DLOpen - DLClose) but even have the Link error...
[/********************************************************************/
/* */
/* C/C++ Header File (c) 2001 Avaya Global SME Solutions */
/* */
/* Contents:- */
/* IP Office Dev link DLL provides an interface for managing */
/* the IP Office product ranges from a Windows PC. */
/********************************************************************/
#ifndef _DEVLINK_H_
#define _DEVLINK_H_
typedef char TEXT;
#define DEVLINK_SUCCESS - 0
#define DEVLINK_UNSPECIFIEDFAIL 1
#define DEVLINK_LICENCENOTFOUND 2
#define DEVLINK_COMMS_OPERATIONAL 0
#define DEVLINK_COMMS_NORESPONSE 1
#define DEVLINK_COMMS_REJECTED 2
#define DEVLINK_COMMS_MISSEDPACKETS 3
#ifdef __cplusplus
extern "C"
{
#endif
typedef void (CALLBACK * CALLLOGEVENT)(
LONG pbxh,
TEXT * info
);
typedef void (CALLBACK * COMMSEVENT)(
LONG pbxh,
DWORD comms_state,
DWORD parm1
);
LONG PASCAL DLOpen( HANDLE pbxh
, TEXT * pbx_address
, TEXT * pbx_password
, TEXT * reserved1
, TEXT * reserved2
, COMMSEVENT cb
);
LONG PASCAL DLClose( LONG pbxh );
LONG PASCAL DLRegisterType2CallDeltas( LONG pbxh, CALLLOGEVENT cb );
#ifdef __cplusplus
};
#endif
#endif // _DEVLINK_H_]
I have the same name for these (DLOpen - DLClose) but even have the Link error...
•
•
Join Date: Nov 2008
Posts: 12
Reputation:
Solved Threads: 0
this is my .cpp code where i call these functions, I'm including the
#include "devlink.h"
instruction and
#include "stdAfx.h"
that I read I need to get the Link
[#include "stdAfx.h"
#include <windows.h>
#include <stdio.h>
#include "devlink.h"
LONG hEvent;
DWORD dwCommsEvent;
BOOL bStarting;
void CALLBACK HandleCommsEvent( LONG pbxh, DWORD comms_evt, DWORD parm1 )
{
switch( comms_evt ) {
case DEVLINK_COMMS_OPERATIONAL:
// we are working fine... fall through
case DEVLINK_COMMS_NORESPONSE:
// system not found (initial connection),
// or network connection lost (rebooted?)
// fall through...
case DEVLINK_COMMS_REJECTED:
// incorrect system password specified...
if( bStarting ) {
dwCommsEvent = comms_evt;
SetEvent( hEvent );
}
else {
// insert your code here...
}
break;
case DEVLINK_COMMS_MISSEDPACKETS:
// Indicates that the system is under
// heavy load. IP Office always prioritises
// data routing and call handling above CTI events.
// (parm1 contains the number of packets missed)
break;
}
}
int main(int argc, char* argv)
{
printf( "connecting...");
bStarting = TRUE;
hEvent = CreateEvent( NULL, FALSE, FALSE, NULL );
DLOpen( 0,
"255.255.255.255",
"systempassword",
NULL,
NULL,
HandleCommsEvent );
dwCommsEvent = DEVLINK_COMMS_NORESPONSE;
WaitForSingleObject( hEvent, 10000L ); // 10 seconds
bStarting = FALSE;
if( dwCommsEvent == DEVLINK_COMMS_OPERATIONAL ) {
printf("Connected OK\n");
}
else {
printf("Error connecting to IP Office\n");
}
DLClose( 0 );
CloseHandle( hEvent );
return 0;
}]
#include "devlink.h"
instruction and
#include "stdAfx.h"
that I read I need to get the Link
[#include "stdAfx.h"
#include <windows.h>
#include <stdio.h>
#include "devlink.h"
LONG hEvent;
DWORD dwCommsEvent;
BOOL bStarting;
void CALLBACK HandleCommsEvent( LONG pbxh, DWORD comms_evt, DWORD parm1 )
{
switch( comms_evt ) {
case DEVLINK_COMMS_OPERATIONAL:
// we are working fine... fall through
case DEVLINK_COMMS_NORESPONSE:
// system not found (initial connection),
// or network connection lost (rebooted?)
// fall through...
case DEVLINK_COMMS_REJECTED:
// incorrect system password specified...
if( bStarting ) {
dwCommsEvent = comms_evt;
SetEvent( hEvent );
}
else {
// insert your code here...
}
break;
case DEVLINK_COMMS_MISSEDPACKETS:
// Indicates that the system is under
// heavy load. IP Office always prioritises
// data routing and call handling above CTI events.
// (parm1 contains the number of packets missed)
break;
}
}
int main(int argc, char* argv)
{
printf( "connecting...");
bStarting = TRUE;
hEvent = CreateEvent( NULL, FALSE, FALSE, NULL );
DLOpen( 0,
"255.255.255.255",
"systempassword",
NULL,
NULL,
HandleCommsEvent );
dwCommsEvent = DEVLINK_COMMS_NORESPONSE;
WaitForSingleObject( hEvent, 10000L ); // 10 seconds
bStarting = FALSE;
if( dwCommsEvent == DEVLINK_COMMS_OPERATIONAL ) {
printf("Connected OK\n");
}
else {
printf("Error connecting to IP Office\n");
}
DLClose( 0 );
CloseHandle( hEvent );
return 0;
}]
Ooh... I know English is not my native language but...
I'm not interesting where you CALL these functions.
My question was: where were these two functions defined? A function definition code looks like
Where is
???
Probably these functions were placed in the library. Did you attach this library to your project? Where is this library?..
I'm not interesting where you CALL these functions.
My question was: where were these two functions defined? A function definition code looks like
C++ Syntax (Toggle Plain Text)
type function_name(parameters) { function_body }
C++ Syntax (Toggle Plain Text)
LONG PASCAL DLOpen(....) { ... }
Probably these functions were placed in the library. Did you attach this library to your project? Where is this library?..
•
•
Join Date: Nov 2008
Posts: 12
Reputation:
Solved Threads: 0
these are in my header file (devlink.h) and the code is:
I'm including my header file (devlink.h) as part of my project, and put the instruction to "LINK"
#include "devlink.h"
in my .cpp code, (I send the complete code in previous messages)
C++ Syntax (Toggle Plain Text)
LONG PASCAL DLOpen( HANDLE pbxh , TEXT * pbx_address , TEXT * pbx_password , TEXT * reserved1 , TEXT * reserved2 , COMMSEVENT cb ); LONG PASCAL DLClose( LONG pbxh );
I'm including my header file (devlink.h) as part of my project, and put the instruction to "LINK"
#include "devlink.h"
in my .cpp code, (I send the complete code in previous messages)
I see you don't understand a difference between a function declaration (prototype) and a functions definition (header+body). The DLOpen function prototype in your header file is not the DLOpen function. It's a declaration only. You declare (to compiler): "See, I have this function elsewhere. Let this functions calls in my code below correspond the prototype". A prototype does not generate machine code. If you call DLOpen in your program, you must have this function definition (header+body) in your source codes or in an external library (included in the project).
Obviously you don't know where is DLOpen and where is DLClose source or object codes.
I don't know as well...
Obviously you don't know where is DLOpen and where is DLClose source or object codes.
I don't know as well...
•
•
Join Date: Nov 2008
Posts: 12
Reputation:
Solved Threads: 0
I found these functions in dlfcn.h and I need to add the cdefs,h
I include in my projects, but now I have this error:
Deleting intermediate files and output files for project 'prueba_IP_devlink_08 - Win32 Debug'.
--------------------Configuration: prueba_IP_devlink_08 - Win32 Debug--------------------
Compiling...
prueba_08.cpp
Linking...
dlfcn.h : fatal error LNK1136: invalid or corrupt file
Error executing link.exe.
prueba_IP_devlink_08.exe - 1 error(s), 0 warning(s)
I include in my projects, but now I have this error:
Deleting intermediate files and output files for project 'prueba_IP_devlink_08 - Win32 Debug'.
--------------------Configuration: prueba_IP_devlink_08 - Win32 Debug--------------------
Compiling...
prueba_08.cpp
Linking...
dlfcn.h : fatal error LNK1136: invalid or corrupt file
Error executing link.exe.
prueba_IP_devlink_08.exe - 1 error(s), 0 warning(s)
![]() |
Similar Threads
- Help! error LNK2001 & error LNK (C++)
- Help! error LNK2001 & error LNK1120 (C++)
- Don't know what this C++ error means (C++)
- error LNK2001: unresolved external symbol (C++)
- Error in c++ program (C++)
- Error! (C)
- MS Visual++ 6.0 - Error C2146, C2501 ... (C++)
- Error Linking KeyLogger.exe (C++)
Other Threads in the C++ Forum
- Previous Thread: passing template class objects as parameters to friend functions of the same class
- Next Thread: turbo c++ 3.xx Project
| Thread Tools | Search this Thread |
api array based beginner binary bitmap c++ c/c++ calculator char char* class code coding compile compiler console conversion count database delete deploy developer directshow dll download dynamic dynamiccharacterarray email encryption error file forms fstream function functions game givemetehcodez google graph gui homeworkhelp homeworkhelper iamthwee ifstream input int java lib linkedlist linker list loop looping loops map math matrix memory multiple news node number numbertoword output parameter pointer problem program programming project proxy python random read recursion recursive reference rpg sorting string strings temperature template test text text-file tree unix url variable vector video visualstudio win32 windows winsock word wordfrequency wxwidgets







).