Last active
September 2, 2017 15:53
-
-
Save chrahunt/4dfd9ce6f179a3091ffd2341ce6fc8e7 to your computer and use it in GitHub Desktop.
Reproduction for vgvassilev/cling#160
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"cells": [ | |
{ | |
"cell_type": "markdown", | |
"metadata": {}, | |
"source": [ | |
"# First attempt (failure)\n", | |
"\n", | |
"Libraries are in correct load order, but seem not to resolve correctly when there are inter-dependencies (`boost_filesystem` depends on `boost_system`)." | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"execution_count": 1, | |
"metadata": {}, | |
"outputs": [ | |
{ | |
"data": { | |
"text/plain": [] | |
}, | |
"execution_count": 1, | |
"metadata": {}, | |
"output_type": "execute_result" | |
} | |
], | |
"source": [ | |
".I /usr/include\n", | |
".L /usr/lib/x86_64-linux-gnu/libboost_system.so.1.58.0\n", | |
".L /usr/lib/x86_64-linux-gnu/libboost_filesystem.so.1.58.0" | |
] | |
}, | |
{ | |
"cell_type": "markdown", | |
"metadata": {}, | |
"source": [ | |
"Separated into 2 cells per [#148](https://github.com/vgvassilev/cling/issues/148)." | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"execution_count": 2, | |
"metadata": {}, | |
"outputs": [ | |
{ | |
"name": "stderr", | |
"output_type": "stream", | |
"text": [ | |
"IncrementalExecutor::executeFunction: symbol '_ZN5boost6system16generic_categoryEv' unresolved while linking function '_GLOBAL__sub_I_cling_module_1'!\n", | |
"You are probably missing the definition of boost::system::generic_category()\n", | |
"Maybe you need to load the corresponding shared library?\n", | |
"IncrementalExecutor::executeFunction: symbol '_ZN5boost6system15system_categoryEv' unresolved while linking function '_GLOBAL__sub_I_cling_module_1'!\n", | |
"You are probably missing the definition of boost::system::system_category()\n", | |
"Maybe you need to load the corresponding shared library?\n" | |
] | |
}, | |
{ | |
"data": { | |
"text/plain": [] | |
}, | |
"execution_count": 2, | |
"metadata": {}, | |
"output_type": "execute_result" | |
} | |
], | |
"source": [ | |
"#include <boost/filesystem.hpp>\n", | |
"#include <iostream>" | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"execution_count": 3, | |
"metadata": {}, | |
"outputs": [ | |
{ | |
"name": "stderr", | |
"output_type": "stream", | |
"text": [ | |
"IncrementalExecutor::executeFunction: symbol '_ZN5boost10filesystem6detail9file_sizeERKNS0_4pathEPNS_6system10error_codeE' unresolved while linking [cling interface function]!\n", | |
"You are probably missing the definition of boost::filesystem::detail::file_size(boost::filesystem::path const&, boost::system::error_code*)\n", | |
"Maybe you need to load the corresponding shared library?\n" | |
] | |
}, | |
{ | |
"data": { | |
"text/plain": [] | |
}, | |
"execution_count": 3, | |
"metadata": {}, | |
"output_type": "execute_result" | |
} | |
], | |
"source": [ | |
"std::cout << static_cast<unsigned long>(boost::filesystem::file_size(\"/bin/sh\")) << \"\\n\";" | |
] | |
}, | |
{ | |
"cell_type": "markdown", | |
"metadata": {}, | |
"source": [ | |
"# Second attempt (success)\n", | |
"\n", | |
"Restarted kernel then evaluated the cells below, which succeeds" | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"execution_count": 1, | |
"metadata": {}, | |
"outputs": [ | |
{ | |
"data": { | |
"text/plain": [] | |
}, | |
"execution_count": 1, | |
"metadata": {}, | |
"output_type": "execute_result" | |
} | |
], | |
"source": [ | |
".I /usr/include\n", | |
".L /usr/lib/x86_64-linux-gnu/libboost_system.so.1.58.0" | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"execution_count": 2, | |
"metadata": {}, | |
"outputs": [ | |
{ | |
"data": { | |
"text/plain": [] | |
}, | |
"execution_count": 2, | |
"metadata": {}, | |
"output_type": "execute_result" | |
} | |
], | |
"source": [ | |
".L /usr/lib/x86_64-linux-gnu/libboost_filesystem.so.1.58.0" | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"execution_count": 3, | |
"metadata": {}, | |
"outputs": [ | |
{ | |
"data": { | |
"text/plain": [] | |
}, | |
"execution_count": 3, | |
"metadata": {}, | |
"output_type": "execute_result" | |
} | |
], | |
"source": [ | |
"#include <boost/filesystem.hpp>\n", | |
"#include <iostream>" | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"execution_count": 4, | |
"metadata": {}, | |
"outputs": [ | |
{ | |
"name": "stdout", | |
"output_type": "stream", | |
"text": [ | |
"154072\n" | |
] | |
}, | |
{ | |
"data": { | |
"text/plain": [ | |
"(std::basic_ostream<char, std::char_traits<char> > &) @0x7fa9b1eb3f40\n" | |
] | |
}, | |
"execution_count": 4, | |
"metadata": {}, | |
"output_type": "execute_result" | |
} | |
], | |
"source": [ | |
"std::cout << static_cast<unsigned long>(boost::filesystem::file_size(\"/bin/sh\")) << \"\\n\";" | |
] | |
} | |
], | |
"metadata": { | |
"kernelspec": { | |
"display_name": "C++11", | |
"language": "", | |
"name": "cling-cpp11" | |
}, | |
"language_info": { | |
"codemirror_mode": "c++", | |
"file_extension": ".c++", | |
"mimetype": "text/x-c++src", | |
"name": "c++" | |
} | |
}, | |
"nbformat": 4, | |
"nbformat_minor": 2 | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment