delorie.com/archives/browse.cgi | search |
X-Authentication-Warning: | delorie.com: mailnull set sender to djgpp-bounces using -f |
From: | "Christophe BARIBAUD" <cbaribau AT jnjfr DOT jnj DOT com> |
Newsgroups: | comp.os.msdos.djgpp |
Subject: | Re: Compiling and linking ASM and C++ files. |
Date: | Fri, 1 Feb 2002 09:53:38 +0100 |
Organization: | CompuServe Interactive Services |
Lines: | 61 |
Message-ID: | <a3dl1i$92t$1@suaar1aa.prod.compuserve.com> |
References: | <74ee5cc121b560fecbc3a4278528749b DOT 62691 AT mygate DOT mailgate DOT org> |
NNTP-Posting-Host: | fra-tgn-oyg-vty19.as.wcom.net |
X-Trace: | suaar1aa.prod.compuserve.com 1012553586 9309 212.211.86.19 (1 Feb 2002 08:53:06 GMT) |
X-Complaints-To: | newsmaster AT compuserve DOT com |
NNTP-Posting-Date: | 1 Feb 2002 08:53:06 GMT |
X-Priority: | 3 |
X-MSMail-Priority: | Normal |
X-Newsreader: | Microsoft Outlook Express 5.50.4133.2400 |
X-MimeOLE: | Produced By Microsoft MimeOLE V5.50.4133.2400 |
To: | djgpp AT delorie DOT com |
DJ-Gateway: | from newsgroup comp.os.msdos.djgpp |
Reply-To: | djgpp AT delorie DOT com |
Try extern "C" void start(); to avoid C++ mangling "Joel Saunders" <jbs30000 AT aol DOT com> a écrit dans le message news: 74ee5cc121b560fecbc3a4278528749b DOT 62691 AT mygate DOT mailgate DOT org... > I've made projects before where I've successfully compiled and linked > togeather multiple C++ files. So I decided to try to do the same with > one C++ file and an ASM file. I was searching for examples of ASM files > that used .intel_syntax and pretty much found only one. So I used that > example for my ASM file (.s file) and then made a C++ file that called > the routine in the .s file. The routine in the .s file doesn't work, > but that's not important. All I want to know, is why I get the errors > I'm getting when Rhide goes to link the files togeather. First I'll > show .s file, then the .cpp file, and then the error. Thanks in advance > for your help. > global _start > .intel_syntax noprefix > > .section .text > _start: > > mov eax, 4 > mov ebx, 1 > mov ecx, offset msg > mov edx, msg_len > int 0x80; > > xor eax, eax > inc eax > int 0x80 > > .section .data > msg: .ascii "Hello, from gas " > msg_len = .-msg > > Now, the C++ Part: > extern void start(); > main(void) > > start(); > return 0; > } > > Now the errors: > > -[_]--------------------------- Message Window > -------------------------4-[]- > Creating: asm.exe > Error: casmtest.o: In function `main': > casmtest.cpp(4) Error: undefined reference to `start()' > Error: casmtest.o(.eh_frame+0x11):casmtest.cpp: undefined reference to > `__gxx_personality_v0' > There were some errors > > > -- > Posted via Mailgate.ORG Server - http://www.Mailgate.ORG
webmaster | delorie software privacy |
Copyright © 2019 by DJ Delorie | Updated Jul 2019 |