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?
Related
When I build java object class in a project, build file will be created with .class extension and human unreadable; What about swift build files?
example:
car.java --> build --> car.class
what would be after build?
car.swift --> build --> ?
The compilation process is a bit different with Swift to Java, so there isn't necessarily a direct equivalent.
As the build proceeds though each Swift file will get compiled in to an 'Object' file, ending in a .o extension. Then once they're all built they get linked together to form the binary. If you unpick an iOS app's IPA file, you won't see the individual .o files like how you can see the .class files inside a Java jar file.
One thing I know is that Swift uses LLVM just like Objective-C.
So in Java, we have this (source: W3schools).
And here, for Swift (source: Swift.org)
I hope this helps!
Mach-O format
[LLVM]
In iOS world every sources file - .m, .h, .swift are compiled into executable byte code that is understandable by CPU. These files are also called Mach object(.o) - ABI Mach-O[About] file which contains nexts grouped bytes with a meta-information
Mach-O header - general information like cpu type(CPU_TYPE)
Load Commands - table of contents
Raw segment data - code
__LLVM - bitcode[About]
This groups are repeated for every architecture(Universal library)[About]
`*.swift` -> `*.o` (Mach-O object file)
For example if you created a static library - myLibrary.a. You can use nm[About] command to display name list (symbol table).
nm path/myLibrary.a
As a result you will see a list of *.o files with methods, variables names etc.
To investigate Mach-O file you can use otool[About]
[Mach-O Type]
[Xcode build process]
swift code:
let drop = Droplet()
print(drop.config)
result:
▿ Config
▿ node : Node
- object : 0 elements
why is drop.config nil
saying it works once you delete the secrets folder leads me to believe your using xcode and added the files directly through xcode. If this is the case, you should get the folder structure back to its original condition. Once its working properly, add the new files/folders outside of xcode, I add mine using Atom but text editor of your choice will work fine, then save the texteditor file and they will show up in your xcode project and work as expected with drop.config.
1) navigate to project folder using command
2) if using atom, type "atom ."
3) add the new files/folders and hit control + S to save
should be good to go from there
To be safe, make all future adjustments to files in texteditor as well.
This is happening only on 3.1 because swift changed a folder with the dependencies and the vapor can not find working directory.
https://github.com/vapor/vapor/blob/1.5.15/Sources/Vapor/Droplet/Droplet%2BWorkingDirectory.swift
You should upgrade to the Vapor 1.5
I generate a new Dart.Polymer1.0 in Webstorm. It has a default element <main-app> in directory \web.
I create a new element <t-file>, also in \web, which is used/called by <main-app>. All works fine.
I then move <t-file> into a subdirectory of web - \web\view\t_file.html.
WebStorm is happy - I can CTRL-B to t_file.html etc. There are no warnings or complaints. But the app shows a blank page when it runs (= not running!)
I move <t-file> back up to be a sibling of <main-app>, and it works again.
I must be missing something, but what is it?
Thanks,
Steve
I have "found the answer".
1) Close the project in Webstorm, and reopen it - it then works.
2) Do not remove imports that webstorm says are unused - because they are! In 'main-app.dart' I had
import 'package:rm5/view/t_file.dart';
which was greyed-out. But it must be there for it to work.
S
** This question is edited and cleaned up some **
I have two projects and I want to use code from one in the other; I seem to be having trouble putting the code in the right directory structure to make the import statements work.
Both projects are created and managed exclusively from the Dart Editor on a Mac, if that makes any differences.
Project Directory Structures
Project 1: a command line app which contains the code I want to share in the following directory structure:
/dart/command_line_app
/lib
shared_library.dart
/bin
command_line_app.dart
Project 2: a web app which wants to import the code in shared_libary.dart
/dart/web_application
/packages
/web
web_application.dart
In the file shared_libary.dart, I declare it to be a library can create a simple class that provides output when instantiated:
library shared_library;
class ShareMe
{
ShareMe()
{
print("Hello, ShareMe");
}
}
This compiles, and works inside the command_line project: command_line_app.dart has the following:
import 'package:command_line_app/shared_library.dart';
void main() {
ShareMe shareMe = new ShareMe();
print("Hello, World!");
}
This imports the code runs, printing both "Hello Share Me," and Hello World.
THE PROBLEM
I want to instantiate the ShareMe class inside web_application.dart. I'd thought I could do that by putting in the same import statement I put in my command_line code:
import 'package:command_line_app/shared_library.dart';
But, when I put the same import into the web_appliation, it gets the error
Target of URI does not exist 'package:command_line_app/shared_library.dart'
Other Things I've Tried
I was certain I'd solved the problem when I cntrl-Clicked properties on Web_application and selected Project References.
It brings up a window allowing me to select command_line_app with a check box, but when I do, I get an error:
Could not set the project description for 'web_application' because the project description file (.project) is out of sync with the file system.
Whatever that means.
When I cntrl-click the underlined error and try Quick Fix it offers me "resolve dependencies" which sounds promising, but after a few seconds, it comes back and informs me that
Pub get failed, [1] Resolving dependencies... (15.3s)
Could not find package command_line_app at https://pub.dartlang.org.
Depended on by:
- web_application 0.0.0
I hope this is clear-er and gives a better insight into both what I'm trying to do and what I'm missing.
EDIT
you need to add
dependencies:
command_line_app:
path: ../command_line_app
to your dependencies in web_application/pubspec.yaml.
EDIT END
When you want to make code reusable in different packages, you should put that code into the lib directory of that package and import it using import 'package:mypackage/myfile.dart';.
Another problem you may face is, that browser applications can't import packages that have a dart:io dependency. If you want to reuse code between command line and browser applications you should move them into the lib directory of another package my_shared_code where you put only code that doesn't depend on dart:io (for example some entity classes) and import this code from both app packages (browser and command line).
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.