public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "r.menges at nice2cu dot de" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug c++/45880] Template-Methode in Shared Object not resolved when compiled with -O2
Date: Mon, 04 Oct 2010 16:14:00 -0000	[thread overview]
Message-ID: <20101004161400.Q61D7NJp0esT-YQpbZeH7hCg7B_Hd2GH8ZYTjqE9JFM@z> (raw)
In-Reply-To: <bug-45880-4@http.gcc.gnu.org/bugzilla/>

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45880

--- Comment #4 from r.menges at nice2cu dot de 2010-10-04 16:14:34 UTC ---
(In reply to comment #3)
> Please also show the error you're getting, as "crashes the application because
> of a symbol-not-defined-error" is not very helpful
> 
> I don't think this has anything to do with using a template function, I think
> you've just built it wrong

Actually i didn't write the makefile myself, it was generated by netbeans
(6.7.).
I am sorry, i was inexact about the error message: The symbol-not-defined
is the error i see when using the original-code, which is executed in an apache
context. The example simply crashes with an segfault.

But you are right, the option -share is what caused the segfault in this
example.
After i removed the -shared option manually from the generated makefile, the
example crashes no more.

The "real" applications runs as an extension to php5 in the context of apache,
it's an libary for c++-php-bridge we builded (so that c++-objects can be mapped
into the space of php). This is where undefined symbol errors crashes the
httpd-process with an error of undefined symbol, when using 

template<typename MsgType> void printMessage(MsgType msg);
void printMessage(const char *);

it misses the implemetation for std::string.


  parent reply	other threads:[~2010-10-04 16:14 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-10-04 13:59 [Bug c++/45880] New: " r.menges at nice2cu dot de
2010-10-04 14:22 ` [Bug c++/45880] " redi at gcc dot gnu.org
2010-10-04 14:49 ` redi at gcc dot gnu.org
2010-10-04 16:14 ` r.menges at nice2cu dot de [this message]
2010-10-04 16:34 ` redi at gcc dot gnu.org
2011-09-25 15:59 ` paolo.carlini at oracle dot com

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=20101004161400.Q61D7NJp0esT-YQpbZeH7hCg7B_Hd2GH8ZYTjqE9JFM@z \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.org \
    /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).