Re: [Boost-users] Boost-users Digest, Vol 5315, Issue 1
@Gavin @Edward: Success! The program is now executing as expected, *thanks to all of your helpful suggestions.* Here's what I did: 1. added --with-chrono to my b2 command, which placed .a and .dylib files for chrono in stage/lib. 2. after invoking the following compiler command: g++ -v -Wall -L ${BOOST_ROOT}/stage/lib -lboost_chrono -lboost_date_time -lboost_system -lboost_system -I${BOOST_ROOT} -o main main.cpp I added to my RPATH using install_name_tool: sudo install_name_tool -add_rpath ${BOOST_ROOT}/stage/lib main
From what I have read from this article here: https://medium.com/@donblas/fun-with-rpath-otool-and-install-name-tool-e3e41... This command appends to the RPATH (@rpath), which is used by LC_LOAD_DYLIB to locate shared library dependencies for the executable.
After executing these two commands, my program runs successfully! *Thank
you.* However, the learning never ends. That said, I have a bit of an
unrelated follow-up question if that is okay. If not, feel free to shun me
and I will look elsewhere for an answer.
Running these two commands from my terminal is painful and tedious. For
troubleshooting, I don't mind, but I want to move toward automation.
1. I tried putting these two commands into a simple script. When I ran the
script, main could not be found. *How would I ensure that the main
executable from the g++ invocation is outputted into the cwd before the
install_name_tool command is executed?*
The script I wrote here is just for the sake of experimentation and
learning. Ideally, I would use a build tool (i.e. make) for this sort of
thing, which I am actually reading about right now.
It should be okay to close this issue after my last question is
answered/shunned.
Thanks again for all of your helpful suggestions, I am starting to like
this community already.
- AJ
On Fri, Jan 31, 2020 at 4:01 AM
Send Boost-users mailing list submissions to boost-users@lists.boost.org
To subscribe or unsubscribe via the World Wide Web, visit https://lists.boost.org/mailman/listinfo.cgi/boost-users or, via email, send a message with subject or body 'help' to boost-users-request@lists.boost.org
You can reach the person managing the list at boost-users-owner@lists.boost.org
When replying, please edit your Subject line so it is more specific than "Re: Contents of Boost-users digest..."
Today's Topics:
1. [Newbie][Interprocess] Placing a boost interprocess vector in an existing (not managed) shared memory (Gaier, Bjoern) 2. Re: [Boost.Asio] tutorial #1 code does not compile (g++) (Andrew McFarlane) 3. Re: [Boost.Asio] tutorial #1 code does not compile (g++) (Edward Diener) 4. Re: [Boost.Asio] tutorial #1 code does not compile (g++) (Gavin Lambert)
----------------------------------------------------------------------
Message: 1 Date: Thu, 30 Jan 2020 08:19:02 +0000 From: "Gaier, Bjoern"
To: "boost-users@lists.boost.org" Subject: [Boost-users] [Newbie][Interprocess] Placing a boost interprocess vector in an existing (not managed) shared memory Message-ID: < OSAPR01MB3171A3A1ED46336ACEDE2786E2040@OSAPR01MB3171.jpnprd01.prod.outlook.com Content-Type: text/plain; charset="iso-8859-1"
Hello Boost-Mailing-List,
I have a question about the boost interprocess library - and I hope I can explain it correctly.
I looked at the "Quick guide for the impatient" about the interprocess library - but I'm not sure if I can use this for our purpose. The main goal is to insert a STL vector (or different container) in a predefined portion of an already existing shared memory. The main problem is, that we cannot use the managed_shared_memory code from boost, because we rely on a different API to allocate the shared memory between Windows and other devices. Also the container should be placed at a fixed offset inside the created shared memory.
I'm a complete newbie with boost and the interprocess library, that is why I'm not sure which interface I have to provide for the interprocess vector to be setup correctly. I hoped I could do something like:
new (srh_mem_base + offset) boost::interprocess::vector<allocator>;
I tried looking into the headers of the library to get an idea of that, but I honestly got lost.
I'm really sorry if this a stupid or obvious question - and I thank for any help in advance!
Kind greetings Bj?rn Als GmbH eingetragen im Handelsregister Bad Homburg v.d.H. HRB 9816, USt.ID-Nr. DE 114 165 789 Gesch?ftsf?hrer: Dr. Hiroshi Nakamura, Dr. Robert Plank, Markus Bode, Heiko Lampert, Takashi Nagano, Takeshi Fukushima. Junichi Tajika
participants (1)
-
Andrew McFarlane