[cs33211] CS33211 Project 1 Error

Mikhail Nesterenko mikhail at cs.kent.edu
Wed Oct 3 16:38:50 EDT 2012



> I'm in your CS33211 Operating Systems class. I have a problem when
> running part 1 of project 1 on the neptune/poseidon server. I'm able
> to compile my code, but when I run it I receive the following error:
> 
> -bash-4.1$ /local/opt/gcc/bin/g++ -Wall -std=c++11 -pthread
> -L/local/opt/lib -I/local/opt/include wordprint.cpp
> -bash-4.1$ ./a.out
> ./a.out: /usr/lib/libstdc++.so.6: version `GLIBCXX_3.4.14' not found
> (required by ./a.out)
> 
> I do have the additional line of code at the top necessary for yield()
> to run properly on Linux machines, and I am able to run this code in
> Visual Studio 2012 with no problems. Is there something else I should
> be including when compiling?

The /local/opt/gcc/lib/libstdc++.so.6 library is linked to load
dynamically (attached at run-time). However, at run-time, the loader
(ldd) cannot find this library since it is not configured to look into
/local/opt/gcc/lib

There are two ways you can fix the problem:

1. Configure the loader to look into appropriate directory.  For
   example attach: /local/opt/gcc/lib to LD_LIBRARY_PATH environment
   variable

2. link the library statically. You can pass the static version of
   the library to the compiler (which will pass it on to th elinker):

   /local/opt/gcc/bin/g++ .... wordprint.cpp  /local/opt/gcc/lib/libstdc++.a

   Note the library extension .a  <-- it is a static library.

Thanks,
-- 
Mikhail


More information about the cs33211 mailing list