Skip to content

Compile Error in Xreg GraphGen using Docker #6

@m-baader

Description

@m-baader

Hi all,

I cannot compile GraphGen inside Docker, due to an error: 'shared_ptr' is not a member of 'std'.

Here is the transcript of everything I did:

$ docker run -it therealcaoyudong/qtorch
root@1a60ed7013b4:/# cd root/qtorch/
root@1a60ed7013b4:~/qtorch# make all


 Compiling All Executables - Note that nlopt-2.4.2 must be installed successfully to compile.....

make[1]: Entering directory '/root/qtorch'


 Compiling qtorch .....

make[1]: Leaving directory '/root/qtorch'
make[1]: Entering directory '/root/qtorch'


 Compiling Test Executable .....
make[1]: Leaving directory '/root/qtorch'
make[1]: Entering directory '/root/qtorch'


 Compiling QAOA MaxCut - Note that nlopt-2.4.2 must be installed successfully to compile .....

cp: cannot create regular file '/root/usr/local/bin': No such file or directory
Makefile:62: recipe for target 'cut' failed
make[1]: *** [cut] Error 1
make[1]: Leaving directory '/root/qtorch'
Makefile:28: recipe for target 'all' failed
make: *** [all] Error 2
root@1a60ed7013b4:~/qtorch# mkdir -p /root/usr/local/bin    # Create directory to fix above error
root@1a60ed7013b4:~/qtorch# make all


 Compiling All Executables - Note that nlopt-2.4.2 must be installed successfully to compile.....

make[1]: Entering directory '/root/qtorch'


 Compiling qtorch .....

make[1]: Leaving directory '/root/qtorch'
make[1]: Entering directory '/root/qtorch'


 Compiling Test Executable .....
make[1]: Leaving directory '/root/qtorch'
make[1]: Entering directory '/root/qtorch'


 Compiling QAOA MaxCut - Note that nlopt-2.4.2 must be installed successfully to compile .....

make[1]: Leaving directory '/root/qtorch'
root@1a60ed7013b4:~/qtorch# cd Xreg\ GraphGen/
root@1a60ed7013b4:~/qtorch/Xreg GraphGen# make all
g++ -g -std=c++11 main.cpp -o main
In file included from main.cpp:2:0:
GraphNode.h:13:17: error: 'shared_ptr' is not a member of 'std'
     std::vector<std::shared_ptr<GraphNode>> mConnections;
                 ^
GraphNode.h:13:17: error: 'shared_ptr' is not a member of 'std'
GraphNode.h:13:33: error: template argument 1 is invalid
     std::vector<std::shared_ptr<GraphNode>> mConnections;
                                 ^
GraphNode.h:13:33: error: template argument 2 is invalid
GraphNode.h:13:42: error: expected unqualified-id before '>' token
     std::vector<std::shared_ptr<GraphNode>> mConnections;
                                          ^
main.cpp:10:23: error: 'shared_ptr' is not a member of 'std'
 bool alreadyConnected(std::shared_ptr<GraphNode> a, std::shared_ptr<GraphNode> b)
                       ^
main.cpp:10:48: error: expected primary-expression before '>' token
 bool alreadyConnected(std::shared_ptr<GraphNode> a, std::shared_ptr<GraphNode> b)
                                                ^
main.cpp:10:50: error: 'a' was not declared in this scope
 bool alreadyConnected(std::shared_ptr<GraphNode> a, std::shared_ptr<GraphNode> b)
                                                  ^
main.cpp:10:53: error: 'shared_ptr' is not a member of 'std'
 bool alreadyConnected(std::shared_ptr<GraphNode> a, std::shared_ptr<GraphNode> b)
                                                     ^
main.cpp:10:78: error: expected primary-expression before '>' token
 bool alreadyConnected(std::shared_ptr<GraphNode> a, std::shared_ptr<GraphNode> b)
                                                                              ^
main.cpp:10:80: error: 'b' was not declared in this scope
 bool alreadyConnected(std::shared_ptr<GraphNode> a, std::shared_ptr<GraphNode> b)
                                                                                ^
main.cpp:10:81: error: expression list treated as compound expression in initializer [-fpermissive]
 bool alreadyConnected(std::shared_ptr<GraphNode> a, std::shared_ptr<GraphNode> b)
                                                                                 ^
main.cpp:11:1: error: expected ',' or ';' before '{' token
 {
 ^
Makefile:2: recipe for target 'all' failed
make: *** [all] Error 1
root@1a60ed7013b4:~/qtorch/Xreg GraphGen#

Is there a quick fix for this?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions