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

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/

Related

Linking between two workspaces in ROS 2

I know I should ask in RosAnswers - I did actually but nobody ever answered and I still struggle with this so I thought I should try asking here.
To keep everything neat and clean I have a dev_ws with my packages and a tools_ws with all other packages (vision_opencv, perception_pcl etc.).
Now I´m not sure why but when I try to include header files from packages in tools_ws in my own dev_ws packages colcon is unable to find those headers. So if I try to add #include <pcl_conversions pcl_conversions.h> in my header file the error message will read
/home/test_ws/src/test_pkg/include/CameraAdapter.h:8:10: fatal error:
pcl_conversions/pcl_conversions.h: No such file or directory #include
<pcl_conversions/pcl_conversions.h>
I usually just add <depend>pcl_conversions</depend> in my package.xml and find_package(pcl_conversions REQUIRED) in my CMakeList.txt
The tools_ws is sourced and ros2 is able to find launchfiles etc in there and my python nodes are able to use packages from tools_ws, just using include files in Cpp isn´t working. I´m quite sure the answer is really simple, probably just a line in my CMakeList but I didn´t manage to find anything in the Ros2 Documentation or via googling.
Do you have any idea what I´m doing wrong?

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.

SCons not finding "stdafx.hpp" when using nested directories

I have a C++ project, and I am transitioning from Visual Studio Solutions to SCons for builds, so Linux users can also build my code. This is my first foray into SCons, and it's working very well with simple projects. But, for this project, I have a nested directory structure:
main/
sub1/*.cpp
sub2/*.cpp
sub3/*.cpp
file1.cpp
file2.cpp
And I have the following SConstruct file:
env = Environment()
env['PCHSTOP'] = 'stdafx.hpp'
env['PCH'] = env.PCH('stdafx.cpp')[0]
env.Program('program', [
'file1.cpp',
'file2.cpp',
'sub1/file1.cpp',
'sub2/file1.cpp',
'sub3/file1.cpp'
])
Running scons from the command line causes the following error:
fatal error C1083: Cannot open include file: 'stdafx.hpp': No such file or directory
Obviously, this is an MSVC error. But this should be solvable with Scons, I'm just not sure how..
I Noticed that Visual Studio will copy all the *.obj files to a build directory before linking by default. I think this may be part of the solution, but again, I'm unsure.
What I AM sure of, is this is not the first time someone has come across this problem, but Google didn't turn up anything for me.
PS: Unlike in the example, none of the files have naming conflicts, and could theoretically be moved to a flattened folder structure by SCons without issue.
This looks like you'll have to specify the proper include paths in your Environment via the "CPPPATH" variable...but it's difficult to tell without seeing the full command line. Remember, that all SCons envs are clean initially. So, if you're in the wrong working directory, a simple "#include " doesn't find the header if it's in a different folder.
Have a look at SCons' UserGuide, chap. 14 "Hierarchical Builds", which might give you a few more ideas and insights, or come over to the User mailing list at scons-users#scons.org.

using CUTE in Eclipse: fatal error: boost/type_traits/is_integral.hpp: No such file or directory

I'm a absolute newbie in Eclipse at least when it comes to using C++. Now I've found this Plugin for testing and followed the "instructions" (yeah well i created a cute project). When i try to build the sample Project i get the following error:
fatal error: boost/type_traits/is_integral.hpp: No such file or directory
the faliure is in file cute_determine_traits.h in the Project/cute directory where all of CUTE's includes are. The line it the program crashe is this one:
#include <boost/type_traits/is_integral.hpp>
Actually i don't have any idea what I'm supposed to do.. I'd be very very happy for some easy instructions how to fix this! I'm using Eclipse c++.
UPDATE:
Okay, I found the issue. I installed boost the wrong way. It worked as soon as i ran the bootstrap.bat using mingw. I followed this Video http://www.youtube.com/watch?v=qDVRrSzsqco and then my includes worked.
Thanks everybody! :)
Geetings.
I had the same problem minutes ago. I realized I haven't install boost library when I was installing cute plug-in (boost can be found when you go to Help->Install New Software... and once you write the address http://www.cute-test.com/updatesite in "Work with" then choose CUTE Optional Features->Boost For CUTE).
Or maybe i haven't choosen the "Copy Boost headers into project" option... Anyways, I think both can solved your issue too.
Farewell!

VC2008 compiler errors opening sbr files (C2418 C1903 C2471)

EDIT: See my answer below for the hotfix.
ORIGINAL QUESTION:
In setting up for our boat-programming adventure I have to set up source control and fix project files for a team to use them. (the project was previously only being worked on by one person who took shortcuts with setting up the project includes, etc)
I am fixing those SLN and Proj files. When trying to do a build on an external USB drive (I have not tried it on the primary hard drive) I am getting odd errors (lots of them for various files):
fatal error C1083: Cannot open
compiler generated file:
'.\Debug\.sbr': Permission
denied
These files are referenced in the vcproj file with relative paths in double quotes:
RelativePath="..\..\Source\.cpp"
I get the same errors form within a sln file in the IDE or if I call msbuild with the sln file.
The files are kind of "shared" for a few sln files (projects).
The person who originally created the SLN files is not known for being a wizard at configuring MSDev or making things work for teams.
Is this an issue with the way the source files are referenced? Any suggestions on how to fix these?
This URL does not seem to have helpful information:
Fatal Error C1083 on MSDN
Note - there were/are still hardcoded paths in the proj file, but i don;t see them for these files. They were mostly for the include and lib dirs. I think I removed them all.
I also get these errors:
..\..\Source\.cpp : error C2471:
cannot update program database '\debug\vc90.pdb'
..\..\Source\.cpp(336) : fatal
error C1903: unable to recover from
previous error(s); stopping
compilation
..\..\Source\.cpp(336) : error
C2418: cannot delete browser file:
.\Debug\.sbr
Title: You may receive a "PRJ0008" or "C2471" or "C1083" or "D8022" or "LNK1103" or similar error message when you try to build a solution in Visual C++
Symptoms:
D8022 : Cannot open 'RSP00000215921192.rsp'
PRJ0008 : Could not delete file 'vc90.idb'.
C1083 : Cannot open program database file 'vc90.pdb'
C2471 : Cannot update program database 'vc90.pdb'
LNK1103 : debugging information corrupt.
Cause:
This problem occurs when all of the following conditions are true:
You have a solution with more than one project in it.
Two or more of the projects are not dependent on each other.
You have parallel builds enabled. (Tools -> Options: Projects and Solutions, Build and Run: "maximum number of parallel project builds" is set to a value greater than 1)
You are building on a system with multiple CPUs (cores).
Two or more of the non-dependent projects are configured to use the same Intermediate and/or Output directory.
A specific race condition in mspdbsrv.exe remains uncorrected.
Resolution:
To resolve the problem do one or more of the following:
Reconfigure the non-dependent projects to specify an Intermediate and Output directory that is different from one another, e.g. Output Directory = "$(SolutionDir)$(ProjectName)\$(ConfigurationName)", Intermediate Directory = "$(OutDir)".
Adjust your solution's project dependencies (Project -> Project Dependencies...) so that each is dependent on another.
Disable parallel builds.
Add the "/onecpu" boot option to your boot.ini file.
Change you BIOS settings to enable/use only one CPU.
File a problem report with Microsoft Technical Support and keep bugging the crap out of them until they eventually fix mspdbsrv.
Status:
The problem is a combination of both a user project configuration error as well as a race condition in Microsoft's "mspdbsrv.exe" utility that does not properly handle more than one thread calling it at the same time for the same file resulting in the file's HANDLE being left open.
Additionally Visual Studio itself and/or its build system (VCBUILD and/or MSBUILD) (or all three!) should be made smart enough to detect and alert the user of such user errors so that corrective action can be taken.
This problem has been around for a LOOOOOONG time.
Applies to:
Microsoft Visual C++ 2005
Microsoft Visual C++ 2008
Others?
Respectfully submitted:
"Fish" (David B. Trout)
fish#infidels.org
p.s:
You're welcome. :)
Hmmm.
Perhaps:
http://social.msdn.microsoft.com/Forums/en-US/vclanguage/thread/0ceac3c6-62f6-4fdf-82e1-d41e1b4fcd20/
there is a hotfix from MS
http://code.msdn.microsoft.com/KB946040
http://support.microsoft.com/kb/946040
That might be my problem. I think it might only be on one machine I have.
EDIT:
I downloaded and ran the hotfix installer. It seems to have fixed it.
I get this same error when I physically remove a file from disk, but leave it in VS. In VS2005 it would give a much better : fatal error file not found. I think this is a bug in VS2008. The hotfix mentioned above didn't help me.
In my case it was my virus package (Trend Micro) causing all the problems. I added my Dev folders to the Ignore/White lists to solve the problem
delete your debug folder and build your project agian.
Occastionally my Visual Studio will suddenly decide something like this. I have found it maybe help to toggle to release, do a full rebuild, then toggle back to debug.