/Users/admin/Desktop/j2objc-0.9.5/j2objc -d ${DERIVED_FILES_DIR} -sourcepath ${PROJECT_DIR}/ --no-package-directories -classpath "${PROJECT_DIR}/java-lib/commons-math3-3.2.jar" ${INPUT_FILE_PATH};
It is built successfully, but when compile it, those includes throw errors "file not found".
#include "Array2DRowRealMatrix.h"
#include "ArrayRealVector.h"
I go to DerivedSource folder to check and there is no file named Array2DRowRealMatrix.h or ArrayRealVector.h. It seems the .jar is not built or compiled. So how to use a .jar in the project?
--
You received this message because you are subscribed to the Google Groups "j2objc-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to j2objc-discus...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
/Users/admin/Desktop/j2objc-0.9.5/j2objc -d ${DERIVED_FILES_DIR} -sourcepath ${PROJECT_DIR}/ "${PROJECT_DIR}/commons-math3-3.2-sources.jar" --no-package-directories ${INPUT_FILE_PATH};
I'm not sure whether I can append two paths after -sourcepath tag.
--
--
You received this message because you are subscribed to the Google Groups "j2objc-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to j2objc-discuss+unsubscribe@googlegroups.com.
Thanks Keith! I tried using this command, but still get the same error:
j2objc -use-arc --doc-comments --build-closure -d ./j2objc-generated -sourcepath ./src/main/java:./libs/*.jar `find ./src/main/java -name '*.java'`
--
You received this message because you are subscribed to the Google Groups "j2objc-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to j2objc-discus...@googlegroups.com.
--
You received this message because you are subscribed to the Google Groups "j2objc-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to j2objc-discuss+unsubscribe@googlegroups.com.
I can get it to link if I unzip the jar and manually add all the needed java files in it to the compile sources phase in my build phases. It's strange, as the files were being translated, and the imports mustve resolved as it compiled. But it looks like unless I specify the files in compile phases, the linker doesn't link them - trying to use any of the classes' methods results in an error message starting with _OBJC_CLASS_$_. Thoughts?
Add the translated files to Xcode. To keep your project files separate, I suggest adding them to a different project folder, create a static library target to build them, and then make your app target depend on the library.
--
Undefined symbols for architecture i386:
"_Java_com_test_Demo_ft_1createInstance", referenced from:
_ComTestDemo_ft_createInstance in Demo.o
ld: symbol(s) not found for architecture i386
clang: error: linker command failed with exit code 1 (use -v to see invocation)
this is my Demo.java file
package com.test;
public class Demo {
Demo(){
} public static final native long ft_createInstance();
}
This is my Demo.m file :
#include "Demo.h"
#include "J2ObjC_source.h"
#line 1 "/Users/Applications/myProject/src/com/test/Demo.java"
#line 3
@implementation ComTestDemo
J2OBJC_IGNORE_DESIGNATED_BEGIN
#line 5
- (instancetype)init {
ComTestDemo_init(self);
return self;
}
J2OBJC_IGNORE_DESIGNATED_END
#line 8
+ (jlong)ft_createInstance {
return ComTestDemo_ft_createInstance();
}
+ (const J2ObjcClassInfo *)__metadata {
static const J2ObjcMethodInfo methods[] = {
{ "init", "Demo", NULL, 0x0, NULL, NULL },
{ "ft_createInstance", NULL, "J", 0x119, NULL, NULL },
};
static const J2ObjcClassInfo _ComTestDemo = { 2, "Demo", "com.test", NULL, 0x1, 2, methods, 0, NULL, 0, NULL, 0, NULL, NULL, NULL };
return &_ComTestDemo;
}
@end
#line 5
void ComTestDemo_init(ComTestDemo *self) {
NSObject_init(self);
}
#line 5
ComTestDemo *new_ComTestDemo_init() {
ComTestDemo *self = [ComTestDemo alloc];
ComTestDemo_init(self);
return self;
}
#line 5
ComTestDemo *create_ComTestDemo_init() {
return new_ComTestDemo_init();
}
#line 8
JNIEXPORT jlong Java_com_test_Demo_ft_1createInstance(JNIEnv *_env_, jclass _cls_);
jlong ComTestDemo_ft_createInstance() {
return Java_com_test_Demo_ft_1createInstance(&J2ObjC_JNIEnv, ComTestDemo_class_());
}
J2OBJC_CLASS_TYPE_LITERAL_SOURCE(ComTestDemo)
Please help me to solve this.
--
You received this message because you are subscribed to a topic in the Google Groups "j2objc-discuss" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/j2objc-discuss/pbrC0qTbQzI/unsubscribe.
To unsubscribe from this group and all its topics, send an email to j2objc-discus...@googlegroups.com.
But I got ... cannot be resolve to a type.
Please help me to build with this jar!
Detail :
http://stackoverflow.com/questions/40209680/j2objc-with-source-jar-file
Thanks you so much.