#1 Cannot build with gcc4.3

open
nobody
None
5
2008-10-27
2008-10-27
No

When builing with gcc4.3, i get the following errors:

g++ -c -pipe -Wall -W -pipe -Wall -Os -march=i586 -mtune=i686 -DGLX_GLXEXT_LEGACY -D_REENTRANT -DQT_NO_DEBUG -DQT_THREAD_SUPPORT -I/usr/lib/qt3/mkspecs/default -I. -I. -I/usr/lib/qt3//include -o sharescanner.o ../sharescanner/sharescanner.cpp
../sharescanner/sharescanner.cpp: In function 'FILE* popen2(pid_t*, const char*, const char*)':
../sharescanner/sharescanner.cpp:177: error: 'exit' was not declared in this scope
make: Leaving directory `/usr/src/RPM/BUILD/Linscope/linscope'

This patch solves the problem:

diff --git a/Linscope/sharescanner/sharescanner.h b/Linscope/sharescanner/sharescanner.h
index 8587eaf..e7b5ee0 100644
--- a/Linscope/sharescanner/sharescanner.h
+++ b/Linscope/sharescanner/sharescanner.h
@@ -30,6 +30,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#include <iostream>

#include <stdio.h>
+#include <cstdlib>
#include <unistd.h>
#include <sys/types.h>
#include <signal.h>

Discussion