/usr/bin/ld: cannot find -lintl

Hi,

these are my system configurations:

Ubuntu Server 12.04

Web Server Apache2

Mysql

Tomcat7

perl, libhtml-parser-perl, libxml-parser-perl, gcc, g++, openjdk-7-jdk, openjdk-7-jre packages installed.

I'm trying to use the CppTddPlugin but when I do my submition I get a compiling error which report something like that, in the ant.log file:

 

------------------------------------------------------------------------------------------------------------------------------
bullseye.properties:

mac.properties:

nonmac.properties:

assert.o:

init:

clean:
     [echo] basedir = /tmp/tomcat7-tomcat7-tmp/Unipi/admin
     [echo] timeout = 60000 (for each of two test runs)
     [echo] env.COVFILE = /home/webcat/Unipi/SummerII2012/SLV/Ex1/admin/24/Results/test.cov
     [echo] env.Path = ${env.Path}
     [echo] cxxtest.symreader.dir = /home/webcat/UserScripts/Unipi/admin/CppTddPlugin/cxxtest/bfd
    [mkdir] Created dir: /home/webcat/Unipi/SummerII2012/SLV/Ex1/admin/24/Results/bin

generateStudentMain:

enable.coverage:

disable.coverage:

compile:
       [cc] 2 total files to be compiled.
       [cc] In file included from /home/webcat/UserScripts/Unipi/admin/CppTddPlugin/cxxtest/cxxtest/Root.cpp:478:0,
       [cc]                  from /home/webcat/Unipi/SummerII2012/SLV/Ex1/admin/24/Results/bin/runStudentTests.cpp:45:
       [cc] /home/webcat/UserScripts/Unipi/admin/CppTddPlugin/cxxtest/chkptr_table.cpp: In member function ‘virtual void ChkPtr::__checked_pointer_table::__stderr_reporter::report(const void*, size_t, const char*, int)’:
       [cc] /home/webcat/UserScripts/Unipi/admin/CppTddPlugin/cxxtest/chkptr_table.cpp:155:44: warning: format not a string literal and no format arguments [-Wformat-security]
       [cc] Starting link
       [cc] /usr/bin/ld: cannot find -lintl
       [cc] collect2: ld returned 1 exit status

BUILD FAILED
/home/webcat/UserScripts/Unipi/admin/CppTddPlugin/build.xml:196: gcc failed with return code 1
------------------------------------------------------------------------------------------------------------------------------

It seams that it has missing the "intl" library.

I tried to install the package gettext but it doesn't solved the problem.

Thanks in advantages.

Groups:

Comments

tsalvini

SOLVED

We solved it by removing the "intl" from build.xml and using fprintf instead of fiprintf.

Thanks Anyway.

Stephen Edwards

Correct solution

Yes, that is the correct solution.  I need to roll this back into the release version of the plug-in, but haven't done so yet.  I believe I also ended up fixing the report formatting so the generated feedback does not look quite as odd.

Andrew Sayler

Still An Issue?

I just had to repeat this soltuion in a fresh WebCat install atop Ubuntu 12.04 (which deosn't seem to have any support for libintl in the repos). Has this not been patched upstream yet?

sunshine

The new error appeared

 

These are my system configurations:

Ubuntu 11.10, Mysql, Tomcat7, perl, libhtml-parser-perl, libxml-parser-perl, gcc4.4.6, g++4.4.6, jdk1.7.0_45 packages installed.

After removing intl library reference and replacing fiprintf with fprintf in the assert.c file inside the CppTddPlugin folder and then deleting the assert.o file, I've run into an error I don't know how to solve.

-------------------------------------------------------------------------------------------------------------------------------------------------

bullseye.properties:

mac.properties:

nonmac.properties:

assert.o:

init:

clean:

     [echo] basedir = /opt/tomcat/temp/XJTU/stt

     [echo] timeout = 60000 (for each of two test runs)

     [echo] env.COVFILE = /home/webcat_temp/XJTU/Fall2013/cs002/ProgramC1/stt/8/Results/test.cov

     [echo] env.Path = ${env.Path}

     [echo] cxxtest.symreader.dir = /home/webcat_temp/UserScripts/XJTU/admin/CppTddPlugin/cxxtest/bfd

    [mkdir] Created dir: /home/webcat_temp/XJTU/Fall2013/cs002/ProgramC1/stt/8/Results/bin

cxxtest/bfd

    [mkdir] Created dir: /home/webcat_temp/XJTU/Fall2013/cs002/ProgramC1/stt/8/Results/bin

generateStudentMain:

enable.coverage:

disable.coverage:

compile:

       [cc] 2 total files to be compiled.

       [cc] In file included from /home/webcat_temp/UserScripts/XJTU/admin/CppTddPlugin/cxxtest/cxxtest/Root.cpp:478,

       [cc]                  from /home/webcat_temp/XJTU/Fall2013/cs002/ProgramC1/stt/8/Results/bin/runStudentTests.cpp:65:

       [cc] /home/webcat_temp/UserScripts/XJTU/admin/CppTddPlugin/cxxtest/chkptr_table.cpp: In member function ‘virtual void ChkPtr::__checked_pointer_table::__stderr_reporter::report(const void*, size_t, const char*, int)’:

       [cc] /home/webcat_temp/UserScripts/XJTU/admin/CppTddPlugin/cxxtest/chkptr_table.cpp:155: warning: format not a string literal and no format arguments [-Wformat-security]

       [cc] Starting link

run.student.tests:

     [exec] Running 7 tests.......OK!

     [exec] No memory leaks detected.

     [exec] 

     [exec] Memory usage statistics:

     [exec] --------

     [exec] Total memory allocated during execution:   35 bytes

     [exec] Maximum memory in use during execution:    35 bytes

     [exec] Number of calls to new:                    2

     [exec] Number of calls to delete (non-null):      2

     [exec] Number of calls to new[]:                  0

     [exec] Number of calls to delete[] (non-null):    0

     [exec] Number of calls to delete/delete[] (null): 0

test:

generateInstructorMain:

compileInstructorTests:

    [mkdir] Created dir: /opt/tomcat/temp/XJTU/stt/__

   [delete] Deleting: /home/webcat_temp/XJTU/Fall2013/cs002/ProgramC1/stt/8/Results/bin/runStudentTests.o

       [cc] 2 total files to be compiled.

       [cc] g++: "-DHINT_PREFIX=\"hint: \"":No such file or directory

       [cc] g++: "-DMW_PREFIX=\"/=MEMWATCH=/: \"":No such file or directory

       [cc] In file included from /home/webcat_temp/UserScripts/XJTU/admin/CppTddPlugin/cxxtest/cxxtest/Root.cpp:478,

       [cc]                  from /home/webcat_temp/XJTU/Fall2013/cs002/ProgramC1/stt/8/Results/bin/runInstructorTests.cpp:65:

       [cc] /home/webcat_temp/UserScripts/XJTU/admin/CppTddPlugin/cxxtest/chkptr_table.cpp: In member function ‘virtual void ChkPtr::__checked_pointer_table::__stderr_reporter::report(const void*, size_t, const char*, int)’:

       [cc] /home/webcat_temp/UserScripts/XJTU/admin/CppTddPlugin/cxxtest/chkptr_table.cpp:155: warning: format not a string literal and no format arguments [-Wformat-security]

BUILD FAILED

/home/webcat_temp/UserScripts/XJTU/admin/CppTddPlugin/build.xml:293: g++ failed with return code 1

Total time: 7 seconds

------------------------------------------------------------------------------------------------------------------------------------------------

Any help is very appreciated.Thanks.

 

mbertini

edit

  1. edit  cxxtest/chkptr_table.cpp to change:
    printf(getStackTrace(true, CHKPTR_STACK_WINDOW_SIZE, (CxxTest::StackElem*)(((char*)address) + size), CHKPTR_STACK_TRACE_INITIAL_PREFIX, CHKPTR_STACK_TRACE_OTHER_PREFIX).c_str()); 
    into 
    printf("%s\n",getStackTrace(true, CHKPTR_STACK_WINDOW_SIZE, (CxxTest::StackElem*)(((char*)address) + size), CHKPTR_STACK_TRACE_INITIAL_PREFIX, CHKPTR_STACK_TRACE_OTHER_PREFIX).c_str());
  2. edit CppTddPlugin/build.xml to change the quotes of HINT_PREFIX and MW_PREFIX into (see the use of ' and "):
    <compilerarg value='-DHINT_PREFIX="hint: "'></compilerarg> 
    <compilerarg value='-DMW_PREFIX="/=MEMWATCH=/: "'></compilerarg>
    These latter instructions should help to install Web-CAT on modern Ubuntu distro.
sunshine

Thanks for your help!

Thanks for your help! Web-Cat is now using successful!

swansonja

Is this still an issue?

I am working on a web-CAT server to which I do not have administrative access.  So I have a few questions I would like to have answered before approaching my administrator.

1. Is this still an issue with the plugin.  It is definitely an issue on the server I am using, but could it be corrected by re-downloading and reconfiguring the plugin.

2. For the original solution, which files were edited to replace fiprintf with fprintf?

3. If I must change the code as listed above, does this mean I have to recompile web-CAT or is this a portion of code that gets compiled on every submission.  Will simply making the changes to the files listed above solve the problem or is there more work that needs to be done.

Thank you