adch++ win32 release build

Problems compiling? Don't understand the source code? Don't know how to code your feature? Post here.

Moderator: Moderators

Locked
shufty
Posts: 11
Joined: 2004-01-30 03:08

adch++ win32 release build

Post by shufty » 2006-08-16 09:55

Code: Select all

Error	12	error C2039: 'cs' : is not a member of 'adchpp::FastAllocBase'	c:\Builds\adch\trunk\adchpp\Util.cpp	38
Error	13	error C2146: syntax error : missing ';' before identifier 'cs'	c:\Builds\adch\trunk\adchpp\Util.cpp	38
Error	14	error C4430: missing type specifier - int assumed. Note: C++ does not support default-int	c:\Builds\adch\trunk\adchpp\Util.cpp	38
Error	15	error C4430: missing type specifier - int assumed. Note: C++ does not support default-int	c:\Builds\adch\trunk\adchpp\Util.cpp	38
Error	27	error C2065: '__pfnDliFailureHook2' : undeclared identifier	c:\Builds\adch\trunk\windows\adchppdw.cpp	58
Error	28	error C2065: 'FailHook' : undeclared identifier	c:\Builds\adch\trunk\windows\adchppdw.cpp	58
which are

Util.cpp

Code: Select all

37 #ifndef _DEBUG
38 FastCriticalSection FastAllocBase::cs;
39 #endif
adchppdw.cpp

Code: Select all

57 #elif _MSC_VER == 1300 || _MSC_VER == 1310 || _MSC_VER == 1400
58 	__pfnDliFailureHook2 = FailHook;
59 #else

Pothead
Posts: 223
Joined: 2005-01-15 06:55

Post by Pothead » 2006-08-16 10:21

Patch to fix the errors

Code: Select all

Index: adchpp/Util.cpp
===================================================================
--- adchpp/Util.cpp	(revision 20)
+++ adchpp/Util.cpp	(working copy)
@@ -35,7 +35,7 @@
 namespace adchpp {
 	
 #ifndef _DEBUG
-FastCriticalSection FastAllocBase::cs;
+FastMutex FastAllocBase::mtx;
 #endif
 
 #ifndef _WIN32
Index: plugins/Script/examples/access.lua
===================================================================
--- plugins/Script/examples/access.lua	(revision 20)
+++ plugins/Script/examples/access.lua	(working copy)
@@ -380,7 +380,7 @@
 			return adchpp.ClientManager.DONT_SEND
 		end
 		
-		register_client(c, parameters, 1)
+		register_user(c, c:getField("NI"), parameters, 1)
 				
 		reply(c, "You're now registered")
 		return adchpp.ClientManager.DONT_SEND
Index: windows/adchppdw.cpp
===================================================================
--- windows/adchppdw.cpp	(revision 20)
+++ windows/adchppdw.cpp	(working copy)
@@ -23,6 +23,7 @@
 #include <adchpp>
 #include <adchpp>
 
+#include <delayimp>
 
 using namespace adchpp;
 
@@ -44,6 +45,12 @@
 
 #define LIT(s) s, sizeof(s)-1
 
+#ifndef _DEBUG
+FARPROC WINAPI FailHook(unsigned /* dliNotify */, PDelayLoadInfo  /* pdli */) {
+	exit(-1);
+}
+#endif
+
 LONG __stdcall DCUnhandledExceptionFilter( LPEXCEPTION_POINTERS e )
 {
 	RecursiveMutex::Lock l(cs);
Thanks Gabberworld. :)

shufty
Posts: 11
Joined: 2004-01-30 03:08

Post by shufty » 2006-08-16 10:40

I shouldn't get too enthusiastic.

Code: Select all

Error	12	fatal error C1083: Cannot open include file: 'delayimp': No such file or directory	c:\Builds\adch\trunk\windows\adchppdw.cpp	25
it IS in "C:\Program Files\Microsoft Visual Studio 8\VC\include"
which is in PATH. adding location to include made no difference.
changing the include to <delayimp> spat out 37 unresolved external symbol errors.
googled the file and tried and alternative, probably an old version seen as how it bitched about "__pfnDliFailureHook2"
any more ideas?

edit:
adding delayimp.lib to the linker > input > additional depenencies seems to have worked. missed that i only had "ws2_32.lib Mswsock.lib" in the debug configuration. seem to be the only one with this problem but i hope it helps.

Gabberworld
Posts: 9
Joined: 2004-11-02 12:42

Post by Gabberworld » 2006-09-26 10:32

#include <delayimp>

it should be ended with .h

dunno what are wrong with this forum

Locked