From: Denis Kirienko <kirienko@mccme.ru>
To: community@altlinux.ru
Subject: Re: [Comm] compiling cpp and c files
Date: Thu, 21 Oct 2004 19:42:17 +0400
Message-ID: <20041021194217.07c394ae.kirienko@mccme.ru> (raw)
In-Reply-To: <4177B3CA.2020803@ricom.ru>
Получил Thu, 21 Oct 2004 17:04:10 +0400 от Alexey Morsov
<samurai@ricom.ru> следующее письмо:
> Хочу скомпилировать вместе main.cpp и common.c - и не получается.
> Т.е. make компилит отдельно и то и другое но вместе их сливать ен
> зочет, ругается что в файле main.cpp undefined function **** -
> которая как раз в common.c .
>
> Как это можно соить (ведь можно же как-то)?
Вы бы хотя бы сообщение об ошибке привели полностью...
Насколько я понял, у Вас функция не определена в main.cpp, откуда вы
ее вызываете. Добавьте в файл main.cpp строку с описанием этой функции
вида
int myfunc(int, double, char*);
соответствующую определению этой функции.
Еще более кошерный способ - сделать файл common.h следующего
содержания:
#ifndef _COMMON_H_
#define _COMMON_H_
int myfunc(int, double, char*);
#endif
и включить его в файлы common.cpp и main.cpp:
#include "common.h"
--
Денис
next prev parent reply other threads:[~2004-10-21 15:42 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-10-21 13:04 Alexey Morsov
2004-10-21 15:39 ` Yuri N. Glibovetz
2004-10-22 6:33 ` Alexey Morsov
2004-10-21 15:42 ` Denis Kirienko [this message]
2004-10-22 6:32 ` Alexey Morsov
2004-10-22 9:02 ` Yuri N. Glibovetz
2004-10-22 9:23 ` Alexey Morsov
2004-10-22 9:36 ` Yuri N. Glibovetz
2004-10-22 9:53 ` Alexey Morsov
2004-10-21 19:28 ` scor
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20041021194217.07c394ae.kirienko@mccme.ru \
--to=kirienko@mccme.ru \
--cc=community@altlinux.ru \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
ALT Linux Community general discussions
This inbox may be cloned and mirrored by anyone:
git clone --mirror http://lore.altlinux.org/community/0 community/git/0.git
# If you have public-inbox 1.1+ installed, you may
# initialize and index your mirror using the following commands:
public-inbox-init -V2 community community/ http://lore.altlinux.org/community \
mandrake-russian@linuxteam.iplabs.ru community@lists.altlinux.org community@lists.altlinux.ru community@lists.altlinux.com
public-inbox-index community
Example config snippet for mirrors.
Newsgroup available over NNTP:
nntp://lore.altlinux.org/org.altlinux.lists.community
AGPL code for this site: git clone https://public-inbox.org/public-inbox.git