Subj : How to compile cpp using a dll To : borland.public.cpp.borlandcpp From : ssk Date : Tue Aug 24 2004 05:42 pm Hello! I am trying to create a dll and to use it. I copied sources(console program) and can't compile them. I'm using BCC32.exe 5.3 on XP Professional. I copied the sources and saved them in a same directory like: dlltest.cpp dlltest.h dllrun.cpp I compiled like: bcc32 -tWD dlltest.cpp -> OK! Created dlltest.obj, dlltest.dll, dlltest.tds bcc32 -tWC dllrun.cpp -> Error! Here's the error message: Borland C++ 5.3 for Win32 Copyright (c) 1993, 1998 Borland International dllrun.cpp: Turbo Incremental Link 3.0 Copyright (c) 1997, 1998 Borland International Error: Unresolved external '_NumberList' referenced from C:\DOCUMENTS AND SETTIN GS\SSK\MY DOCUMENTS\MY CODES\C++\TEST\DLL\DLLRUN.OBJ Error: Unresolved external '_LetterList' referenced from C:\DOCUMENTS AND SETTIN GS\SSK\MY DOCUMENTS\MY CODES\C++\TEST\DLL\DLLRUN.OBJ I tried to copy dlltest.dll to C:\Windows\System32 but it didn't work. How can I solve this problem? ----------dlltest.h-------- #ifndef _DLLTEST_H_ #define _DLLTEST_H_ #include #include #include extern "C" __declspec(dllexport) void NumberList(); extern "C" __declspec(dllexport) void LetterList(); #endif ------------------------------ ---------dlltest.cpp----------- #include "dlltest.h" #define MAXMODULE 50 char module[MAXMODULE]; extern "C" __declspec(dllexport) void NumberList() { GetModuleFileName(NULL, (LPTSTR)module, MAXMODULE); cout << "\n\nThis function was called from " << module << endl << endl; cout << "NumberList(): "; for(int i=0; i<10; i++) { cout << i << " "; } cout << endl << endl; } extern "C" __declspec(dllexport) void LetterList() { GetModuleFileName(NULL, (LPTSTR)module, MAXMODULE); cout << "\n\nThis function was called from " << module << endl << endl; cout << "LetterList(): "; for(int i=0; i<26; i++) { cout << char(97 + i) << " "; } cout << endl << endl; } ------------------------------ -------------dllrun.cpp---------------- #include #include void main() { NumberList(); LetterList(); getch(); } -------------------------------------- Thanks in advance. Sam .