Do you own a Debenu Quick PDF Library version 7, 8, 9, 10, 11, 12, 13 or iSEDQuickPDF license? Upgrade to Debenu Quick PDF Library 14 today!

Debenu Quick PDF Library - PDF SDK Community Forum Homepage
Forum Home Forum Home > For Users of the Library > I need help - I can help
  New Posts New Posts RSS Feed - use Debenu PDF library with eclipse CDT plugin
  FAQ FAQ  Forum Search   Register Register  Login Login

use Debenu PDF library with eclipse CDT plugin

 Post Reply Post Reply
Author
Message
AlexA_B View Drop Down
Beginner
Beginner


Joined: 08 Sep 14
Status: Offline
Points: 18
Post Options Post Options   Thanks (0) Thanks(0)   Quote AlexA_B Quote  Post ReplyReply Direct Link To This Post Topic: use Debenu PDF library with eclipse CDT plugin
    Posted: 08 Sep 14 at 8:58PM
I try to create JNI wrapper around the Debenu/PDF Library/DLL/Import/CPlusPlus.
I use the CDT plugin for eclipse with MinGW for linking and compiling my code.
All the examples I've found are done with WinAPI. 
I try very simple thing:
com_mdm_mie_jniconnector_JniManager.H file:
#include <jni.h>
/* Header for class com_ricoh_mdm_mie_jniconnector_JniManager */

#ifndef _Included_com_mdm_mie_jniconnector_JniManager
#define _Included_com_mdm_mie_jniconnector_JniManager
#ifdef __cplusplus
extern "C" {
#endif
/*
 * Class:     com_mdm_mie_jniconnector_JniManager
 * Method:    ping
 * Signature: ()Z
 */
JNIEXPORT jboolean JNICALL Java_com_mdm_mie_jniconnector_JniManager_ping
  (JNIEnv *, jobject);
#ifdef __cplusplus
}
#endif
#endif
=================
com_mdm_mie_jniconnector_JniManager.CPP file:

#include "com_ricoh_mdm_mie_jniconnector_JniManager.h"

#include "DebenuPDFLibraryDLL1016.h"
#include <string>
#include <iostream>


using namespace std;




/*
 * Class:     com_mdm_mie_jniconnector_JniManager
 * Method:    ping
 * Signature: ()Z
 */
JNIEXPORT jboolean JNICALL Java_com_mdm_mie_jniconnector_JniManager_ping
  (JNIEnv *env, jobject obj)
{
//create the library and release it
// Declare and load Quick PDF Library DLL
std::string str = "DebenuPDFLibraryDLL1016.dll";
std::wstring temp(str.length(),L' ');
std::copy(str.begin(), str.end(), temp.begin());

DebenuPDFLibraryDLL1016 QP(temp);



return JNI_TRUE;
}

Error is:
>undefined reference to `DebenuPDFLibraryDLL1016::DebenuPDFLibraryDLL1016(std::basic_string<wchar_t, std::char_traits<wchar_t>, std::allocator<wchar_t> > const&)'

I tried:

DebenuPDFLibraryDLL1016 QP("DebenuPDFLibraryDLL1016.dll");
> no matching function for call to 'DebenuPDFLibraryDLL1016::DebenuPDFLibraryDLL1016(const char [28])'

DebenuPDFLibraryDLL1016 QP(L"DebenuPDFLibraryDLL1016.dll");
>undefined reference to `DebenuPDFLibraryDLL1016::DebenuPDFLibraryDLL1016(std::basic_string<wchar_t, std::char_traits<wchar_t>, std::allocator<wchar_t> > const&)'

I did not find a way to link and compile the DebenuPDFLibraryDLL1016 into my application (which is dll).
Here is the command I use:
g++ "-IC:\\Program Files\\Java\\jdk1.7.0_21\\include" "-IC:\\Program Files\\Java\\jdk1.7.0_21\\include\\win32" "-IC:\\Program Files (x86)\\Debenu\\PDF Library\\DLL\\Import\\CPlusPlus" -O0 -g3 -Wall -c -fmessage-length=0 -o com_mdm_mie_jniconnector_JniManager.o "..\\com_mdm_mie_jniconnector_JniManager.cpp" 
g++ -shared -o libwinwrapper.dll com_mdm_mie_jniconnector_JniManager.o 

For now it seems I can not create the const std::wstring as it is declared by the constractor:
DebenuPDFLibraryDLL1016(const std::wstring& dllFileName);

Please help.


Back to Top
AlexA_B View Drop Down
Beginner
Beginner


Joined: 08 Sep 14
Status: Offline
Points: 18
Post Options Post Options   Thanks (0) Thanks(0)   Quote AlexA_B Quote  Post ReplyReply Direct Link To This Post Posted: 08 Sep 14 at 9:14PM
I tried the following:
std::wstring lib;
lib.append(L"DebenuPDFLibraryDLL1016.dll");

DebenuPDFLibraryDLL1016 QP(lib);

still no luck:
>>
C:\Tmp\Osgi\winwrapper\Debug/../com_mdm_mie_jniconnector_JniManager.cpp:37: undefined reference to `DebenuPDFLibraryDLL1016::DebenuPDFLibraryDLL1016(std::basic_string<wchar_t, std::char_traits<wchar_t>, std::allocator<wchar_t> > const&)'
C:\Tmp\Osgi\winwrapper\Debug/../com_mdm_mie_jniconnector_JniManager.cpp:37: undefined reference to `DebenuPDFLibraryDLL1016::~DebenuPDFLibraryDLL1016()'
collect2.exe: error: ld returned 1 exit status

Back to Top
AlexA_B View Drop Down
Beginner
Beginner


Joined: 08 Sep 14
Status: Offline
Points: 18
Post Options Post Options   Thanks (0) Thanks(0)   Quote AlexA_B Quote  Post ReplyReply Direct Link To This Post Posted: 09 Sep 14 at 2:14PM
I believe that the problem is linking the dll's into my project.
Here's the steps I did:
1. copied 
C:\Program Files (x86)\Debenu\PDF Library\DLL
into
C:\Debenu
directory, so the path does not have any white spaces.
2. created the following link command:
g++ "-LC:\\Debenu\\DLL" -shared -o libwinwrapper.dll com_ricoh_mdm_mie_jniconnector_JniManager.o -lDebenuPDFLibraryDLL1016

I did it according to the following page:

Unfortunately it still does not work. I got the following error:

C:\Tmp\Osgi\winwrapper\Debug/../com_mdm_mie_jniconnector_JniManager.cpp:37: undefined reference to `DebenuPDFLibraryDLL1016::DebenuPDFLibraryDLL1016(std::basic_string<wchar_t, std::char_traits<wchar_t>, std::allocator<wchar_t> > const&)'
C:\Tmp\Osgi\winwrapper\Debug/../com_ricoh_mdm_mie_jniconnector_JniManager.cpp:37: undefined reference to `DebenuPDFLibraryDLL1016::~DebenuPDFLibraryDLL1016()'
collect2.exe: error: ld returned 1 exit status

Can I find the setting for the C++ debenu dll libraries ? Should I include both:
DebenuPDFLibrary64DLL1016  and DebenuPDFLibraryDLL1016 with "-l" option ?
Should I include the directory "-L" option ?

Back to Top
AlexA_B View Drop Down
Beginner
Beginner


Joined: 08 Sep 14
Status: Offline
Points: 18
Post Options Post Options   Thanks (0) Thanks(0)   Quote AlexA_B Quote  Post ReplyReply Direct Link To This Post Posted: 09 Sep 14 at 4:04PM
Found my problem.
Add the 
* DebenuPDFLibraryDLL1016.cpp
* DebenuPDFLibraryDLL1016.h
into your project. Do not just include them in the compiler , but physically copy them in the same dirsctory.

PS: during compilation it gives hundreds of warnings:

"warning: deprecated conversion from string constant to ‘char*’"

you will have to add the following option to compiler to suppress them all:

-Wno-write-strings

Regards

  

Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 11.01
Copyright ©2001-2014 Web Wiz Ltd.

Copyright © 2017 Debenu. Debenu Quick PDF Library is a PDF SDK. All rights reserved. AboutContactBlogSupportOnline Store