I'm trying to integrate xlslib in my app. After compiling and installing lib, I have added this in my code. Then I got the error shown below:
format_t::format_t(CGlobalRecords& gRecords, const u16string& fmtstr) :
formatstr(fmtstr),
index(0),
m_usage_counter(0),
m_GlobalRecords(gRecords)
{
}
Errors:
format.cpp:125:52: Reference to 'u16string' is ambiguous
Out-of-line definition of 'format_t' does not match any declaration in
xlslib_core::format_t
while in format.h file, declaration as below
format_t(CGlobalRecords& gRecords, const u16string& fmtstr);
Can any one help to solve this issue?
Why didn't you post a bug report on the SourceForge page? In any case, the xlslib project has been updated and now offers the DHxlslibIOS library that you can incorporate as is into your project. You can download a zipped package here with the latest 2.4.0b1 source, or pull it from SVN. The framework is in the DHxls directory.
Related
I am having trouble utilising the libserialport.dart package. I have put a libserialport.so in the root of the project. When trying to run an application I get the following error:
Unhandled exception: Invalid argument(s): Failed to load dynamic library 'libserialport.so': libserialport.so: cannot open shared object file: No such file or directory
This tells me that the package is looking for the file somwhere else - but where?
The original library links the library this way, which results in it not finding the library:
LibSerialPort? _dylib;
LibSerialPort get dylib {
return _dylib ??= LibSerialPort(ffi.DynamicLibrary.open(
resolveDylibPath(
'serialport',
dartDefine: 'LIBSERIALPORT_PATH',
environmentVariable: 'LIBSERIALPORT_PATH',
),
));
}
If I replicate the plugin locally, but changing the linking as such, the library works as expected:
var libraryPath =
path.join(Directory.current.path, 'libserialport.so');
LibSerialPort? _dylib;
LibSerialPort get dylib {
return _dylib ??= LibSerialPort(ffi.DynamicLibrary.open(libraryPath));
}
The question is: where to put the .so file so it would work with the original verison? Where does resolveDylibPath() link to?
If possible I would like to avoid using my modified version as that brings license implications I am not entirely sure how to deal with.
Apparently the function looks for the path in the LIBSERIALPORT_PATH enviroment variable. Setting it to '.' made it work!
In the terminal:
export LIBSERIALPORT_PATH=.
I am trying to use Clair and Rascal to analyze C++ files.
I followed the instructions on the Github page of Clair to add Clair to an empty Rascal project. After importing the required modules successfuly, I attempted to call parseCpp to parse a C++ file and got the following errors:
rascal>parseCpp(|project://myproject3/myFile.cpp|);
|jar+file:///Users/rh07/.m2/repository/org/rascalmpl/clair/0.4.0/clair-0.4.0.jar!/src/lang/cpp/AST.rsc|(24317,206,<455,0>,<456,167>): Java("NoSuchMethodError","\'io.usethesource.vallang.IString org.rascalmpl.library.Prelude.readFile(io.usethesource.vallang.ISourceLocation)\'")
at lang.cpp.internal.CDTParser.parseFileAsCpp(|unknown:///CDTParser.java|(0,0,<202,0>,<202,0>))
at lang.cpp.internal.Parser.parseCpp(|unknown:///Parser.java|(0,0,<349,0>,<349,0>))
at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(|unknown:///NativeMethodAccessorImpl.java|(0,0,<0,0>,<0,0>))
at parseCpp(|jar+file:///Users/rh07/.m2/repository/org/rascalmpl/clair/0.4.0/clair-0.4.0.jar!/src/lang/cpp/AST.rsc|(24516,5,<456,160>,<456,165>)Beginning at 2022-11-25T11:35:54.827391Z
WARNING: ResourcesPlugin was null, can't get workspace; not overriding include files
How I can get parseCpp to work? Thanks.
The error is caused by a bad combination of versions. Please use clair-0.5.0 (just released) which will work with rascal-0.27.2 that is distributed with the Rascal VScode extension 0.5.5.
Adopt the pom.xml like so:
<dependency>
<groupId>org.rascalmpl</groupId>
<artifactId>clair</artifactId>
<version>0.5.0</version>
</dependency>
I'm trying to add native swift code to my NativeScript app. According to these instructions in the documentation I can just add a swift source file to App_Resources/iOS/src/ and then use any publicly exposed classes directly in my TypeScript code.
Unfortunately this just doesn't work. I'll just get Cannot find name 'TestClass' and that's it.
Steps to reproduce:
Get a fresh NS project with ios tns create my-app-name --template tns-template-blank-ts
Update: I actually created the App with vue init nativescript-vue/vue-cli-template testapp. That seems to have caused the problems.
Add a TestClass.swift to App_Resources/iOS/src/
import Foundation
public class TestClass: NSObject {
#objc public func echo(param: String) -> String {
return param
}
}
Instantiate it in any TypeScript source file let instance = new TestClass()
Do tns debug ios
Compilation will fail with Cannot find name 'TestClass'
I have also tried generating TypeScript typings with TNS_TYPESCRIPT_DECLARATIONS_PATH="$(pwd)/typings" tns build ios or or just delcaring it as any with declare let KeyCommander: any; to eliminate the possibility that this is a TS related problem. The first approach doesn't generate any typings for my custom class so the TypeScript code will still not compile. The second approach let's the TS code compile but crashes on execution with JS ERROR ReferenceError: Can't find variable: TestClass.
I have also verified that the swift file is indeed getting compiled by inserting a syntax error which will crash the build process.
My NativeScript version is 6.4.0.
What am I missing?
Update: I just realized I actually created the App with vue init nativescript-vue/vue-cli-template testapp. I verified that as mentioned Tyler Blake's answer in an app created with the tns cli the described process actually works. In an app I just freshly created with vue init it doesn't, the objc!nsswiftsupport.d.ts is not being generated.
The question now is: What's causing the difference?
I followed your steps and I was able to get the typings to generate in objc!nsswiftsupport.d.ts. After you generate typings do you have that file with these contents?
declare class TestClass extends NSObject {
static alloc(): TestClass; // inherited from NSObject
static new(): TestClass; // inherited from NSObject
echoWithParam(param: string): string;
}
This shows that NS is able to pick up the Swift code.
All you need to do now is add tns-platform-declarations then in the references.d.ts file, add a line that points to the objc!nsswiftsupport.d.ts file. Then you'll get intellisense in your TS code.
Something like this:
/// <reference path="./typings/objc!nsswiftsupport.d.ts" />
Hope this helps!
I was able to solve the problem by inspecting the differences between the templates created with tns-cli and vue init. The difference is that the vue init template ships with an outdated version of the nativescript platform. You can just simply change
"tns-ios": {
"version": "6.0.1"
}
to version 6.4.0 (which the version the tns-cli template comes with) and then the process will work as described in the documentation.
experts out there! I need your help. I am trying to make my own instant messenger. I refer to this website, and I am stuck at this. There is a read underline bottom of the word, 'parse' and it says Cannot resolve symbol parse. I did everything I could. I put parse-1.10.2.zip in libs file. I added compile fileTree(include: ['*.jar'], dir: 'libs'), compile files('libs/Parse-1.10.2.jar') in build gradle, and added the jar in dependencies. However, the error still there. Can anybody fix this problem? Here's my code:
public class MyApplication extends Application {
// Enable Local Datastore.
Parse.enableLocalDatastore(this);
Parse.initialize(this, "APPLICATION ID", "CLIENT KEY");
}
Have you extracted your zip-archive? I'm no expert but you should put the jar-Files into libs-directory - not a zip-file.
Otherwise try this templates:
I'm having trouble getting the latest version of the ZXing library up and running. I've downloaded the latest source from http://zxing.googlecode.com/svn/trunk/iphone/ and the ZXing 2.0 release from http://code.google.com/p/zxing/downloads/list
I've setup the folder structure like so:
project/iphone/ZXingWidget/ZXingWidget.xcodeproj
project/cpp/ios.xcodeproj
When I open up ZXingWidget.xcodeproj and build, I get an error in CBarcodeFormat.mm that there is "no member named 'BarcodeFormat_AZTEC' in namespace 'zxing'". However, if I look in CBarcodeFormat.h, there is definitely an item in the enum called BarcodeFormat_AZTEC.
I've also noticed there are some files missing from the project (they're red in the project navigator). Specifically, these files:
- CoreSrc/zxing/common/reedsolomon/GenericGF.cpp
- CoreSrc/zxing/common/reedsolomon/GenericGF.h
- CoreSrc/zxing/common/reedsolomon/GenericGFPoly.cpp
- CoreSrc/zxing/common/reedsolomon/GenericGF.h
- CoreSrc/zxing/common/aztec/*
Any ideas what I might be doing wrong?