public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
From: 桂永林 <guiyonglin@huaqin.com>
To: "Jonathan Wakely" <jwakely.gcc@gmail.com>,
	 "Xi Ruoyao" <xry111@mengyan1223.wang>
Cc: "LIU Hao" <lh_mouse@126.com>,
	"Tom Kacvinsky" <tkacvins@gmail.com>,
	gcc-help <gcc-help@gcc.gnu.org>, 柳茂昕 <liumaoxin@huaqin.com>,
	李闯闯 <lichuangchuang@huaqin.com>, 汤汝 <tangru@huaqin.com>
Subject: Re:  Re:  Re: Re: GCC link problem help!
Date: Fri, 22 Oct 2021 11:39:39 +0800 (GMT+08:00)	[thread overview]
Message-ID: <30402992.292f2.17ca61533e4.Coremail.guiyonglin@huaqin.com> (raw)
In-Reply-To: <617231DF.3080808@huaqin.com>

Hello Jonathan Wakely,

    It is my fault to not clearly say our program logic error!  

    The problem is that our lcd can not display. Since the C++ lib is our UI display module, if the problem occored, the lcd can not display.


Thanks!
Best regards, 
Operagui


发件人:"桂永林"<guiyonglin@huaqin.com>
发送时间:2021-10-22 11:37
主题:Re: Re: Re: GCC link problem help!
收件人:"Jonathan Wakely"<jwakely.gcc@gmail.com>,"Xi Ruoyao"<xry111@mengyan1223.wang>
抄送:"LIU Hao"<lh_mouse@126.com>,"Tom Kacvinsky"<tkacvins@gmail.com>,"gcc-help"<gcc-help@gcc.gnu.org>,"柳茂昕/图灵研究院软件三部/图灵研究院"<liumaoxin@huaqin.com>,"李闯闯/图灵研究院软件三部/图灵研究院"<lichuangchuang@huaqin.com>,"汤汝/图灵研究院软件三部/图灵研究院"<tangru@huaqin.com>
 
Hello Jonathan Wakely,

   Tanks for your explain about these parameter use! Now, we adjusted our paramter noly to use -lstdc++, and we use G++ to link our program. But our program still can  not work well, it sames that related with our program size. If we add any code to our project, it can cause the problem again.
   




发件人:Jonathan Wakely <jwakely.gcc@gmail.com>
发送时间:2021-10-21 20:34
主题:Re: Re: GCC link problem help!
收件人:"Xi Ruoyao"<xry111@mengyan1223.wang>
抄送:"桂永林/图灵研究院软件三部/图灵研究院"<guiyonglin@huaqin.com>,"LIU Hao"<lh_mouse@126.com>,"Tom Kacvinsky"<tkacvins@gmail.com>,"gcc-help"<gcc-help@gcc.gnu.org>,"柳茂昕/图灵研究院软件三部/图灵研究院"<liumaoxin@huaqin.com>,"李闯闯/图灵研究院软件三部/图灵研究院"<lichuangchuang@huaqin.com>,"汤汝/图灵研究院软件三部/图灵研究院"<tangru@huaqin.com>
 
On Thu, 21 Oct 2021 at 13:06, Xi Ruoyao via Gcc-help 
<gcc-help@gcc.gnu.org> wrote: 
> 
> On Thu, 2021-10-21 at 11:36 +0800, 桂永林 wrote: 
> > If there is some special parameter we need check, when we link the c++ 
> > lib to C program with C linker? 
> 
> -lstdc++ is enough as you've already disabled exception and rtti. If 
> exception or rtti is used, -lsupc++ is also needed. 
 
No, everything in libsupc++ is also included in libstdc++ so you do 
not need both. 
 
libsupc++ is for when you *only* want the language support, not the 
library utilities like iostreams, std::string, std::list etc. 
 
But libsupc++ is not just for exceptions and RTTI, it's also new and 
delete, and initialization of local static variables. So if you 
haven't used -lstdc++ then you need -lsupc++ to be able to use those 
basic features. If you have used -lstdc++, you don't need -lsupc++ for 
anything. 
 
If you simply use g++ to link instead of gcc then you get -lstdc++ 
automatically. That's the recommended way to link a program that has 
C++ components. 
 
Since you've only told us that "the program have runtime logic problem 
sometimes" nobody can really help you. That's too vague for us to know 
what the problem is. 

  parent reply	other threads:[~2021-10-22  3:39 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-10-11  3:23 GCC link error help! 桂永林
2021-10-11  5:10 ` Tom Kacvinsky
2021-10-11  6:43   ` LIU Hao
2021-10-11  7:57     ` 桂永林
2021-10-20 14:53     ` GCC link problem help! 桂永林
2021-10-20 16:17       ` Xi Ruoyao
2021-10-21  3:36         ` 桂永林
2021-10-21 12:04           ` Xi Ruoyao
2021-10-21 12:34             ` Jonathan Wakely
2021-10-22  3:37               ` 桂永林
     [not found]               ` <617231DF.3080808@huaqin.com>
2021-10-22  3:39                 ` 桂永林 [this message]
2021-10-22  7:06                   ` Jonathan Wakely

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=30402992.292f2.17ca61533e4.Coremail.guiyonglin@huaqin.com \
    --to=guiyonglin@huaqin.com \
    --cc=gcc-help@gcc.gnu.org \
    --cc=jwakely.gcc@gmail.com \
    --cc=lh_mouse@126.com \
    --cc=lichuangchuang@huaqin.com \
    --cc=liumaoxin@huaqin.com \
    --cc=tangru@huaqin.com \
    --cc=tkacvins@gmail.com \
    --cc=xry111@mengyan1223.wang \
    /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
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).