help-gplusplus
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Linker won't find dll


From: jjones7947
Subject: Re: Linker won't find dll
Date: Tue, 26 Aug 2008 09:35:13 -0700 (PDT)
User-agent: G2/1.0

Ok my command line for compile:
g++ -mno-cygwin -Wall -IC:\Program Files\Java\jdk1.6.0_06\include
\win32 -IC:\Program Files\Java\jdk1.6.0_06\include -Iinclude
    -c source/jsummarizer.cc -o native/jsummarizer.o
copy the .def file out of the source dir to build dir
For linking:
g++ -shared -v -o native/jsummaraizer.dll build/jsummarizer.o build/
jsummarizer.def -Llibs -lsummarizer37 -lplatform37

The undefined references are:
inxight::delete_summarizer(inxight::summarizer_interface*)
inxight::make_summarizer(char const*, char const*, char const*)
inxight::delete_summarization(inxight::summarization_interface*)
inxight::make_summarization(inxight::summarizer_interface&,
inxight::byte_stream_interface&, inxight::summarization_input_options
const&, inxight::summarization_sentence_output const&,
inxight::summarization_phrase_output const&, char const*, unsigned
int, char const*)
inxight::file_not_found::file_not_found(char const*, char const*)
inxight::file_not_found::~file_not_found()
inxight::delete_summarizer(inxight::summarizer_interface*)

The exports from summarizer37 and platform 37 (I'm using the .lib
versions) are:
INXIGHT_SUMMARIZER_EXPORT summarizer_interface* make_summarizer
        (const char* resource_dir,
         const char* license_file,
         const char* key);
INXIGHT_SUMMARIZER_EXPORT void
delete_summarizer(summarizer_interface*);
INXIGHT_SUMMARIZER_EXPORT summarization_interface* make_summarization
        (summarizer_interface& s,
         inxight::byte_stream_interface& bstr,
         const summarization_input_options& input_options,
         const summarization_sentence_output& sentence_output_options,
         const summarization_phrase_output& phrase_output_options,
         const char* query_string,
         size_t query_length,
         const char* query_encoding);
INXIGHT_SUMMARIZER_EXPORT void
delete_summarization(summarization_interface*);
class INXIGHT_PLATFORM_EXPORT file_not_found : public failure
Has a method file_not_found(char const*, char const*)
Has a method ~file_not_found()

NOTE: It doesn't seem to matter whether I use the dlls or .libs these
exports the symbols are not being resolved
The other thing is I am not calling any of these methods, instead I am
following the sample program and wolk-through below:
? Summarization Sample Program and Code
Walkthru
This section provides a sample program using the Summarizer API that
composes a summary
containing 10 summary sentences, extracts 20 key phrases, and prints
the results. It also provides a
line-by-line walkthrough of the code.
Sample Program
1 // Assuming that we have a vector “filename” of files to be
summarized, and that the resources are located in the
"resource_dir" directory:

inxight::summarizer summarizer("resource_dir", "license_file",
"key");
2 inxight::file_byte_stream fstream(filename[0]);
3 inxight::summarization_input_options in_options ("std", "std",
"english", "cp_1252", "html");
4 inxight::summarization_sentence_output sent_out_options(10, false);
5 inxight::summarization_phrase_output phrase_out_options(20, false);
6 for (int k = 0; k < filename.length(); k++) {
        fstream.reset(filename[k]);
7 inxight::summarization summary
(summarizer,fstream,in_options,sent_out_options, phrase_out_options);
8 // printing the key sentences:
cout << "There are " << summary.number_of_key_sentences() <<" key
sentences: " << endl;
9 for (sequence<key_item>::const_iterator siter =
summary.first_key_sentence();
10 siter != summary.end_key_sentence(); siter++) {
        cout << siter->item_text() << endl;
    }
11 // printing the string representing the key phrases:
cout << "There are " << summary.number_of_key_phrases() << "key
phrases: " << endl;
12 for (sequence<key_item>::const_iterator iter =
summary.first_key_phrase();
13 iter != summary.end_key_phrase(); iter++) {
         cout << iter->item_text() << endl;
    }

Code Walkthrough
1 Constructs an instance summarizer of the summarizer class, which
will manage access to resources (language modules, configuration
files, etc.)
Input to the constructor is the location where all the resource files
are located— here, in the resource_dir directory, and the license file
and company key.

2 Constructs an instance fstream of the file_byte_stream class and
associates it with the filename vector containing the names of files
to be summarized.

3 Constructs an instance in_options of the summarization_input_options
class and specifies the document genre, variant, language, character
encoding, and format.

4 Constructs an instance sent_out_options of the
summarization_sentence_output class, thus specifying the desired
output, with respect to summary sentences,
for a subsequent invocation of summarization. The first parameter
specifies the number of sentences to be returned. The second parameter
specifies what to include in the key_item descriptors which store
individual sentences in the summarization results. Here, we use false
to indicate that both sentence offsets and sentence text should be
included.

5 Constructs an instance phrase_out_options of the
summarization_phrase_output class, thus specifying the desired output,
with respect to key phrases, for a subsequent invocation of
summarization. The first parameter specifies the number of key phrases
to be returned. The second parameter specifies what to include in the
key_item descriptors which store individual key phrases in the
summarization results. Here, we use false to indicate that both phrase
offsets and phrase text should be included.

6 Loops through the vector filename of files to be summarized,
summarizing each file. Each time around the loop ...

7 Constructs an instance summary of the summarization class, thus
actually carrying out summarization and key phrase extraction for the
current file. Input
parameters are the summarizer instance of the summarizer class created
earlier in the code the fstream instance of the byte_stream class
created earlier
the in_options instance of the summarization_input_options class
created earlier the sent_out_options instance of the
summarization_sentence_output
class created earlier the phrase_out_options instance of the
summarization_phrase_output class created earlier

8 Prints the number of key sentences in the result instance summary,
as obtained by the summary.number_of_key_sentences() method.

9 Loops through the summary (“key”) sentences of the result instance
summary, printing the text of each. Each summary sentence is
encapsulated in a key_item
instance. For each summary sentence, the text is obtained by the
item_text() method of the current key_item instance indicated by the
iterator.

10 (summary sentences loop, continued)

11 Prints the number of key phrases in the result instance summary, as
obtained by the summary.number_of_key_phrases() method.
12 Loops through the key phrases of the result instance summary,
printing the text of each. Each key phrase is encapsulated in a
key_item instance.
For each phrase, the text is obtained by the item_text() method of the
current key_item instance indicated by the iterator.

13 (key phrases loop, continued)
Closes key phrases loop and filename loop.

The verbose out put from g++ :
[exec] Reading specs from C:/mingw/bin/../lib/gcc/mingw32/3.4.5/specs
[exec] Configured with: ../gcc-3.4.5/configure --with-gcc --with-gnu-
ld --with-gnu-as --host=mingw32 --target=mingw32 --prefix=/mingw --
enable-threads --disable-nls --enable-languages=c,c+
+,f77,ada,objc,java --disable-win32-registry --disable-shared --enable-
sjlj-exceptions --enable-libgcj --disable-java-awt --without-x --
enable-java-gc=boehm --disable-libgcj-debug --enable-interpreter --
enable-hash-synchronization --enable-libstdcxx-debug
[exec] Thread model: win32
[exec] gcc version 3.4.5 (mingw special)
[exec]  C:/mingw/bin/../libexec/gcc/mingw32/3.4.5/collect2.exe --
shared -Bdynamic -e _DllMainCRTStartup@12 --enable-auto-image-base -o
native/jsummaraizer.dll C:/mingw/bin/../lib/gcc/mingw32/3.4.5/../../../
dllcrt2.o C:/mingw/bin/../lib/gcc/mingw32/3.4.5/crtbegin.o -LD:\Servers
\SummarizerServer\libs -LC:/mingw/bin/../lib/gcc/mingw32/3.4.5 -LC:/
mingw/bin/../lib/gcc -LC:/mingw/bin/../lib/gcc/
mingw32/3.4.5/../../../../mingw32/lib -LC:/mingw/bin/../lib/gcc/
mingw32/3.4.5/../../.. build/jsummarizer.o build/jsummarizer.def -
lsummarizer37 -lplatform37 -lstdc++ -lmingw32 -lgcc -lmoldname -
lmingwex -lmsvcrt -luser32 -lkernel32 -ladvapi32 -lshell32 -lmingw32 -
lgcc -lmoldname -lmingwex -lmsvcrt C:/mingw/bin/../lib/gcc/
mingw32/3.4.5/crtend.o

The following are the warning from compiling:
[exec] In file included from include/inxight-suballoc.h:5,
[exec]                  from include/inxight-sequence.h:29,
[exec]                  from include/inxight-summarizer.h:7,
[exec]                  from source/jsummarizer.cc:2:
[exec] include/inxight-memory.h:6: warning: ignoring #pragma warning
[exec] In file included from include/inxight-summarizer.h:11,
[exec]                  from source/jsummarizer.cc:2:
[exec] include/inxight-failure.h:61: warning: ignoring #pragma
warning
[exec] include/inxight-failure.h:95: warning: ignoring #pragma
warning
[exec] include/inxight-failure.h:301: warning: ignoring #pragma
warning
[exec] include/inxight-failure.h:307: warning: ignoring #pragma
warning
[exec] include/inxight-failure.h:451: warning: ignoring #pragma
warning
[exec] include/inxight-failure.h:457: warning: ignoring #pragma
warning

The .o file is produced but the dll is not.
as you can see from the sample program and walk-through the vendor
doesn't call these methods either.
The compiler has no trouble compiling my JNI C++ code when I call the
same functions they do.
The linker can't seem to resolve those symbols even though they are
exported and has no problems with the
functions I do use even though they are not exported.
Would be glad to post or send by other means the ant build.xml, Java
and C++ source, and headers.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]