Trying to access a string from a website c++ - c++

I've been trying to figure this out for the better part of the day, but due to my lack of knowledge of c++ and libraries, I've made little progress.
I'm trying to access a page that contains a single string, and basically read it.
I've attempted to use curl to access the internet, but I can't seem to be able to get it working. Then I came across this post that has a simple enough solution (post). I downloaded the zip file from the cpp-netlib link, extracted it to a folder containing a .cpp file with the provided code, and ran the g++ command. This is the error it's giving me:
testing.cpp:1:50: fatal error: boost/network/protocol/http/client.hpp: No such file or directory
Any idea what I can do? (for what it's worth, this code is meant to be cross-compiled and run on an omega-2 eventually).

Related

*Where* to replace ```sys/time.h``` header dependency in Windows?

I've been trying to install a package on my Windows machine using Git bash. I encounter the error: fatal error C1083: Cannot open include file: 'sys/time.h': No such file or directoryerror', which multiple StackOverflow questions try to address (see here, here2 and here3). There's no shortage of possible answers but no updated/current solutions.
By way, I came across a possible solution, offered by the link below, which suggests to create 3 files, time.h, times.h and times.cpp. The problem is, it's unclear to me where to place these three files - the author suggests to put them in the same "project folder" but this is unclear to me. I created a folder sys with these three files in the same project and tried to compile, to no avail. Is there something simple I'm overlooking?
https://www.codefull.net/2015/12/systime-h-replacement-for-windows/

Generating working CHM files using Doxygen and GraphViz (Invalid .hhc file?)

I'm in the middle of documenting my C++ GUI library and I just started using Doxygen. I've got two test files that are documented now, but I have problems when trying to generate the CHM help files. Doxygen runs without error, and dot appears to be functioning correctly to generate images.
However, it appears the resulting .hhc, .hhk, and .hhp files are broken in some way. index.hhc and index.hhk are exactly the same and running 'hhc index.hhp' does not work. It returns an error :
HHC6000: Error: An internal file could not be created. Make certain there is enough disk space on the drive where you are compiling your file.
HHC5007: Error: Fatal navigational compilation error. This is likely the result of an invalid contents (.hhc) file.
I have uploaded a zip file of my two test sources, the Doxyfile generated by the Doxy Wizard, and the .hh* files created by doxygen.
http://members.allegro.cc/EdgarReynaldo/temp/test1.zip
Both HTML Help Workshop and GraphViz are on my path.
Do I need to change a setting in the doxyfile? How do I fix this?
Regards, bugsquasher
EDIT
After taking albert 's advice, everything seemed to magically work. Nothing was really different though.

Ros: output in console

I'm a beginner in ROS and started to learn the basics. So I have installed ROS and I am going through some tutorials. I have created two nodes (publisher and subscriber). Actually I was doing this ROS.org tutorial
1: At Step 3. Building your nodes, I get an error if I type catkin_make. Everything is setup like in the tutorial but its not working.
The error is:
add_message_files() directory not found
And
Makefile:710: recipe for target 'cmake_check_build_system' failed
I don't know what to do here.
2: Is there a possibility to make an output without using launchfiles? I have looked it up and I noticed that you have to use launchfiles only if you want to run more than one node.
In this Youtube tutorial
6:06 min the guy is using a cout in his callback function. I have also tried it like him and I changed my cmakelists equally like his but I don't get an output in my terminal. He does. In the next part the guy is changing some parts in his cmakelists but it doesn't help to get an output in the terminal.
So my question summarized is: How do I use cout and ROS_INFO or ROS_DEBUG correctly?
Your CMakeLists.txt file contains add_message_files that has no
a path to .msg file (or wrong syntax)
Post your CMakeLists.txt if you want further help on that.
Launch files are merely .xml files that tells ROS system to run
specific node and make it easier to pass params or env
variables to nodes. you can run single node with rosrun command
or even finding its binary file (wherever u compiled or installed
it)
And of course you can cout it's C++ after all.
Also if you need help on ROS_<log_level> you can take a look at rosccp logging overview

Dart2JS Pub Build Fails to Traverse Project Folders Correctly

I'm working on a long-term project for some time now. After moving some folders around, correctly refactoring different parts of the code, Webstorm's Dart analyser is showing NO errors, but running either pub serve or pub build fails.
Pub or Dart2JS doesn't seems to be traversing folders correctly.
This is the first error I get:
[Error from Dart2JS on CS_Game_Engine|web/main.dart]:
web/UIElements/NodeSettingsItems/TextVariableEditor.dart:4:1:
Can't read 'file:///Data/ownCloud/cybersecgame/CS%20Game%20Engine/web/UIElements/Data/Variables/Variable.dart' (Could not find asset CS_Game_Engine|web/UIElements/Data/Variables/Variable.dart.).
import '../../Data/Variables/Variable.dart';
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
This is interesting, because the file TextVariableEditor.dart, as you see in the error, is located in the web/UIElements/NodeSettingsItems/ directory.
The file I am trying to access (Variables.dart) is located in web/Data/Variables/Variable.dart.
The import statement moves 2 folders up with the ../../, but Pub or Dart2JS is not going 2 folders up, its only going 1 folder up. See the error again:
Can't read 'file:///Data/ownCloud/cybersecgame/CS%20Game%20Engine/web/UIElements/Data/Variables/Variable.dart'
It's looking for the file in the wrong place. I'm not sure what to do to fix this, and I've looked around and can't really find anything. Again, Webstorm's Dart Analyzer shows no issues, but the pub build or pub serve both fail, unable to find the file.
I've used the ../../ many times before in my code, but this is the first time it is causing issues. There are other errors similar to this, but having the same issue of not reading the ../../ correctly.
Update 1:
I've done more testing, and adding an additional ../ to the path's beginning fixes the error during the pub build. However, now Webstorm and it's Dart Analyzer is showing lots of errors since the path is obviously wrong (1 too many ../). This is a workaround, but not a fix. Does anybody know why pub or the Dart2JS is reading the path incorrectly? Somehow skipping one of the ../?
Code within the web directory should only access files in two places:
Things in the web directory, via relative paths
Things in packages via package: imports
#2 is interesting. This can include files within your own project, you just need to put those files in the lib directory and access them via a package:my_proj URI.
See https://github.com/dart-lang/sample-pop_pop_win/ as an example
See also https://www.dartlang.org/tools/pub/package-layout

c++ boost library cannot open file

I tried to work with the boost library to read/write configuration files but I just don't get it.
I even can't run the example code from boost.org (5 Minute Tutorial)
http://www.boost.org/doc/libs/1_49_0/libs/property_tree/examples/debug_settings.cpp
I've downloaded the boost_1_49_0.zip package and unzipped it to my c++ program folder. The code compiles (TheIDE - U++) but it always says "Error: debug_settings.xml: cannot open file" which basically means that the program works, but runs into the exception.
I didn't change the code, I just copy and pasted it to get a working example which I could try to understand then. But I don't even get this one to work. (Since it's exactly the same as in the link, I don't paste the code here... unless you think it's better.)
Please help me... or point to a different way to store variables in a file with some kind of structure (I wan't to learn a way that works for windows and linux, because some of my apps are cross-platform.)
Thanks.
EDIT: debug_settings.xml is in the same folder as the .cpp file
EDIT2: Working now, the debug_settings.xml is now in the folder where the executable is stored. (in my case, U++/TheIDE it's C:\upp\out\MyApps\MINGW.Debug.Debug_Full.Sse2 for debugging)
The configuration file would need to be in the working directory of the executable when it's running.