delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2002/10/10/21:02:14

Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sources.redhat.com/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sources.redhat.com/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com
Message-ID: <4910-2200210511123514@M2W047.mail2web.com>
X-Priority: 3
Reply-To: lhall AT rfk DOT com
X-Originating-IP: 209.113.174.244
From: "lhall AT pop DOT ma DOT ultranet DOT com" <lhall AT pop DOT ma DOT ultranet DOT com>
To: nickolai DOT bogdatov AT verizon DOT com, lhall AT rfk DOT com, cygwin AT cygwin DOT com
Subject: RE: 1.3.12-2 how to link with MS Platform SDK
Date: Thu, 10 Oct 2002 21:02:03 -0400
MIME-Version: 1.0
X-OriginalArrivalTime: 11 Oct 2002 01:02:03.0543 (UTC) FILETIME=[CFB35270:01C270C1]
X-MIME-Autoconverted: from quoted-printable to 8bit by delorie.com id g9B12Dd04375

OK, so now you know that the library contains a function you want to 
link with and it uses the C calling convention (cdecl).  Apparently the 
include files you're using are giving you the Windows standrd convention 
(stdcall).  Put __attribute__((cdecl)) (or CDECL or WINAPIV if you include 
the windef.h from the Cygwin w32api package) in front of your function 
declaration and things should link fine.  If you have questions about these 
calling conventions see the MSDN at msdn.microsoft.com and see the topic 
"calling conventions".  Oh and don't forget to send a big thank you to Bill.

Good luck,

Larry

Original Message:
-----------------
From:  nickolai DOT bogdatov AT verizon DOT com
Date: Thu, 10 Oct 2002 15:58:57 -0400
To: lhall AT rfk DOT com, cygwin AT cygwin DOT com
Subject: RE: 1.3.12-2 how to link with MS Platform SDK



Thanks, God.
Somebody knows what I'm talking about !

Here is the extract from result of "nm  DhcpCSvc.Lib"
DHCPCSVC.DLL:
00000000 I .idata$4
00000000 I .idata$5
00000000 I .idata$6
00000000 T .text
00000000 T  _DhcpCApiInitialize
                  U __IMPORT_DESCRIPTOR_DHCPCSVC
00000000 I   __imp__DhcpCApiInitialize

What EXACTLY it is giving me ?
Should I create a "DEF" file with all these name but with "_" in front of
the name each function ?
Or should I provide cygwin linker with some options to understand these
kind of format ?

And by the way, here is Makefile:
--------------------------------------------------
CC          = g++
CPPFLAGS    =
DEFS        =
INCS        =
LDFLAGS     =

## Put them all together
INCLUDES    = $(INCS) -I. -I /usr/include/mingw
DEFINES     = $(DEFS)
CFLAGS      = $(INCLUDES) $(DEFINES)
LIBS        = -L. -L/usr/lib/win32api -liphlpapi -ldhcpcsvc

.cpp.o:
      $(CC) $(CFLAGS) -c $<
TARGETS     = srv \

all: $(TARGETS)
clean:
      -rm -f *.o $(TARGETS) *.1
srv:    srv.o
      $(CC) -o $@ srv.o  $(LDFLAGS) $(LIBS)


Regards,
Nickolai Bogdatov




|---------+---------------------------->
|         |           "lhall AT pop DOT ma DOT ult|
|         |           ranet.com" <lhall|
|         |                            |
|         |           10/10/2002 03:36 |
|         |           PM               |
|         |           Please respond to|
|         |           lhall            |
|         |                            |
|---------+---------------------------->
  >-------------------------------------------------------------------------
-------------------------------------|
  |                                                                        
|
  |       To:       Nickolai G. Bogdatov/EMPL/FL/Verizon AT VZNotes,
cygwin AT cygwin DOT com                              |
  |       cc:                                                              
|
  |       Subject:  RE: 1.3.12-2 how to link with MS Platform SDK          
|
  >-------------------------------------------------------------------------
-------------------------------------|




OK, as I thought.  The problem is not the import library
(the .a you created has the same format as the .lib so there's
no benefit to creating the .a).  You need to find out if the
function you're trying to link to is in that library and what
it's name is.  Run 'nm' on the library and grep the results for
your function.  If there's a function in the results that has the
right name but has different stuff appended to the front and/or
back, the include file you're using isn't giving you the right
calling convention (cdecl, stdcall, fastcall).  This is likely
the problem.

Larry

Original Message:
-----------------
From:  nickolai DOT bogdatov AT verizon DOT com
Date: Thu, 10 Oct 2002 15:08:57 -0400
To: lhall AT rfk DOT com, cygwin AT cygwin DOT com
Subject: RE: 1.3.12-2 how to link with MS Platform SDK



During linking it gives me "enresolved external"

Regards,
Nickolai Bogdatov




--------------------------------------------------------------------
mail2web - Check your email from the web at
http://mail2web.com/ .







--------------------------------------------------------------------
mail2web - Check your email from the web at
http://mail2web.com/ .



--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Bug reporting:         http://cygwin.com/bugs.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019