cvs.gedasymbols.org/archives/browse.cgi   search  
Mail Archives: djgpp/1998/06/14/03:38:12

Message-ID: <199806140935520580.001D1350@pogwizd.tcs.uni.wroc.pl>
Date: Sun, 14 Jun 1998 09:35:52 +0200
From: "Pawel Kowalski" <pk AT tcs DOT uni DOT wroc DOT pl>
To: djgpp AT delorie DOT com
Subject: NASM & DJGPP - problem with function arguments.

I've decided to rewrite everything in NASM, but came across a problem.

1. When I write:

--[file.asm]------------------------------------------------
[BITS 32]
[GLOBAL _My_function]
[SECTION .text]

_My_function:
	mov	ax, 1010
	ret
------------------------------------------------------------

with

--[test.c]--------------------------------------------------
extern int My_function();

void main()
{
  printf("Result=%d\n", My_function());
  return;
}
------------------------------------------------------------

it compiles ok. But if I change file name from test.c to objective
test.cc it doesn't. It says "Undefined reference to My_function(void)"


2. When I write:

--[file.asm]------------------------------------------------
[BITS 32]
[GLOBAL _My_function__FUi]
[SECTION .text]

_My_function__FUi:
	mov	ax, 1010
	ret
------------------------------------------------------------

with

--[test.c]--------------------------------------------------
extern int My_function(unsigned int);

void main()
{
  printf("Result=%d\n", My_function(23));
  return;
}
------------------------------------------------------------

it says "Undefined reference to My_function". Why?
Please help me.

-PK

- Raw text -


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