delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/1997/02/05/14:47:17

From: pal AT holly DOT mdd DOT com ("Bappa Pal")
Subject: dlltool and ld combination does not work
5 Feb 1997 14:47:17 -0800 :
Approved: cygnus DOT gnu-win32 AT cygnus DOT com
Distribution: cygnus
Message-ID: <199702051815.NAA09584.cygnus.gnu-win32@holly.mdd.com>
Mime-Version: 1.0
Original-To: <gnu-win32 AT cygnus DOT com>
X-MSMail-Priority: Normal
X-Priority: 3
X-Mailer: Microsoft Internet Mail 4.70.1155
Original-Sender: owner-gnu-win32 AT cygnus DOT com

I am developing under windows 95 using gnu-win32. My goal is to port unix
code to win95 and build a dll to access the functions.

I am trying to follow the example provided on your web site to build a DLL.


I am getting an error everytime I use ld to build the dll. The test case I
am using is very simple. I have a C file called vp_print.c with the
following code:

#include <stdio.h>
#include <stdlib.h>

void vp_print(char *str_txt)
{
	char str[10];

      strcpy(str, str_txt);

}

DEF file test.def :

EXPORTS
vp_print

I use the following commands to compile the file:

dlltool -v --def test.def --output-exp test.exp --output-lib test.a
--dllname test.dll

gcc -c vp_print.c

ld -T/usr/ashwin/i386pe.x -o test.dll test.exp vp_print.o

Note:i386pe.x is the linker script with path names including the c library
locations.

** I get the following error when I run the ld command

vp_print.o(.text+0xf):vp_print.c: undefined reference to `strcpy'

Why is this happening. I have provided the paths to the necessary
libraries. Happens with any C function I use, printf, etc....
Greatly appreciate any suggestions you might have regarding this error.

My e-mail address is : asrinivasan AT mdd DOT com

Thanks 
Ashwin Srinivasan

-
For help on using this list, send a message to
"gnu-win32-request AT cygnus DOT com" with one line of text: "help".

- Raw text -


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