The Shed is going Social! Join us on FaceBook and Twitter and chime in on the conversation.
|
 |
|
Dev Shed Forums
> Programming Languages
> C Programming
|
Dll dev cpp - linking problem
Discuss Dll dev cpp - linking problem in the C Programming forum on Dev Shed. Dll dev cpp - linking problem C programming forum discussing all C derivatives, including C#, C++, Object-C, and even plain old vanilla C. These languages are low level languages, and used on projects such as device drivers, compilers, and even whole computer operating systems.
|
|
 |
|
|
|
|

Dev Shed Forums Sponsor:
|
|
|

September 2nd, 2007, 12:40 PM
|
|
Registered User
|
|
Join Date: Aug 2007
Posts: 4
Time spent in forums: 27 m 48 sec
Reputation Power: 0
|
|
|
Dll dev cpp - linking problem
Hi,
i have done DLL in dev cpp ( file, new, project, dll).
I am trying to get function contained in this DLL. I am getting following error:
[Linker error] undefined reference to `_imp___Z15GetArrayFromBMPPc'
This error normaly arrises when you do not include your library in linker. Dev cpp did not produced .lib file.
Is the case in .lib file?
If yes could someone tell me how to produce .lib file?
|

September 2nd, 2007, 09:00 PM
|
 |
Banned ;)
|
|
Join Date: Nov 2001
Location: Woodland Hills, Los Angeles County, California, USA
|
|
|
Then you're linking to the library incorrectly. DLL is not the same as a LIB file. DLL is designed to be linked at runtime, unlike LIB which links at compile time.
__________________
Up the Irons
What Would Jimi Do? Smash amps. Burn guitar. Take the groupies home.
"Death Before Dishonour, my Friends!!" - Bruce D ickinson, Iron Maiden Aug 20, 2005 @ OzzFest
Down with Sharon Osbourne
|

September 4th, 2007, 12:40 PM
|
|
Registered User
|
|
Join Date: Aug 2007
Posts: 4
Time spent in forums: 27 m 48 sec
Reputation Power: 0
|
|
|
Probably You are right. I have checked in web sites how to load DLL and used this code. My code is folllowing:
#include <cstdlib>
#include <iostream>
#include <windows.h>
#include "EasyBMP.h"
#include "bmp1.h"
using namespace std;
typedef float***(*fun)(char *);
typedef int (*fun1)(char *,float ***,int , int ,int ,int );
int main(int argc, char *argv[]) {
char *file="example1.bmp", *file1="example7.bmp";
float ***array;
HMODULE hModule = LoadLibrary("bmp1.dll");
if(hModule == NULL) return 0;
fun hFun =(fun)GetProcAddress(hModule, "GetArrayFromBMP");
if (hFun == NULL) return 0;
array=GetArrayFromBMP(file);
fun1 hFun1 =(fun1)GetProcAddress(hModule,"GetArrayToBMP");
if (hFun1 == NULL) return 0;
GetArrayToBMP(file1,array,100,100,8,1);
FreeLibrary(hModule);
//system("PAUSE");
return EXIT_SUCCESS;
}
If you know what is wrong, please tell me.
|

September 4th, 2007, 12:58 PM
|
|
|
|
Developer Shed Advertisers and Affiliates
| Thread Tools |
Search this Thread |
|
|
|
| Display Modes |
Rate This Thread |
Linear Mode
|
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
|
|