[fpc-pascal] FPC trunk r224549 needs more incantations?

2013-05-22 Thread Reinier Olislagers
r24549 | joost | 2013-05-21 21:58:14 +0200 (di, 21 mei 2013) | 1 line

 * Removed unused unit jarparamparser.pas

Perhaps some (fp(c))make regeneration or something?

Building it I see:
make.exe[3]: Leaving directory `C:/development/fpctrunk/utils/fpcres'
make.exe[3]: *** No rule to make target `jarparamparser.pas', needed by
`fpcjres
.exe'.  Stop.
make.exe[2]: *** [fpcres_all] Error 2
make.exe[2]: Leaving directory `C:/development/fpctrunk/utils'

Thanks,
Reinier
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] FPC trunk r224549 needs more incantations?

2013-05-22 Thread Vincent Snijders
2013/5/22 Reinier Olislagers reinierolislag...@gmail.com

 r24549 | joost | 2013-05-21 21:58:14 +0200 (di, 21 mei 2013) | 1 line

  * Removed unused unit jarparamparser.pas

 Perhaps some (fp(c))make regeneration or something?

 Building it I see:
 make.exe[3]: Leaving directory `C:/development/fpctrunk/utils/fpcres'
 make.exe[3]: *** No rule to make target `jarparamparser.pas', needed by
 `fpcjres
 .exe'.  Stop.
 make.exe[2]: *** [fpcres_all] Error 2
 make.exe[2]: Leaving directory `C:/development/fpctrunk/utils'

See also:
https://fpcbuildserver.firmos.at/job/buildfpc_branch/850/platform=i386-linux/console

Vincent
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal

[fpc-pascal] Re: FPC trunk r224549 needs more incantations?

2013-05-22 Thread Reinier Olislagers
On 22-5-2013 8:38, Vincent Snijders wrote:
 2013/5/22 Reinier Olislagers
 See also:
 https://fpcbuildserver.firmos.at/job/buildfpc_branch/850/platform=i386-linux/console

Nice - a Jenkins[1] build server ;)... especially if you can send
threatening emails to a dev if he breaks the build ;)

[1] See also
http://wiki.lazarus.freepascal.org/Jenkins
for a different setup
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


[fpc-pascal] Android JNI failing in Galaxy S4

2013-05-22 Thread Felipe Monteiro de Carvalho
Hello,

I know that some other people here are developing Android JNI apps.

For me it has worked perfectly so far, but as we just got a Galaxy S4
in the office I thought of testing my app there and boom =( It crashes
at the startup:

I/True Democracy( 8624): Trying to load libtruedemocracy.so
D/dalvikvm( 8624): Trying to load lib
/data/app-lib/com.felipe.truedemocracy-1/libtruedemocracy.so
0x421fadc8
W/libc( 8624): WARNING: generic atexit() called from legacy shared library
D/dalvikvm( 8624): Added shared lib
/data/app-lib/com.felipe.truedemocracy-1/libtruedemocracy.so
0x421fadc8
I/truedemocracy( 8624): JNI_OnLoad called
I/truedemocracy( 8624): Reading our Activity Class
E/dalvikvm( 8624): ERROR: couldn't find native method
E/dalvikvm( 8624): Requested:
Lcom/felipe/truedemocracy/TrueDemocracy;.GetHistoricalInflationCount:()I
F/truedemocracy( 8624): javaEnvRef^.RegisterNatives failed
I/truedemocracy( 8624): JNI_OnLoad finished
D/qdmemalloc(  217): ion: unmap_buffer base:0x0 size:8355840 offset:0 fd:49
D/qdmemalloc(  217): ion: unmap_buffer base:0x0 size:4096 offset:0 fd:78
D/qdmemalloc(  217): ion: unmap_buffer base:0x0 size:8355840 offset:0 fd:66
D/qdmemalloc(  217): ion: unmap_buffer base:0x0 size:4096 offset:0 fd:67
W/dalvikvm( 8624): No implementation found for native
Lcom/felipe/truedemocracy/TrueDemocracy;.Translations_TranslateToISO639_2_Code:(Ljava/lang/String;Ljava/lang/String;)V
D/AndroidRuntime( 8624): Shutting down VM
W/dalvikvm( 8624): threadid=1: thread exiting with uncaught exception
(group=0x410b8ac8)
D/Sensorhubs(  228): readContextData: 1, 1, 14, 1
D/SensorHubManager(  724): onGetSensorHubDataLocked: library = 1, 1, 14, 1
D/CAE (  724): onGetSensorHubData(SensorHubParserProvider.java:66)
- onGetSensorHubData Event [event buffer len :4]
I/CAE (  724): parse(SensorHubParserProvider.java:129) - buffer size = 4
I/CAE (  724): parse(SensorHubParserProvider.java:140) - 1, 1, 14, 1,
D/qdoverlay(  217): Unset pipe=VG0 dpy=0; Unset pipe=VG1 dpy=0; Unset
pipe=RGB1 dpy=0;
D/CAE (  724): display(ContextProvider.java:430) -
= FLIP_COVER_ACTION =
V/WindowManager(  724): Window{42b3a138 u0
Keyguard}mOrientationRequetedFromKeyguard=false
E/AndroidRuntime( 8624): FATAL EXCEPTION: main
E/AndroidRuntime( 8624): java.lang.UnsatisfiedLinkError: Native method
not found: 
com.felipe.truedemocracy.TrueDemocracy.Translations_TranslateToISO639_2_Code:(Ljava/lang/String;Ljava/lang/String;)V
E/AndroidRuntime( 8624):at
com.felipe.truedemocracy.TrueDemocracy.Translations_TranslateToISO639_2_Code(Native
Method)
E/AndroidRuntime( 8624):at
com.felipe.truedemocracy.TrueDemocracy.onCreate(TrueDemocracy.java:632)
E/AndroidRuntime( 8624):at
android.app.Activity.performCreate(Activity.java:5250)
E/AndroidRuntime( 8624):at
android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1097)
E/AndroidRuntime( 8624):at
android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2210)
E/AndroidRuntime( 8624):at
android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2296)
E/AndroidRuntime( 8624):at
android.app.ActivityThread.access$700(ActivityThread.java:151)
E/AndroidRuntime( 8624):at
android.app.ActivityThread$H.handleMessage(ActivityThread.java:1281)
E/AndroidRuntime( 8624):at
android.os.Handler.dispatchMessage(Handler.java:99)
E/AndroidRuntime( 8624):at android.os.Looper.loop(Looper.java:137)
E/AndroidRuntime( 8624):at
android.app.ActivityThread.main(ActivityThread.java:5293)
E/AndroidRuntime( 8624):at
java.lang.reflect.Method.invokeNative(Native Method)
E/AndroidRuntime( 8624):at
java.lang.reflect.Method.invoke(Method.java:511)
E/AndroidRuntime( 8624):at
com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1102)
E/AndroidRuntime( 8624):at
com.android.internal.os.ZygoteInit.main(ZygoteInit.java:869)
E/AndroidRuntime( 8624):at dalvik.system.NativeStart.main(Native Method)

Any ideas?

I am not doing anything unusual, and exact same APK works fine in HTC
Wildfire, Xperia Mini, Galaxy Nexus, etc, etc.

=(

it runs JNI_onCreate to the end, so at least code is being executed.

The routine that it complains about is declared correctly:

procedure 
Java_com_felipe_truedemocracy_TrueDemocracy_Translations_TranslateToISO639_2_Code(
  env:PJNIEnv; this:jobject; AISOCode, ACountry: jstring); cdecl;

And is correct in the structure:

   (name:'Translations_TranslateToISO639_2_Code';
signature:'(Ljava/lang/String;Ljava/lang/String;)V';

fnPtr:@Java_com_felipe_truedemocracy_TrueDemocracy_Translations_TranslateToISO639_2_Code;),

And is correct in RegisterNative:

  // Register Pascal exported calls
  if javaEnvRef^^.RegisterNatives(javaEnvRef, javaActivityClass,
@NativeMethods[0],length(NativeMethods))0 then
  begin
__android_log_write(ANDROID_LOG_FATAL, 'truedemocracy',
'javaEnvRef^.RegisterNatives 

[fpc-pascal] Re: Android JNI failing in Galaxy S4

2013-05-22 Thread Felipe Monteiro de Carvalho
On Tue, May 21, 2013 at 5:47 PM, Felipe Monteiro de Carvalho
felipemonteiro.carva...@gmail.com wrote:
 My only idea at the moment is to do the static export too... maybe
 that will work, lets see.

No, that didn't help anything =(

-- 
Felipe Monteiro de Carvalho
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


[fpc-pascal] Re: Android JNI failing in Galaxy S4

2013-05-22 Thread Felipe Monteiro de Carvalho
Oh, forget it. Someone answered in android-ndk group: I had a typo in
another JNI routine which caused the problem.

It seams that the new Android checks all JNI routines at startup.
Older ones checked the routines only when they were utilized, so would
only crash when it was utilized.

-- 
Felipe Monteiro de Carvalho
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] Re: Android JNI failing in Galaxy S4

2013-05-22 Thread Sven Barth

Am 21.05.2013 20:52, schrieb Felipe Monteiro de Carvalho:

Oh, forget it. Someone answered in android-ndk group: I had a typo in
another JNI routine which caused the problem.

It seams that the new Android checks all JNI routines at startup.
Older ones checked the routines only when they were utilized, so would
only crash when it was utilized.


Now one can argue which variant of the two is the better...

Regards,
Sven
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] FPC trunk r224549 needs more incantations?

2013-05-22 Thread Sven Barth

Am 22.05.2013 08:06, schrieb Reinier Olislagers:

r24549 | joost | 2013-05-21 21:58:14 +0200 (di, 21 mei 2013) | 1 line

  * Removed unused unit jarparamparser.pas

Perhaps some (fp(c))make regeneration or something?

Building it I see:
make.exe[3]: Leaving directory `C:/development/fpctrunk/utils/fpcres'
make.exe[3]: *** No rule to make target `jarparamparser.pas', needed by
`fpcjres
.exe'.  Stop.
make.exe[2]: *** [fpcres_all] Error 2
make.exe[2]: Leaving directory `C:/development/fpctrunk/utils'



Fixed in 24550.

Regards,
Sven
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] Re: Android JNI failing in Galaxy S4

2013-05-22 Thread m...@rpzdesign.com

Are you saying that you are writing JNI routines in Pascal for android?

If so, can you post some of the things like the pascal header files you 
use to allow for the creation of the .so files

so that Java can call into pascal across the JNI interface.

I have 2 projects that I need Pascal talking across the JNI interface.  
1 for Mac OSX where I need pascal to call a JNI library

and another Android where I need Java to call freepascal library (NDK)

Thanks for any information you can share,

md


On 5/21/2013 12:52 PM, Felipe Monteiro de Carvalho wrote:

Oh, forget it. Someone answered in android-ndk group: I had a typo in
another JNI routine which caused the problem.

It seams that the new Android checks all JNI routines at startup.
Older ones checked the routines only when they were utilized, so would
only crash when it was utilized.



___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] Re: Android JNI failing in Galaxy S4

2013-05-22 Thread Torsten Bonde Christiansen

On 2013-05-22 13:50, m...@rpzdesign.com wrote:

Are you saying that you are writing JNI routines in Pascal for android?

If so, can you post some of the things like the pascal header files 
you use to allow for the creation of the .so files

so that Java can call into pascal across the JNI interface.

I have 2 projects that I need Pascal talking across the JNI 
interface.  1 for Mac OSX where I need pascal to call a JNI library

and another Android where I need Java to call freepascal library (NDK)

Thanks for any information you can share,


+1 from me, I would like that too.

Thanks,
Torsten Bonde Christiansen.
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] Re: Android JNI failing in Galaxy S4

2013-05-22 Thread Felipe Monteiro de Carvalho
Hello,

On Wed, May 22, 2013 at 1:50 PM, m...@rpzdesign.com m...@rpzdesign.com wrote:
 Are you saying that you are writing JNI routines in Pascal for android?

Yes. And luckly it works in all devices =) I was a bit scared that I
might hit a wierd problem here involving code generation or whatever,
but ... just a normal typo in my program.

 If so, can you post some of the things like the pascal header files you use
 to allow for the creation of the .so files
 so that Java can call into pascal across the JNI interface.

See here:

http://sourceforge.net/p/lazarus-ccr/svn/HEAD/tree/bindings/android-ndk/

The file jni.pas is what you are looking for. The rest are Android NDK
headers. I think that it should work for any Java platform.

In the folder examples there, there is a full Android JNI example.

In lazarus/lcl/interfaces/customdrawn/* there is also a lot of JNI
code for Android which can be utilized as examples to learn how to use
JNI.

-- 
Felipe Monteiro de Carvalho
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] Re: Android JNI failing in Galaxy S4

2013-05-22 Thread m...@rpzdesign.com

You sir,

Are a good man.

Thx for the link.

Watch out when the Intel mobile processors come along, I doubt they will 
be ARM 7 compatible.

But they may be x86!

md


On 5/22/2013 7:29 AM, Felipe Monteiro de Carvalho wrote:

Hello,

On Wed, May 22, 2013 at 1:50 PM, m...@rpzdesign.com m...@rpzdesign.com wrote:

Are you saying that you are writing JNI routines in Pascal for android?

Yes. And luckly it works in all devices =) I was a bit scared that I
might hit a wierd problem here involving code generation or whatever,
but ... just a normal typo in my program.


If so, can you post some of the things like the pascal header files you use
to allow for the creation of the .so files
so that Java can call into pascal across the JNI interface.

See here:

http://sourceforge.net/p/lazarus-ccr/svn/HEAD/tree/bindings/android-ndk/

The file jni.pas is what you are looking for. The rest are Android NDK
headers. I think that it should work for any Java platform.

In the folder examples there, there is a full Android JNI example.

In lazarus/lcl/interfaces/customdrawn/* there is also a lot of JNI
code for Android which can be utilized as examples to learn how to use
JNI.



___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] Re: Android JNI failing in Galaxy S4

2013-05-22 Thread m...@rpzdesign.com

Felipe:

Any comments on how you would mix C and pascal into the same binary
for JNI/Android?

I have some encryption routines in C that I need to link to Pascal and 
then get called by Java.


md

On 5/22/2013 7:29 AM, Felipe Monteiro de Carvalho wrote:

Hello,

On Wed, May 22, 2013 at 1:50 PM, m...@rpzdesign.com m...@rpzdesign.com wrote:

Are you saying that you are writing JNI routines in Pascal for android?

Yes. And luckly it works in all devices =) I was a bit scared that I
might hit a wierd problem here involving code generation or whatever,
but ... just a normal typo in my program.


If so, can you post some of the things like the pascal header files you use
to allow for the creation of the .so files
so that Java can call into pascal across the JNI interface.

See here:

http://sourceforge.net/p/lazarus-ccr/svn/HEAD/tree/bindings/android-ndk/

The file jni.pas is what you are looking for. The rest are Android NDK
headers. I think that it should work for any Java platform.

In the folder examples there, there is a full Android JNI example.

In lazarus/lcl/interfaces/customdrawn/* there is also a lot of JNI
code for Android which can be utilized as examples to learn how to use
JNI.



___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] Re: Android JNI failing in Galaxy S4

2013-05-22 Thread Felipe Monteiro de Carvalho
On Wed, May 22, 2013 at 3:54 PM, m...@rpzdesign.com m...@rpzdesign.com wrote:
 Watch out when the Intel mobile processors come along, I doubt they will be
 ARM 7 compatible.
 But they may be x86!

That's not problem. If we have x86 too, then instead of doing 2 clicks
to build the project, I'll have to do 4 clicks. 1 to build for arm, 1
to change the build mode, 1 to build for x86 and 1 to build both apks

Doesn't change much to me =)

On Wed, May 22, 2013 at 3:56 PM, m...@rpzdesign.com m...@rpzdesign.com wrote:
 Any comments on how you would mix C and pascal into the same binary
 for JNI/Android?

Maybe in the same way that is done in desktops?
via {$L objectfile.o} + headers with the directive external

Something like:

uses ctypes;
function something_from_c(params: cint): cint; cdecl; external;

I think it is $L ... I haven't utilized this feature in a long time.

Your c code needs to be compiled for arm-android of course.

-- 
Felipe Monteiro de Carvalho
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


[fpc-pascal] FPC / Lazarus install on Fedora 18

2013-05-22 Thread m...@rpzdesign.com

Anybody successful putting Freepascal 2.6.2 / Lazarus 1.0.8 on Fedora 18.

It seems like Fedora 18 has symbolic links which point /bin and /sbin to 
/usr/bin and /usr/sbin respectively.


/bin - /usr/bin
/sbin - /usr/sbin

Then the compiler chokes an error about You must have an old compiler 
because it can find fpc located in 2 different locations.


But what the compiler/lazarus does not know is that they are pointed to 
the same compiler using 2 different routes, one via the hard file system

and the other using a symbolic link.

Ideas on how to set up the compiler / lazarus for Fedora 18?

(I am not certain about Fedora 15,16,17 since I only used Fedora 14 and 
Fedora 18.


md
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] FPC / Lazarus install on Fedora 18

2013-05-22 Thread Bart
I installed fpc 2.6.2 from the installscript (not from rpm) in /usr/local.
This works well.

Bart
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] FPC / Lazarus install on Fedora 18

2013-05-22 Thread m...@rpzdesign.com

Which package did you download?  (Source package or other?)

md

On 5/22/2013 10:41 AM, Bart wrote:

I installed fpc 2.6.2 from the installscript (not from rpm) in /usr/local.
This works well.

Bart
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal



___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


[fpc-pascal] PostgreSQL and error codes

2013-05-22 Thread silvioprog
Hello,

How to get the error code of a data base error? I'm using the PostgreSQL.
The full list of all erros is:

http://www.postgresql.org/docs/9.2/static/errcodes-appendix.html

Thank you!

--
Silvio Clécio
My public projects - github.com/silvioprog
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal

[fpc-pascal] How does FPC calculate linker search paths upon -XP?

2013-05-22 Thread Bruce Tulloch
Using FPC 2.7.1 I'm cross-compiling from x86_64 to ARM/RPi and have
specified:

-XR/usr/local/opt/chroot/raspbian/rootfs

This produces a link.res file that includes the following:

SEARCH_DIR(/usr/local/opt/chroot/raspbian/rootfs/usr/lib/arm-linux-gnueabihf/)
SEARCH_DIR(/usr/local/opt/chroot/raspbian/rootfs/lib/)
SEARCH_DIR(/usr/local/opt/chroot/raspbian/rootfs/usr/lib/)

but it DOES NOT include this line:

SEARCH_DIR(/usr/local/opt/chroot/raspbian/rootfs/lib/arm-linux-gnueabihf/)

despite the fact the ld.so configuration file:

/usr/local/opt/chroot/raspbian/rootfs/etc/ld.so.conf.d/arm-linux-gnueabihf.conf

specifies both paths as:

# Multiarch support
/lib/arm-linux-gnueabihf
/usr/lib/arm-linux-gnueabihf

What am I doing wrong?

Thanks, Bruce
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal

Re: [fpc-pascal] FPC trunk r224549 needs more incantations?

2013-05-22 Thread Reinier Olislagers
On 22-5-2013 11:02, Sven Barth wrote:
 Am 22.05.2013 08:06, schrieb Reinier Olislagers:
 make.exe[3]: *** No rule to make target `jarparamparser.pas', needed by 
 `fpcjres.exe'.  Stop.
 Fixed in 24550.

Thanks for the quick fix, Sven!

___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


[fpc-pascal] Re: PostgreSQL and error codes

2013-05-22 Thread Reinier Olislagers
On 23-5-2013 3:11, silvioprog wrote:
 How to get the error code of a data base error? I'm using the
 PostgreSQL. 

You can catch db specific errors (descendends of EDatabaseError IIRC) in
an exception - the postgresql descendent was extended with more
properties that include the error code IIRC, or you can catch
EDatabaseError but you won't have much detail; see SQLDBTutorial1
through 3 on the wiki - probably 2 - (it should be in at least one of
them) or of course check the documentation for sqldb.

Thanks,
Reinier
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal