SynCrypto.pas and Lazarus compile problem - lazarus

I'm trying to use SynCrypto.pas (part of Synopse mORMot ORM/SOA/MVC framework) in my Lazarus project to decrypt AES-128 stream. My project not compiling with errors in SynFPCTypInfo at this code:
PFPCInterfaceData = TypInfo.PInterfaceData;
PFPCVmtMethodParam = TypInfo.PVmtMethodParam;
PFPCIntfMethodTable = TypInfo.PIntfMethodTable;
PFPCIntfMethodEntry = TypInfo.PIntfMethodEntry;
SynFPCTypInfo.pas(91,31) Error: Identifier not found "PInterfaceData"
SynFPCTypInfo.pas(91,45) Error: Error in type definition
SynFPCTypInfo.pas(92,32) Error: Identifier not found "PVmtMethodParam"
SynFPCTypInfo.pas(92,47) Error: Error in type definition
SynFPCTypInfo.pas(93,33) Error: Identifier not found "PIntfMethodTable"
SynFPCTypInfo.pas(93,49) Error: Error in type definition
SynFPCTypInfo.pas(94,33) Error: Identifier not found "PIntfMethodEntry"
SynFPCTypInfo.pas(94,49) Error: Error in type definition
I think that it's incompatibility with Delphi TypInfo module. How can I fix it?

So ... I suggest you to install the new pascal: https://github.com/newpascal/newpascal/releases/tag/np-v1.0.56, download the zip and unzip it in some folder, for example (D: \ lazarus \ newpascal), and configure the paths according to the mORMot site: For proper FPC compilation, ensure you have the following settings to your project:
Other unit files (-Fu):
D:\lazarus\newpascal\ccr\mORMot;D:\lazarus\newpascal\ccr\mORMot\SQLite3;D:\lazarus\newpascal\ccr\mORMot\SQLite3\DDD\infra\
Include files (-Fi):
$(ProjOutDir);D:\lazarus\newpascal\ccr\mORMot;D:\lazarus\newpascal\ccr\mORMot\SQLite3\
Libraries (-fFl):
D:\lazarus\newpascal\ccr\mORMot\static$(TargetCPU)-$(TargetOS)\
site: https: //synopse.info/files/html/Synopse%20mORMot%20Framework%20SAD%201.18.html#TITL_113, then you will have at least how to test your app.

Related

Can't use wxWidgets: wxmsw31ud_core.pdb(0,0): Error LNK1136 fatal: invalid or corrupt file

I followed the Creating a new project by hand after building the wx_vc15.sln solution in the ...\wxWidgets\build\msw dir.
I get this error:
...\wxWidgets\lib\vc_x64_lib\wxmsw31ud_core.pdb(0,0): Error LNK1136 fatal: invalid or corrupt file
After rechecking everything (unicode, static linking, Multi-threaded Debug DLL (/MDd), ...), I couldn't find the reason for the error.
These are the preprocessor's definitions I added to the wxWidgets solution, as explained in the Creating a new project by hand page:
WIN32
_LIB
_DEBUG
_CRT_SECURE_NO_DEPRECATE=1
_CRT_NON_CONFORMING_SWPRINTFS=1
_SCL_SECURE_NO_WARNINGS=1
__WXMSW__
WXBUILDING
wxUSE_BASE=0
(The _UNICODE is inherited, no need to add it I presume).

Errors when compiling riscv-gcc

I want to use the riscv-gcc. I got it from https://github.com/riscv/riscv-gcc but when i compiled it I got errors below
../../../../build-gcc-newlib-src/libgcc/../gcc/libgcc2.h:139:1: error: no data type for mode 'TI'
In file included from ../../../../build-gcc-newlib-src/libgcc/../gcc/libgcc2.c:57:0:
../../../../build-gcc-newlib-src/libgcc/../gcc/libgcc2.h:138:1: error: no data type for mode 'TI'
../../../../build-gcc-newlib-src/libgcc/../gcc/libgcc2.h:139:1: error: no data type for mode 'TI'
In file included from ../../../../build-gcc-newlib-src/libgcc/../gcc/libgcc2.c:57:0:
../../../../build-gcc-newlib-src/libgcc/../gcc/libgcc2.h:138:1: error: no data type for mode 'TI'
i don't know what's the problem and I have use this revision to build the FlexPRET project and the newest revision is not copatible with FlexPRET.
Are you using a 64-bit system to build riscv-gcc?
Switching to one may solve this problem: riscv-tools Setup requirem​ents​?

int8 header file not found during compilation

Trying to compile a simple c program and get error.
In file included from /opt/local/lib/gcc47/gcc/x86_64-apple- darwin13/4.7.3/include/stdint.h:3:0,
from ecl/config.h:134,
from ecl/ecl.h:35,
from main.c:2:
/opt/local/lib/gcc47/gcc/x86_64-apple-darwin13/4.7.3/include-fixed/stdint.h:27:32: fatal error: sys/_types/_int8_t.h: No such file or directory
compilation terminated.
What is this error and how can I fix it? From what I gather int8 etc. is typedefined in stdint.h but there's no mention of it in types.h or _types.h. Do I just add these definitions in there or... really lost here.
You have to install IBM® Informix® ESQL/C.
The following BIGINT functionality is available only to users of IBM® Informix® ESQL/C. To use these functions, ESQL/C users will need to manually link their C code to the ESQL/C libraries.
Ref - https://www.ibm.com/docs/en/rbd/9.5.1?topic=libraries-bigint-functions-c
and https://www.ibm.com/docs/en/informix-servers/14.10?topic=programming-esqlc-header-files

EmguCV 'Emgu.CV.CvInvoke' Exception

I have installed EmguCV 2.4.2.1777. I have a 32-bit windows 7 so I installed it using the installer. Now I am trying to write a simple code to capture a webcam's video in a window in C#.
The problem is after during execution I am getting the following famous error:
A first chance exception of type 'System.DllNotFoundException' occurred in Emgu.CV.dll
A first chance exception of type 'System.TypeInitializationException' occurred in Emgu.CV.dll
An unhandled exception of type 'System.TypeInitializationException' occurred in Emgu.CV.dll
The file Emgu.CV.dll is present in the folder. I don't understand why its giving that error.
I tried all the checks which are suggested by fellow stackoverflow users and also many other references:
1) Installed MSVCR: MSVCRT 10.0 SP1 x86
2) copied the OpenCV dlls to the execution directory
3) I also have a 32-bit OS. So that also should'nt be an issue.
But when I checked for dependencies, I faced a problem:
I used DependecyWalker to open cvextern.dll and found the following dependencies missing:
NVCUDA.DLL
API-MS-WIN-CORE-COM-L1-1-0.DLL
API-MS-WIN-CORE-WINRT-ERROR-L1-1-0.DLL
API-MS-WIN-CORE-WINRT-L1-1-0.DLL
API-MS-WIN-CORE-WINRT-ROBUFFER-L1-1-0.DLL
API-MS-WIN-CORE-WINRT-STRING-L1-1-0.DLL
API-MS-WIN-SHCORE-SCALING-L1-1-0.DLL
DCOMP.DLL
IESHIMS.DLL
It also gave the following:
Error: At least one required implicit or forwarded dependency was not found.
Warning: At least one delay-load dependency module was not found.
Warning: At least one module has an unresolved import due to a missing export function in a delay-load dependent module.
Please help me out with the exception. Thanks in advance.
I copied all the dll files from C:\Emgu\emgucv-windows-universal-gpu 2.4.9.1847\bin\x86 to a folder called includes in my project and updated the "Copy To Output Directory" Option for these DLLs to "Copy Always" and it got rid of this issue.

Building Cocoon 2.1.0 with JDK 7 fails: compile-build.xml:68

I am using java JDK 7 in my attempt to build cocoon 2.1.10 on Windows 2008 R2 for eventual deployment in Tomcat 7. I have downloaded the cocoon source files, unzipped them, set my JAVA_HOME variable and then tried to run the build.bat file provided. I get 11 different compilation errors.
D:\cocoon-2.1.10-src\cocoon-2.1.10>build.bat
Buildfile: build.xml
prepare:
====================================================================
Apache Cocoon 2.1.10 [1999-2006]
====================================================================
Building with Apache Ant version 1.6.5 compiled on June 2 2005
--------------------------------------------------------------------
Using build file D:\cocoon-2.1.10-src\cocoon-2.1.10\build.xml
--------------------------------------------------------------------
Compiler options:
- debug ......... [on]
- optimize ...... [on]
- deprecation ... [off]
====================================================================
compile-core:
Compiling 594 source files to D:\cocoon-2.1.10-src\cocoon-2.1.10\build\cocoon\classes
D:\cocoon-2.1.10-src\cocoon-2.1.10\src\java\org\apache\cocoon\reading\ImageReader.java:39: error: package com.
sun.image.codec.jpeg does not exist
import com.sun.image.codec.jpeg.ImageFormatException;
^
D:\cocoon-2.1.10-src\cocoon-2.1.10\src\java\org\apache\cocoon\reading\ImageReader.java:40: error: package com.
sun.image.codec.jpeg does not exist
import com.sun.image.codec.jpeg.JPEGCodec;
^
D:\cocoon-2.1.10-src\cocoon-2.1.10\src\java\org\apache\cocoon\reading\ImageReader.java:41: error: package com.
sun.image.codec.jpeg does not exist
import com.sun.image.codec.jpeg.JPEGEncodeParam;
^
D:\cocoon-2.1.10-src\cocoon-2.1.10\src\java\org\apache\cocoon\reading\ImageReader.java:42: error: package com.
sun.image.codec.jpeg does not exist
import com.sun.image.codec.jpeg.JPEGImageEncoder;
^
D:\cocoon-2.1.10-src\cocoon-2.1.10\src\java\org\apache\cocoon\reading\ImageReader.java:326: error: cannot find
symbol
JPEGImageEncoder encoder = JPEGCodec.createJPEGEncoder(out);
^
symbol: class JPEGImageEncoder
location: class ImageReader
D:\cocoon-2.1.10-src\cocoon-2.1.10\src\java\org\apache\cocoon\reading\ImageReader.java:326: error: cannot find
symbol
JPEGImageEncoder encoder = JPEGCodec.createJPEGEncoder(out);
^
symbol: variable JPEGCodec
location: class ImageReader
D:\cocoon-2.1.10-src\cocoon-2.1.10\src\java\org\apache\cocoon\reading\ImageReader.java:327: error: cannot find
symbol
JPEGEncodeParam p = encoder.getDefaultJPEGEncodeParam(currentImage);
^
symbol: class JPEGEncodeParam
location: class ImageReader
D:\cocoon-2.1.10-src\cocoon-2.1.10\src\java\org\apache\cocoon\reading\ImageReader.java:333: error: cannot find
symbol
JPEGImageEncoder encoder = JPEGCodec.createJPEGEncoder(bstream);
^
symbol: class JPEGImageEncoder
location: class ImageReader
D:\cocoon-2.1.10-src\cocoon-2.1.10\src\java\org\apache\cocoon\reading\ImageReader.java:333: error: cannot find
symbol
JPEGImageEncoder encoder = JPEGCodec.createJPEGEncoder(bstream);
^
symbol: variable JPEGCodec
location: class ImageReader
D:\cocoon-2.1.10-src\cocoon-2.1.10\src\java\org\apache\cocoon\reading\ImageReader.java:334: error: cannot find
symbol
JPEGEncodeParam p = encoder.getDefaultJPEGEncodeParam(currentImage);
^
symbol: class JPEGEncodeParam
location: class ImageReader
D:\cocoon-2.1.10-src\cocoon-2.1.10\src\java\org\apache\cocoon\reading\ImageReader.java:342: error: cannot find
symbol
} catch (ImageFormatException e) {
^
symbol: class ImageFormatException
location: class ImageReader
11 errors
BUILD FAILED
D:\cocoon-2.1.10-src\cocoon-2.1.10\tools\targets\compile-build.xml:68: The following error occurred while exec
uting this line:
D:\cocoon-2.1.10-src\cocoon-2.1.10\tools\targets\compile-build.xml:51: Compile failed; see the compiler error
output for details.
I also tried using "build war" on my command line and this yielded the same result.
Is this an issue with the JDK I am using or is there something else that I need to be looking at? This is my first attempt at building and deploying cocoon, I could be missing something obvious.
Regards, Tony
The deprecated, proprietary com.sun.image.jpeg.codec package has been removed from JDK 7 (see this official official JDK7 compatibility note). Hence your compilation problem.
Since patching the Cocoon source may not be an option in your situation, the shortest path for you might be to compile using JDK 6 (or earlier, the Cocoon 2.1 series require "Java 1.3 or later").
(But if it is, as you seem to require specific Cocoon and JDK versions, you may want to have a look at the SO Q&A on How to replace com.sun.image.codec.jpeg.JPEGImageEncoder with calls to the standard Java Image I/O API)
Another option might be to look at a separate distribution of the com.sun.image.jpeg.codec package to include in you build (and possibly runtime) classpath. I'm unsure about the availability (and the ease of use) of this option. Anyhow I wouldn't recommend digging into it unless all other path have proven to be dead-ends...
In my case the solution for this error was: search for folder endorsed, it should be in path : cocoon-2.1.11-src\cocoon-2.1.11\lib\endorsed
copy this folder in your curren JAVA_HOME/jre/lib
And try to build again.
i hope than this solve your problem
I know this is old but in case anyone's interested I was able to build cocoon 2.1 recently without errors
I had to get the latest source from their current dev branch however (2_1_X) since I found that they'd fixed this bug but it still wasn't in their latest release (2.1.12) yet
I was actually able to build it with JDK 8 and also run it with Tomcat 8. Had to do some tweaks to get that working properly tho

Resources