[opensuse-packaging] Conflicting C and C++ declarations?
What should I do? [ 49s] ./main.h:38:15: error: previous declaration of 'char** environ' with 'C++' linkage [ 49s] In file included from util.cpp:45:0: [ 49s] /usr/include/unistd.h:546:15: error: conflicts with new declaration with 'C' linkage https://build.opensuse.org/package/rawlog?arch=x86_64&package=xxdiff&project=home%3AAnsus%3Abranches%3AX11%3AUtilities&repository=openSUSE_12.2 -- To unsubscribe, e-mail: opensuse-packaging+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-packaging+owner@opensuse.org
On 09/15/2012 02:08 PM, Ilya Chernykh wrote:
What should I do?
[ 49s] ./main.h:38:15: error: previous declaration of 'char** environ' with 'C++' linkage [ 49s] In file included from util.cpp:45:0: [ 49s] /usr/include/unistd.h:546:15: error: conflicts with new declaration with 'C' linkage
Remove the declaration in main.h and use the one coming from the C Library. char **environ is part of the C Library and should have C linkage, not C++. This is a bug in main.h, Andreas -- Andreas Jaeger aj@{suse.com,opensuse.org} Twitter/Identica: jaegerandi SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 Nürnberg, Germany GF: Jeff Hawn,Jennifer Guild,Felix Imendörffer,HRB16746 (AG Nürnberg) GPG fingerprint = 93A3 365E CE47 B889 DF7F FED1 389A 563C C272 A126 -- To unsubscribe, e-mail: opensuse-packaging+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-packaging+owner@opensuse.org
El 15/09/12 09:08, Ilya Chernykh escribió:
What should I do?
[ 49s] ./main.h:38:15: error: previous declaration of 'char** environ' with 'C++' linkage [ 49s] In file included from util.cpp:45:0: [ 49s] /usr/include/unistd.h:546:15: error: conflicts with new declaration with 'C' linkage
GNU_SOURCE is defined and your code is declaring "environ" improperly, remove declaration in main.h:38.. your program has a bug and is likely to do weird things even when build does not fail. -- To unsubscribe, e-mail: opensuse-packaging+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-packaging+owner@opensuse.org
participants (3)
-
Andreas Jaeger
-
Cristian Rodríguez
-
Ilya Chernykh