|
Archives
D Programming
DD.gnu digitalmars.D digitalmars.D.bugs digitalmars.D.dtl digitalmars.D.dwt digitalmars.D.announce digitalmars.D.learn digitalmars.D.debugger C/C++ Programming
c++c++.announce c++.atl c++.beta c++.chat c++.command-line c++.dos c++.dos.16-bits c++.dos.32-bits c++.idde c++.mfc c++.rtl c++.stl c++.stl.hp c++.stl.port c++.stl.sgi c++.stlsoft c++.windows c++.windows.16-bits c++.windows.32-bits c++.wxwindows digitalmars.empire digitalmars.DMDScript |
c++.windows.32-bits - Problem compiling DLL
Hi, I have a problem compiling a DLL. The C files all compile without
any problems to OBJ files. I than use the following line to create my
DLL (I have obmitted mist OBJ files to keep the posting short):
--- BEGIN
link alter.obj analyze.obj ... where.obj
kernel32.lib,myvaluedriver.dll,,,myvaluedriver.def
OPTLINK (R) for Win32 Release 7.50B1
Copyright (C) Digital Mars 1989 - 2001 All Rights Reserved
OPTLINK : Error 180: No Match Found for Export/ENTRY - :
activate_cerod
OPTLINK : Warning 148: USE16/USE32 Mismatch : DGROUP
OPTLINK : Warning 174: 32-bit Segments Inappropriate for 16-bit
Segmented output
OPTLINK : Error 81: Cannot EXPORT : activate_cerod
alter.obj(alter)
Error 35: Cannot Reach TARGET from FRAME at Relative 0000CH from
Segment _TEXT
FRAME = Frame of Group FLAT 0000
TARGET = External Symbol _value_text 39D91H
FIXUPP Type = 32-bit Conditional JMP
--- errorlevel 3
---END
The function ACTIVATE_CEROD has been declared as:
extern void activate_cerod(const char*);
And defined as:
int _export activate_cerod(const char *text){...
My DEF file looks like this:
LIBRARY myvaluedriver
EXETYPE WINDOWS
DATA SINGLE MOVEABLE
EXPORTS
activate_cerod
Can someone please tell me what I'm doing wrong? Thanks a lot.
--
Robert M. Münch
Management & IT Freelancer
http://www.robertmuench.de
Oct 30 2006
On Mon, 30 Oct 2006 09:45:00 +0100, Robert M. Münch <robert.muench robertmuench.de> wrote:Hi, I have a problem compiling a DLL. The C files all compile ... Nov 06 2006
Robert M. Münch wrote:On Mon, 30 Oct 2006 09:45:00 +0100, Robert M. Münch <robert.muench robertmuench.de> wrote:Hi, I have a problem compiling a DLL. The C files all compile ... Nov 06 2006
On Mon, 06 Nov 2006 23:58:10 +0100, Arjan Knepper <arjan ask.me.to> wrote:Can you post the exact compiler and linker commandlines used to create the obj files and the link command to create the dll? Nov 10 2006
Robert M. Münch wrote:On Mon, 06 Nov 2006 23:58:10 +0100, Arjan Knepper <arjan ask.me.to> wrote:Can you post the exact compiler and linker commandlines used to create the obj files and the link command to create the dll? Nov 10 2006
On Fri, 10 Nov 2006 13:44:25 +0100, Arjan Knepper <arjan ask.me.to> wrote:0.) Is the compiler option "-mnw" is really needed? Nov 10 2006
On Fri, 10 Nov 2006 13:44:25 +0100, Arjan Knepper <arjan ask.me.to> wrote: Hi, so I made it to get a DLL with a good looking export section. No warning, errors or anything else. The only problem is, the DLL isn't working when compiled with DMC. I have the same DLL done with MSVC and it works. Looking at the DLL structure I can see differences in the number of sections etc. And the DM version has a debug section, even I didn't specified any debug stuff, nor that I want to get a map file. Any ideas how I can drill down the differences? IMO it can't be the code. -- Robert M. Münch Management & IT Freelancer http://www.robertmuench.de Nov 10 2006
Robert M. Münch wrote:On Fri, 10 Nov 2006 13:44:25 +0100, Arjan Knepper <arjan ask.me.to> wrote: Hi, so I made it to get a DLL with a good looking export section. No warning, errors or anything else. The only problem is, the DLL isn't working when compiled with DMC. I have the same DLL done with MSVC and it works. Looking at the DLL structure I can see differences in the number of sections etc. And the DM version has a debug section, even I didn't specified any debug stuff, nor that I want to get a map file. Any ideas how I can drill down the differences? IMO it can't be the code. --Robert M. Münch Management & IT Freelancer http://www.robertmuench.de Nov 13 2006
On Mon, 13 Nov 2006 13:11:14 +0100, Arjan Knepper <arjan ask.me.to> wrote:What isn't exactly working? How are you using the dll? In combination with dmc compiled exe's using a import lib or delayed/late binding? Nov 17 2006
Robert M. Münch wrote:On Mon, 13 Nov 2006 13:11:14 +0100, Arjan Knepper <arjan ask.me.to> wrote:What isn't exactly working? How are you using the dll? In combination with dmc compiled exe's using a import lib or delayed/late binding? Nov 17 2006
FWIW, I had the same initial problem with the Error 180 and all that. Finally solved that by adding CODE and DATA lines to my .def file. Since the lines i added differ from what was shown in this thread, others might want to see and maybe explain what's going on. (Although, i have yet to get as far as running a test app to use my DLL...) LIBRARY wavescrawlcore INITGLOBAL EXETYPE NT CODE PRELOAD DISCARDABLE DATA PRELOAD SINGLE EXPORTS CreateWaveScrawler 1 .... Feb 01 2007
On Fri, 02 Feb 2007 06:13:13 +0100, DarenW <darenw comcast.net> wrote:FWIW, I had the same initial problem with the Error 180 and all that. Finally solved that by adding CODE and DATA lines to my .def file. Since the lines i added differ from what was shown in this thread, others might want to see and maybe explain what's going on. (Although, i have yet to get as far as running a test app to use my DLL...) LIBRARY wavescrawlcore INITGLOBAL EXETYPE NT CODE PRELOAD DISCARDABLE DATA PRELOAD SINGLE EXPORTS CreateWaveScrawler 1 .... Feb 04 2007
|