Page 2 of 4
Posted: Tue Apr 14, 2009 10:53 pm
by Arctic Fox
I must admit that I am not a C expert

The compiler keeps saying
no include path in which to search for ... followed by files like
stdio.h and
math.h
What am I doing wrong?
Posted: Tue Apr 14, 2009 10:59 pm
by jack
what compiler are you using?
Posted: Tue Apr 14, 2009 11:01 pm
by Arctic Fox
The MinGW/GCC compiler
Posted: Tue Apr 14, 2009 11:30 pm
by jack
1: did you install at the default location namely C:\MinGW ?
2: did you run the batch file MKALLMGW.BAT ?
right-click on My Computer/properties
click on Advanced then click Environment Variables
on the system variables pane click New
on the variable name put: LIBRARY_PATH
on the variable value put: C:\MinGW\lib
also on same pane edit the variable Path and add
;C:\MinGW\bin
after you finish log off then log back in
try compiling again
Posted: Thu Apr 16, 2009 2:33 pm
by Arctic Fox
Now it works

Thanks a quintillion times
jack - it does handle big numbers, right?

Your help is very appreciated
By the way the debugger says that
the specified '*MemoryID' is not valid at line 133
Do you know why?
Posted: Fri Apr 17, 2009 1:02 am
by jack
I am glad you were able to make it work, when you try something new it's a bit disconcerting, in answer to your question, yes it handles big numbers,
though for some operations like divide you must specify to how many places you want the resulting operation.
Posted: Fri Apr 17, 2009 1:07 am
by jack
Arctic Fox, the PB debugger does not work under this circumstances, at least it did not last I checked.
Posted: Fri Apr 17, 2009 8:06 pm
by Arctic Fox
jack wrote:Arctic Fox, the PB debugger does not work under this circumstances, at least it did not last I checked.
OK, thanks for the information. I am just curious to know what's wrong, as it crashes every time I run it. And when commenting out that line, it does not

Posted: Sat Apr 18, 2009 12:28 am
by jack
if you turn off the debugger it works OK, I think ( only guessing ) the reason that PB crashes when debugger is on is because the memory was not allocated using native PB Commands.
Posted: Sat Apr 18, 2009 2:05 am
by Arctic Fox
It still crashes here, regardless whether the debugger is on or off

And by the way
m_apm_free_all_mem() raises a POLINK error when compiling (if used outside the ImportC).
Perhaps my library compilation doesn't work as it should

Would you mind comparing your lib file with mine (by file size)? My lib is 111.430 bytes.
Posted: Sat Apr 18, 2009 2:54 am
by jack
Arctic Fox, you must include the import section, if your code is to use the mapm functions, it tell PB and Polink what functions to link into your program.
are you sure the debugger is off? is the spider/bug icon highlighted or not? if highlighted then debug is on.
btw the size of my lib is 110,592 bytes
Posted: Sat Apr 18, 2009 3:10 am
by Arctic Fox
The debugger is off, yes. No highlighted bug button in the toolbar, and no check mark in the menu or in Enable Debugger in Compiler Options.
btw are you using the libc.lib file? I've included it in M_APM.h as you adviced (the two lines were to be added at the end of the file, weren't they?)
Posted: Sat Apr 18, 2009 3:32 am
by jack
Arctic Fox, sorry I misled you, if you compile with Mingw32 there's no need to add anything M_APM.h.
if you are using Mingw32, all you need to do is run MKALLMGW.BAT and rename libmapm.a to libmapm.lib or mapm.lib and copy that to the PureBasic\PureLibraries\Windows\Libraries folder making sure you use the same name in the import section.
Posted: Sat Apr 18, 2009 3:55 pm
by Arctic Fox
jack wrote:Arctic Fox, sorry I misled you, if you compile with Mingw32 there's no need to add anything M_APM.h.
That's okay mate, if it wasn't for you I hadn't got so far in this, thanks again

I recompiled the library without those two lines in M_APM.h, resulting in a library as big as yours. But your example still crashes at FreeMemory() with and without the debugger on

Posted: Sat Apr 18, 2009 4:43 pm
by netmaestro
I don't think you can use FreeMemory on anything that isn't a memory block you previously allocated with PureBasic. Do the library docs say that you need to free the memory?