PS this is not the problem:
#define PBINT extern int _stdcall
#define PBLONG extern long32 _stdcall
#define PBSTRING extern char _stdcall *
#define PBFLOAT extern float _stdcall
I had to reverse the order of "extern value" and "_stdcall" with the LccWin example for Pelles C to handle it as well.  Under Lcc it is apparently: "extern _stdcall int".
I think I need more sleep.  :roll:
			
			
									
									
						LibraryMaker Desc file.
- 
				Hatonastick
 - Enthusiast

 - Posts: 149
 - Joined: Wed Apr 27, 2005 11:50 am
 - Location: Adelaide, Australia
 - Contact:
 
- 
				Hatonastick
 - Enthusiast

 - Posts: 149
 - Joined: Wed Apr 27, 2005 11:50 am
 - Location: Adelaide, Australia
 - Contact:
 
The PureCrypt.Desc file:
The purebasic test program:
I've officially run out of ideas.  
			
			
									
									
						Code: Select all
;
; Langage used to code the library: ASM or C
C
;
; Number of windows DLLs our library needs.
; This is used to tell the PureBasic compiler /
; linker which libraries are needed to link with.
1
crtmt 
;
; Library type (Can be OBJ or LIB).
LIB
;
; Number of PureBasic libraries needed by your library.
; (additional PureBasic libraries that are needed for linking).
0
;
; Help directory name.
Extension1
;
; Library functions (FunctionName, Arg1, Arg2, ...);
; First the function name. Its the name of the C function
; that should be exported to PB, without the "PB_" Prefix
; used in C. After function name a comma and a list of
; arguments seperated by comma aswell. in parentheses
; a argument description that is showed by the PureBasic IDE
; as quick help. After the parentheses a general description
; can follow.
;
; Translation table for some arguments:
; ANSI C         | PureBasic
; --------------------------
; int *          |  Long
; byte *         |  Long
; int  (32 bits) |  Long
; char *         |  Long / String
; long (32 bits) |  Long
; float          |  Float
; double         |    -  (must be casted to float in C for now)
; char           |  Byte
; void           |  None
; short(16 bits) |  Word
;
; Return value:
; Type of return value and flags for:
; 'InitFunction' (a function which is called automatically
; at the start of a PureBasic program),
; 'EndFunction' (called at the end, for cleaning)
; and 'DebuggerCheck' (a debugger handler function for this command.)
;Long | DebuggerCheck
SHA1Hash, Long, Long, Long ([in] *buffer, [in] length, [out] *result) - Returns 20 byte hash.
Long | DebuggerCheckCode: Select all
; Attempt to use SHA1Hash.
InBuffer$  = "foo"
Length     = Len(InBuffer$)
OutBuffer$ = Space(21)
Debug SHA1Hash(@InBuffer$, Length, @OutBuffer$)
Debug OutBuffer$Ok, no more unresolved external symbols here.
It's "crtmt2" you need, not "crtmt". I guessed wrong there.
You'll still get some fun when you turn off PB's debugger because you wrote:
These aren't defined without the debugger.
Better split the _DEBUG functions into their own .obj.
(Smaller size and less hassle).
Have fun!
			
			
									
									It's "crtmt2" you need, not "crtmt". I guessed wrong there.
You'll still get some fun when you turn off PB's debugger because you wrote:
Code: Select all
extern char *PB_DEBUGGER_ErrorDescription;
extern HWND    PB_DEBUGGER_Window;
extern int    PB_DEBUGGER_Control;
Better split the _DEBUG functions into their own .obj.
(Smaller size and less hassle).
Have fun!
Good programmers don't comment their code. It was hard to write, should be hard to read.
						- 
				Hatonastick
 - Enthusiast

 - Posts: 149
 - Joined: Wed Apr 27, 2005 11:50 am
 - Location: Adelaide, Australia
 - Contact:
 
Ok it didn't work, then it worked.  I suspect rather strongly some sort of minor bug with Pelles C: I changed a number of options, compiled, failed, changed them all back, recompiled and it worked.  Almost as if the object files weren't being updated properly. 
Anyway I thank you all for your help! You've help prevent my being interned within a Mental Asylum.
  It works. 
However I have one last request: I still need advice/help on the best way to use PB_memoryBase to pass data from my library functions to PureBASIC. A small example in C on how to do this would be greatly appreciated. Once I have that worked out, I should be pretty much ok.
			
			
													Anyway I thank you all for your help! You've help prevent my being interned within a Mental Asylum.
However I have one last request: I still need advice/help on the best way to use PB_memoryBase to pass data from my library functions to PureBASIC. A small example in C on how to do this would be greatly appreciated. Once I have that worked out, I should be pretty much ok.
					Last edited by Hatonastick on Fri May 20, 2005 9:17 am, edited 1 time in total.
									
			
									
						- 
				Hatonastick
 - Enthusiast

 - Posts: 149
 - Joined: Wed Apr 27, 2005 11:50 am
 - Location: Adelaide, Australia
 - Contact:
 
- DoubleDutch
 - Addict

 - Posts: 3220
 - Joined: Thu Aug 07, 2003 7:01 pm
 - Location: United Kingdom
 - Contact:
 
Any news on this lib?
			
			
									
									https://deluxepixel.com <- My Business website
https://reportcomplete.com <- School end of term reports system
						https://reportcomplete.com <- School end of term reports system
