From mboxrd@z Thu Jan 1 00:00:00 1970 From: Uri Lublin Subject: Re: Problem adding new source files Date: Thu, 18 Sep 2008 19:01:23 +0300 Message-ID: <48D27B53.6070009@qumranet.com> References: <43BCF5BD5ADA674C839A0242AC72B32B01244BCD@dewdfe1f.wdf.sap.corp> <48D25524.7060601@qumranet.com> <43BCF5BD5ADA674C839A0242AC72B32B01293416@dewdfe1f.wdf.sap.corp> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Cc: kvm@vger.kernel.org To: "Hacking, Stuart" Return-path: Received: from mis011-2.exch011.intermedia.net ([64.78.17.183]:33359 "EHLO mis011-2.exch011.intermedia.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754590AbYIRQB1 (ORCPT ); Thu, 18 Sep 2008 12:01:27 -0400 In-Reply-To: <43BCF5BD5ADA674C839A0242AC72B32B01293416@dewdfe1f.wdf.sap.corp> Sender: kvm-owner@vger.kernel.org List-ID: Hacking, Stuart wrote: >> From: Uri Lublin [mailto:uril@qumranet.com] >> Hacking, Stuart wrote: >>> Hello, >> Hi, >>> >>> We have been doing some experimentation with modifications to the >>> migration code in the Qemu and came up against a problem. >> We included >>> some code in a different file and are receiving the following error >>> from >>> make: >>> >>> --- >>> Migration.o: In function `migrate_prepare_page': >>> /root/tmp/KVM/qemu/migration.c:367: undefined reference to >>> `get_cached_page' >>> /root/tmp/KVM/qemu/migration.c:367: undefined reference to >>> `get_cached_page' >>> /root/tmp/KVM/qemu/migration.c:367: undefined reference to >>> `get_cached_page' >>> collect2: ld returned 1 exit status >>> Make[2]: *** [qemu-system_x86_64] Error 1 >>> Make[1]: *** [subdir-x86_64-softmmu] Error2 >>> Make: *** [qemu] Error 2 >>> --- >> Did you define new functions in a different .c file(s) ? Did >> you provide prototypes for all new functions ? Did you add >> all new files to the Makefile ? >> > > As far as I know all the code is organised properly and the function > prototypes provided in header files. As for adding to the Makefile - > that's where we are struggling. We have tried the following > 'experiments': adding our new source files to the 'OBJS' variable > (OBJS+=s1.o s2.o); creating a migration.o directive which depends on > s1.o and s2.o (this actually produces a slightly different error: > Try just adding your new .o files (e.g: OBJS+=s1.o s2.o) to /qemu/Makefile.target