Fixes for compiling with g++ 4.3.2

Hilko Bengen bengen@hidden
Thu Dec 11 09:46:31 CET 2008


Hi,

when trying to get ring3k from git to compile on an i386
Debian/unstable box, I got the following error:

,----
| g++ -m32 -rdynamic -o ntl ptrace_if.o atom.o block.o completion.o debug.o driver.o event.o fiber.o file.o job.o kthread.o mailslot.o mem.o mutant.o namedpipe.o ntcall.o ntgdi.o ntl.o ntuser.o objdir.o object.o platform.o port.o profile.o process.o ptrace_base.o random.o reg.o section.o semaphore.o skas.o symlink.o syscall.o thread.o timer.o token.o tt.o unicode.o -lxml2 -lSDL -lstdc++ ../libudis86/libudis86.a
| ntuser.o: In function `NtUserProcessConnect(void*, void*, unsigned long)':
| ntuser.cpp:(.text+0x1db8): undefined reference to `long object_from_handle<process_t>(process_t*&, void*, unsigned long)'
| collect2: ld returned 1 exit status
| make[1]: *** [ntl] Error 1
| make[1]: Leaving directory `/home/hbengen/tmp/ring3k/loader'
| make: *** [loader_dir] Error 2
`----

I tried a few things without havnig much of a clue what I was doing.

First I went to compile loader/ using older g++ versions. A patch for
declaring CXX in the configure script is included below. (g++ 4.2
turned out to compile the code just fine.)

Finally, I figured out that apparently all to get g++ 4.3 to compile
the userspace loader was adding

    #include "object.inl"

to loader/ntuser.cpp

Cheers,
-Hilko

diff --git a/configure.ac b/configure.ac
index f890212..ffee715 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1,6 +1,8 @@
 
 AC_INIT(ring3k,0.0.14)
 
+AC_PROG_CC
+AC_PROG_CXX
 AC_CONFIG_HEADERS([include/config.h])
 AC_CHECK_HEADERS([asm/ptrace.h])
 AC_CHECK_HEADERS([valgrind/valgrind.h])
diff --git a/loader/Makefile.in b/loader/Makefile.in
index 26399f9..d631e58 100644
--- a/loader/Makefile.in
+++ b/loader/Makefile.in
@@ -26,6 +26,7 @@ LIBS=-lxml2 -lSDL -lstdc++ ../libudis86/libudis86.a
 LDFLAGS=-m32 -rdynamic
 
 CC = @CC@
+CXX = @CXX@
 
 HEADERS = \
 	debug.h \


More information about the ring3k mailing list