Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

error: ‘mt19937’ in namespace ‘boost::random’ does not name a type #4

Closed
krayc425 opened this issue Mar 27, 2020 · 2 comments
Closed

Comments

@krayc425
Copy link

Hi venkatarun,

When compiling this repo, I encounter the problem that says:

krayc@ubuntu:~/Desktop/genericCC$ makepp
makepp: Loading makefile `/home/krayc/Desktop/genericCC/makefile'
makepp: Entering directory `/home/krayc/Desktop/genericCC'
protoc --cpp_out=. protobufs-default/dna.proto
makepp: Scanning `/home/krayc/Desktop/genericCC/protobufs-default/dna.pb.cc'
makepp: Scanning `/home/krayc/Desktop/genericCC/protobufs-default/dna.pb.h'
g++ -I.. -I. -O2 -fPIC -c protobufs-default/dna.pb.cc -o protobufs-default/dna.pb.o
makepp: Scanning `/home/krayc/Desktop/genericCC/estimators.cc'
makepp: Scanning `/home/krayc/Desktop/genericCC/estimators.hh'
g++ -I./protobufs-default -I./udt -DHAVE_CONFIG_H -std=c++11 -pthread -pedantic -Wall -Wextra -Weffc++ -Werror -fno-default-inline -g -O2 -fPIC -c estimators.cc -o estimators.o
makepp: Scanning `/home/krayc/Desktop/genericCC/markoviancc.cc'
makepp: Scanning `/home/krayc/Desktop/genericCC/markoviancc.hh'
makepp: warning: can't locate file random.h, included from `/home/krayc/Desktop/genericCC/markoviancc.hh'
Include path [user] is:
  [including file's directory]
  /home/krayc/Desktop/genericCC/protobufs-default
  /home/krayc/Desktop/genericCC/udt
  /usr/local/include
  /usr/include
makepp: Scanning `/home/krayc/Desktop/genericCC/ccc.hh'
makepp: Scanning `/home/krayc/Desktop/genericCC/random.hh'
makepp: Scanning `/home/krayc/Desktop/genericCC/rtt-window.hh'
g++ -I./protobufs-default -I./udt -DHAVE_CONFIG_H -std=c++11 -pthread -pedantic -Wall -Wextra -Weffc++ -Werror -fno-default-inline -g -O2 -fPIC -c markoviancc.cc -o markoviancc.o
In file included from markoviancc.hh:10:0,
                 from markoviancc.cc:3:
random.hh:8:9: error: ‘mt19937’ in namespace ‘boost::random’ does not name a type
 typedef boost::random::mt19937 PRNG;
         ^
random.hh:10:8: error: ‘PRNG’ does not name a type
 extern PRNG & global_PRNG();
        ^
makepp: error: Failed to build target `/home/krayc/Desktop/genericCC/markoviancc.o' [1]
makepp: 3 files updated, 0 phony targets built and 1 target failed

Is there a clue to solve this? I am using Ubuntu 12.04, g++ version is 4.6.3. Is it possible that the g++ version is too old? But I am trying to run an experiment with it in Mininet, which only supports Ubuntu 12.04 (Linux kernel 3.13.0).

Thanks in advance!

Kuixi

@venkatarun95
Copy link
Owner

Hi Kuixi,

This indeed a version issue which can be easily fixed. Here's what I did:

I tried reproducing your issue with Amazon AMI Ubuntu 12.04.1 LTS (Precise Pangolin) - Docker (ami-41cece28)

First thing I noticed was that g++ was outdated and didn't support C++11. I am surprised your build went that far at all. So I updated to g++-6 with
sudo add-apt-repository ppa:ubuntu-toolchain-r/test
sudo apt-get update
sudo apt-get install g++-6

I changed the g++ version in makepp by changing line 3 in makefile to be CXX := g++-6. I also changed g++ in line 31 to $(CXX) (pushed a commit to fix this)

Boost is also outdated, so install new versions as sudo apt-get install libboost1.48-dev libboost-python1.48-dev

Summary
Install g++-6 and libboost 1.48
Change line 3 of makepp to be CXX := g++-6

It works for me now. Let me know if you face further issues

@krayc425
Copy link
Author

makepp works now! Thanks you so much! <3

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants