Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: VS2005 C++/CLI JNI DLL
Hi every one.
I have read a document from nist website (http://csrc.nist.gov/groups/ST/toolkit/rng/documentation_software.html) in this document said that" With minor modifications, source code may be ported to different platforms. The NIST source code was ported to a Windows XP system running Visual Studio 2005 compiler".(that the source code compile with gcc compiler) and so I compile the source code in VC++ but take 6Warning and when Irun the program take 7 Error!?
I need the dll format from these source code and using them with jni.
Please help me. I have to resolve this problem.
Posted 12-Jul-11 17:51pm
Comments
Christian Graus at 13-Jul-11 0:35am
   
Well, perhaps a starting point is to tell us what code has the errors, and what the errors are ?
saideharabani at 13-Jul-11 3:54am
   
I have download sts2.1.1 codes. The assess.c is in here:
#include
#include
#include
#include
#include "../include/decls.h"
#include "../include/cephes.h"
#include "../include/utilities.h"
 
void partitionResultFile(int numOfFiles, int numOfSequences, int option, int testNameID);
void postProcessResults(int option);
int cmp(const double *a, const double *b);
int computeMetrics(char *s, int test);
 
int
main(int argc, char *argv[])
{
int i;
int option; /* TEMPLATE LENGTH/STREAM LENGTH/GENERATOR*/
char *streamFile; /* STREAM FILENAME */

 
if ( argc != 2 ) {
printf("Usage: %s \n", argv[0]);
printf(" is the length of the individual bit stream(s) to be processed\n");
return 0;
}
 
tp.n = atoi(argv[1]);
tp.blockFrequencyBlockLength = 128;
tp.nonOverlappingTemplateBlockLength = 9;
tp.overlappingTemplateBlockLength = 9;
tp.approximateEntropyBlockLength = 10;
tp.serialBlockLength = 16;
tp.linearComplexitySequenceLength = 500;
tp.numOfBitStreams = 1;
option = generatorOptions(&streamFile);
chooseTests();
fixParameters();
openOutputStreams(option);
invokeTestSuite(option, streamFile);
fclose(freqfp);
for( i=1; i<=NUMOFTESTS; i++ ) {
if ( stats[i] != NULL )
fclose(stats[i]);
if ( results[i] != NULL )
fclose(results[i]);
}
if ( (testVector[0] == 1) || (testVector[TEST_CUSUM] == 1) )
partitionResultFile(2, tp.numOfBitStreams, option, TEST_CUSUM);
if ( (testVector[0] == 1) || (testVector[TEST_NONPERIODIC] == 1) )
partitionResultFile(MAXNUMOFTEMPLATES, tp.numOfBitStreams, option, TEST_NONPERIODIC);
if ( (testVector[0] == 1) || (testVector[TEST_RND_EXCURSION] == 1) )
partitionResultFile(8, tp.numOfBitStreams, option, TEST_RND_EXCURSION);
if ( (testVector[0] == 1) || (testVector[TEST_RND_EXCURSION_VAR] == 1) )
partitionResultFile(18, tp.numOfBitStreams, option, TEST_RND_EXCURSION_VAR);
if ( (testVector[0] == 1) || (testVector[TEST_SERIAL] == 1) )
partitionResultFile(2, tp.numOfBitStreams, option, TEST_SERIAL);
fprintf(summary, "------------------------------------------------------------------------------\n");
fprintf(summary, "RESULTS FOR THE UNIFORMITY OF P-VALUES AND THE PROPORTION OF PASSING SEQUENCES\n");
fprintf(summary, "------------------------------------------------------------------------------\n");
fprintf(summary, " generator is <%s>\n", streamFile);
fprintf(summary, "------------------------------------------------------------------------------\n");
fprintf(summary, " C1 C2 C3 C4 C5 C6 C7 C8 C9 C10 P-VALUE PROPORTION STATISTICAL TEST\n");
fprintf(summary, "------------------------------------------------------------------------------\n");
postProcessResults(option);
fclose(summary);
 
return 1;
}
 
void
partitionResultFile(int numOfFiles, int numOfSequences, int option, int testNameID)
{
int i, k, m, j, start, end, num, numread;
float c;
FILE **fp = (FILE **)calloc(numOfFiles+1, sizeof(FILE *));
int *results = (int *)calloc(numOfFiles, sizeof(int *));
char *s[MAXFILESPERMITTEDFORPARTITION];
char resultsDir[200];

for ( i=0; i
saideharabani at 13-Jul-11 4:04am
   
The errors are in here:
assess.obj : error LNK2001: unresolved external symbol _invokeTestSuite
assess.obj : error LNK2001: unresolved external symbol _openOutputStreams
assess.obj : error LNK2001: unresolved external symbol _fixParameters
assess.obj : error LNK2001: unresolved external symbol _chooseTests
assess.obj : error LNK2001: unresolved external symbol _generatorOptions
assess.obj : error LNK2001: unresolved external symbol _cephes_igamc
Debug/assess.exe : fatal error LNK1120: 6 unresolved externals
I have change the header to solve these errors but the errors have no reduce/change !!
Richard MacCutchan at 13-Jul-11 5:56am
   
These are linker errors which means you are missing some .obj or .lib files from your project. This has nothing to do with header files which are used by the compiler.
saideharabani at 13-Jul-11 6:13am
   
thanks but what can I do to solve this.
Richard MacCutchan at 13-Jul-11 6:19am
   
Add the relevant files to your project. If you do not understand the relationship of the various project files required to create this program then I suggest going back to your C++ documentation to read up on the subject.
saideharabani at 13-Jul-11 6:37am
   
see the 6 params or objs above(Those are unresolved) are in header files,OK. so I think the compiler can't load them and the program can't use them and those are unknown!
Richard MacCutchan at 13-Jul-11 6:48am
   
Unresolved items mean that you have references to some function(s) that exist elsewhere. They may be in the project in source files (not header files) which need to be built into the project. If they do not exist in the project and you do not have the object or library files that contain them, then you need to go back to the place you downloaded it from and ask the question there.

1 solution

Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

Look at the libraries specified in the linker options of the functioning code and make sure that all those are also specified in the linker options of the code giving you the errors. Like Richard mentioned, this looks like you're missing .libs.
  Permalink  

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
0 OriginalGriff 6,769
1 Sergey Alexandrovich Kryukov 6,338
2 DamithSL 5,408
3 Manas Bhardwaj 4,816
4 Maciej Los 4,195


Advertise | Privacy | Mobile
Web01 | 2.8.1411023.1 | Last Updated 13 Jul 2011
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100