While Compiling "strlcpy.h" is not found - c++

I'm trying to compile C++ Code using g++ and using the CERN ROOT Framework. I've got the folowing error message, while compiling.
In file included from /usr/include/root/TObject.h:31:0,
from /usr/include/root/TNamed.h:26,
from /usr/include/root/TDirectory.h:25,
from /usr/include/root/TDirectoryFile.h:25,
from /usr/include/root/TFile.h:25,
from neutralino_root.cpp:13:
/usr/include/root/Rtypes.h:36:68: fatal error: strlcpy.h: No such file or directory
#include <strlcpy.h> // part of string.h on systems that have it
^
compilation terminated.
Has anyone an idea, why "strlcpy.h" is not found?
Thanks for help,
Simon

Related

Atom searching in wrong directory for c++ file for compilation, does anyone know how to fix it?

I have just downloaded and tested the MinGW's c++ compiler. In the terminal it works fine. Then I went to atom, downloaded gpp-compiler and tried compiling the same document I had compiled in the terminal. On atom however, I got this message:
g++: error: /mnt/c/Users/phfer/Desktop/cpp/new.cpp: No such file or directory
g++: fatal error: no input files
compilation terminated.
As you can see, atom is searching for the file new.cpp in the directory /mnt/c/, instead of searching for it in C:\Users...
Does anyone know how to fix this?

cmsis_compiler.h: No such file or directory while compiling Arduino Tensorflow lite library for Arduino Due

I am trying to compile the Arduino Tensorflow lite Library example file for Arduino Due board, but at the time of compilation I got error of missing cmsis_compiler.h file error. I also tried to compile the code for STM32F103C8 board on Arduino version 1.8.12 with the Arduino_TensorFlowLite at version 2.1.0-ALPHA-precompiled library but still the same error. Here is the complete error
from C:\Users\Strange Lab\Documents\Arduino\libraries\Arduino_TensorFlowLite\src/third_party/gemmlowp/fixedpoint/fixedpoint.h:24,
from C:\Users\Strange Lab\Documents\Arduino\libraries\Arduino_TensorFlowLite\src/tensorflow/lite/kernels/internal/reference/add.h:18,
from C:\Users\Strange Lab\Documents\Arduino\libraries\Arduino_TensorFlowLite\src\tensorflow\lite\micro\kernels\cmsis-nn\add.cpp:16:
c:\users\strange lab\appdata\local\arduino15\packages\arduino\tools\arm-none-eabi-gcc\4.8.3-2014q1\arm-none-eabi\include\c++\4.8.3\bits\c++0x_warning.h:32:2: error: #error This file requires compiler and library support for the ISO C++ 2011 standard. This support is currently experimental, and must be enabled with the -std=c++11 or -std=gnu++11 compiler options.
#error This file requires compiler and library support for the \
^
In file included from C:\Users\Strange Lab\Documents\Arduino\libraries\Arduino_TensorFlowLite\src/tensorflow/lite/micro/tools/make/downloads/cmsis/CMSIS/NN/Include/arm_nnsupportfunctions.h:33:0,
from C:\Users\Strange Lab\Documents\Arduino\libraries\Arduino_TensorFlowLite\src/tensorflow/lite/micro/tools/make/downloads/cmsis/CMSIS/NN/Include/arm_nnfunctions.h:163,
from C:\Users\Strange Lab\Documents\Arduino\libraries\Arduino_TensorFlowLite\src\tensorflow\lite\micro\kernels\cmsis-nn\add.cpp:18:
C:\Users\Strange Lab\Documents\Arduino\libraries\Arduino_TensorFlowLite\src/tensorflow/lite/micro/tools/make/downloads/cmsis/CMSIS/DSP/Include/arm_math.h:382:28: fatal error: cmsis_compiler.h: No such file or directory
#include "cmsis_compiler.h"
^
compilation terminated.
Using library Arduino_TensorFlowLite at version 2.1.0-ALPHA-precompiled in folder: C:\Users\Strange Lab\Documents\Arduino\libraries\Arduino_TensorFlowLite
exit status 1
Error compiling for board Generic STM32F103C series.```
I can understand that may be the Arduino Due is not officially supported but I think the STM32F103C8 board is supported. So is there anything which I am missing here?
I hope you have found an answer yourself since posting this question, but for anyone else fumbling their way in here; it seems like the current tensorflow-lite library (as I'm writing this it is: 2.1.0-APLHA-precompiled) only works with MbedOS-boards (Portenta H7 and Nano 33 BLE).
Hope you could use this answer :D

Code::Blocks, and C++ Compiler problem. cant compile a header

im having problem when compiling C++ source code. that code is a keylogger. at first, i save with .cpp, and try to compile it from terminal using this command
g++ test.cpp
and then the terminal showed me this messages
test.cpp:1:10: fatal error: conio.h: No such file or directory
#include <conio.h>
^~~~~~~~~
compilation terminated.
and this message
test.cpp:2:10: fatal error: windows.h: No such file or directory
#include <windows.h>
^~~~~~~~~~~
compilation terminated.
to fix this, i tried to use a C++ IDE, code::blocks. installed from terminal, and the copy that keylogger source code to code:::blocks. but the IDE shows this message
||=== Build file: Debug in Belajar CPP (compiler: GNU GCC Compiler) ===|
/home/lucky/test.cpp|1|fatal error: conio.h: No such file or directory|
||=== Build failed: 1 error(s), 0 warning(s) (0 minute(s), 0 second(s)) ===|
I just don't know how to fix this and how to search the solutions online. because I'm new in using Linux-Mint. Can someone help me to fix this?
First of all, conio.h and windows.h these headers are not supported on linux console.
Alternative is to use NCurses library. It does all the Console realted stuff you could want and is part of the Linux Standard Base ( i.e. available in every distro ).
Include 'ncurses.h' instead.
I hope this will resolve your issue.

How to declare identifier JSON in a C++ file?

I got a c++ Project that correctly compiles on Windows.
Now I try to run it on my Mac.
I changed all paths to my Mac paths.
After "make" command I get this error message:
error: use of undeclared identifier 'Json'
Json::Reader reader;
Of course I included my header file containing #include <json.h>
Are there any necessary elements I missed?
Thanks for any ideas!!
There was a wrong linking of json_lib
Reinstalled and problem got solved.

How to run program written for old compiler?

I'm looking for an implementation of Hybrid Tree(not important), and find an "old" one here.
The author said they have tried this code on the SUN Sparc platform (running Solaris 2.6) and with gcc-2.8.1 compiler. And my environment is gcc version 4.4.3 (Ubuntu 10.10).
The problem is:
I run "make" with the makefile he provides, but it gives me lots of error message as follows:
g++ -c Node.C
g++ -c DataNode.C
In file included from DataNode.h:18,
from DataNode.C:17:
Query.h:9:20: error: vector.h: No such file or directory
Query.h:10:19: error: stack.h: No such file or directory
Query.h:13:22: error: function.h: No such file or directory
Query.h:14:22: error: iostream.h: No such file or directory
DataNode.C:283:8: warning: extra tokens at end of #endif directive
In file included from DataNode.h:18,
from DataNode.C:17:
Query.h:29: warning: ‘typedef’ was ignored in this declaration
Query.h:44: warning: ‘typedef’ was ignored in this declaration
Query.h:86: error: expected initializer before ‘<’ token
Query.h:118: error: ISO C++ forbids declaration of ‘PQ’ with no type
Query.h:118: error: expected ‘;’ before ‘*’ token
Query.h:122: error: ISO C++ forbids declaration of ‘PQ’ with no type
Query.h:122: error: expected ‘;’ before ‘*’ token
Query.h:126: error: ISO C++ forbids declaration of ‘PQ’ with no type
Query.h:126: error: expected ‘;’ before ‘*’ token
Query.h:135: error: expected initializer before ‘<’ token
DataNode.C: In member function ‘void DataNode::DisconnectBranch(int)’:
DataNode.C:80: error: ‘memmove’ was not declared in this scope
make: *** [DataNode.o] Error 1
I know I need to modify the souce code so as to agree with the morden compiler, such as change vector.h to vector. But I find it's just endless.
So my question is: is there any convienent method to run this program, no matter automatically converting this code to "modern-style" or using a standalone "old-style" compiler ?
Any suggestions?
===Update:===
Thank you all, I installed gcc2.8.1 in a different dir using --prefix=/usr/local/gcc-2.8.1 and modify the "makefile" to use this old-version gcc(/usr/local/gcc-2.8.1/bin/gcc). But when I run "make", it still gives me errors of not finding the headers:
/usr/local/gcc-2.8.1/bin/gcc -c DataNode.C
In file included from DataNode.h:18,
from DataNode.C:17:
Query.h:9: vector.h: No such file or directory
Query.h:10: stack.h: No such file or directory
Query.h:11: deque: No such file or directory
Query.h:12: algorithm: No such file or directory
Query.h:13: function.h: No such file or directory
Query.h:14: iostream.h: No such file or directory
make: *** [DataNode.o] Error 1
Then I tried to find these heads in /usr/local/gcc-2.8.1 using find /usr/local/gcc-2.8.1 -name "*vector*", but got nothing.
So where are these heads for the old-version gcc?
You can make a vertor.h yourself which includes vector. This way you can fix the incompatibilities noninvasively.
Edit:
You may also need to add a
using namespace std;
in the header file(s). This is
generally a bad idea but this is one situation where i'd do it anyway.
Once you get it working i would reccomend rewriting it to use the new style header files and namespaces.
Debian Lenny (oldstable) has gcc 3.4. This might have a better backward compatibility. Try to make compatibility headers for the rest of the issues and include them via an extra -I directory, e.g. a vector.h header file that includes vector.
Do yourself the favor and try not to touch the old code. It is easy to break legacy code in unforeseen ways.
You could try running the program on QEMU which supports Solaris 2.6. The only problem might be hunting for the install disc/image. Also, there are people that sells old Solaris boxes on eBay for cheap, you might be able to grab one.
GCC provides download for very old versions, you might be able to get better chance if you try older version of the compiler.
gcc has -fpermissive option: try it and see whether at least some errors disappear. Also: try making a single header file that will include all requisite headers with using directives. For example, make stdinc.h containing:
#include <vector>
#include <iostream>
#include <stack>
...
using std::vector;
using std::fstream;
...
Replace all mentions of legacy C++ header files with a single include of stdinc.h. Old C++ didn't have namespaces, so even if you replace individual directives with just using namespace std;, clashes are unlikely.
If the only thing is
#include <vector.h>
to
#include <vector>
using namespace std;
Why not try sed?
grep for all includes to see if there are other includes than the c++ headers. If not your lucky.
Another thing that is more tricky is that there is old code that relies on accessing data through iterators in a non-standard way. I saw that in a Doom map editor for linux. Then you may need to do manual stuff.