From owner-freebsd-hackers Thu May 16 18: 3:39 2002 Delivered-To: freebsd-hackers@freebsd.org Received: from csun.edu (email.csun.edu [130.166.1.51]) by hub.freebsd.org (Postfix) with ESMTP id A8F4037B403 for ; Thu, 16 May 2002 18:03:32 -0700 (PDT) Received: from csun.edu (s097n152.csun.edu [130.166.97.152]) by csun.edu (8.9.3 (MessagingDirect 1.0.4)/8.9.3) with ESMTP id SAA3618441; Thu, 16 May 2002 18:03:24 -0700 (PDT) Message-ID: <3CE456DA.8010200@csun.edu> Date: Thu, 16 May 2002 18:03:22 -0700 From: Albert Kinderman User-Agent: Mozilla/5.0 (X11; U; Linux i386; en-US; rv:0.9.4.1) Gecko/20020314 Netscape6/6.2.2 X-Accept-Language: en-us MIME-Version: 1.0 To: freebsd-hackers@freebsd.org Subject: c++ and dlerror(): Linux vs FreeBSD Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG Disclaimer: I am not a programmer! I am trying to compile scribus-0.7.2, a Page Layout program, built against qt3. /usr/ports/print/scribus contains scribus-0.5, which is the qt2 version. On my Debian GNU/Linux, make works without a hitch. On my FreeBSD stable box, I get a series of errors of the following type: scribus.cpp:4217: assignment to `char *' from `const char *' discards qualifiers scribus.cpp: In method `int ScribusApp::DLLType(QString)': scribus.cpp:4240: assignment to `char *' from `const char *' discards qualifiers *** Error code 1 Stop in /usr/local/scribus-0.7.2/scribus These errors come from code similar to code that is given as an example of how to handle exceptions in the Linux man page for dlerror, /usr/compat/linux/man/man3/dlopen.3 Specifically, the last error was produced by int ScribusApp::DLLType(QString name) { void *mo; char *error; typedef int (*sdem0)(); sdem0 demo; QString pfad = PREL; pfad += "/share/scribus/plugins/" + name; mo = dlopen(pfad, RTLD_LAZY); if (!mo) return 0; dlerror(); demo = (sdem0)dlsym(mo, "Type"); if ((error = dlerror()) != NULL) <-- line 4240 { dlclose(mo); return 0; } int an = (*demo)(); dlclose(mo); return an; } Both the FreeBSD and the Linux man pages list const char *dlerror(void) Why does c++ on FreeBSD produce an error on error = dlerror() and c++ on Debian Linux does not? What is the proper fix? Al -- Albert Kinderman California State University, Northridge Department of Systems and Operations Management To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message