C++ error on linux machine: ccpentium: No input files - c++

I am writing a code for MRI scanner where all calculation is being done on a Windows machine, while waveforms are being played using linux.
Inside my code, when I declare
#include <vector>
and try to compile it on linux, I start getting errors like this:
ccpentium: FLASH.cpp: No such file or directory
ccpentium: No input files
Any help would be appreciated.
More detailed error:
export PATH=z:/n4_fsp/tornado/i86/host/x86-win32/bin:C:/WINDOWS/system32:C:/WINDOWS:C:/WINDOWS/system32/Wbem; z:/n4_fsp/tornado/i86/host/x86-win32/bin/ccpentium.exe -O1 -Wall -DTOOL_FAMILY=gnu -DTOOL=gnu -ansi -DVXWORKS -DUNICODE -D_UNICODE -mcpu=pentium -march=pentium -fvolatile -nostdlib -fno-builtin -fno-defer-pop -DCPU=PENTIUM -malign-double -D_CONSOLE -DCEST_OffsetSeries -DBUILD_SEQU -DBUILD_CEST_OffsetSeries -Iz:/n4/pkg -Iz:/n4/tool -Iz:/n4_prod/i86/prod/include -Iz:/n4_deli_vb15a/i86/del
ivery/include -Iz:/n4/x86/prod/include -Iz:/n4/x86/delivery/include -Iz:/n4/pkg/MrServers/MrMPCUSystem/Tornado_i86/target/h -Iz:/n4_extsw/x86/extsw/include -o FLASH.oi86 -c FLASH.cpp
In file included from z:/n4_fsp/tornado/i86/host/x86-win32/lib/gcc-lib/i586-wrs-vxworks/2.9-PentiumIII-010221/include/syslimits.h:7,
from z:/n4_fsp/tornado/i86/host/x86-win32/lib/gcc-lib/i586-wrs-vxworks/2.9-PentiumIII-010221/include/limits.h:11,
from z:/n4_fsp/tornado/i86/host/x86-win32/include/g++-3/stl_algobase.h:49,
from z:/n4_fsp/tornado/i86/host/x86-win32/include/g++-3/algobase.h:36,
from z:/n4_fsp/tornado/i86/host/x86-win32/include/g++-3/vector.h:30,
from FLASH.cpp:33:
z:/n4_fsp/tornado/i86/host/x86-win32/lib/gcc-lib/i586-wrs-vxworks/2.9-PentiumIII-010221/include/limits.h:117:60: limits.h: No such file or directory
ccpentium: FLASH.cpp: No such file or directory
ccpentium: No input files
ccpentium: FLASH.cpp: No such file or directory
ccpentium: No input files
ccpentium: FLASH.cpp: No such file or directory
ccpentium: No input files
idea_make: *** [FLASH.oi86] Error 1
20:03:23 ERROR sde::fDos: <idea_make.exe --unix -f CEST_OffsetSeries.mk i86Release> failed with status=2
20:03:23 ERROR sde idea_make.exe --unix -f CEST_OffsetSeries.mk i86Release failed
20:03:23 INFO sde Copying \n4\i86\prod\lib\CEST_OffsetSeries.i86 to c:\Temp\CEST_OffsetSeries.i86
1 Datei(en) kopiert.

The error is caused by the combination of
-nostdlib
flag which asks the compiler not to use its standard linking environment and missing files from your include paths.
From very recent experience, I was missing two files from the include:
-Iz:/n4/pkg/MrServers/MrMPCUSystem/Tornado_i86/target/h
Eventually, I manually copied them from an updated version, but I do not know whether this is a bug or a 'feature' of the older version, so it still remains to be tested whether the compiled code does not break the scanner.

Related

Compile C++ on Windows

I'm trying to compile C++ on Windows.
The command needed to compile on Linux is:
g++ -O3 -Wall -shared -std=c++11 -fPIC `python -m pybind11 --includes` EO_functions_bipartite.cpp -o extremal_bi.so
I installed MinGW but when I try to compile I get the following error:
g++.exe: error: python: No such file or directory
g++.exe: error: pybind11: No such file or directory
g++.exe: error: unrecognized command line option '-m'
g++.exe: error: unrecognized command line option '--includes EO_functions_bipartite.cpp'
g++.exe: fatal error: no input files
compilation terminated.
Assuming you have python in your path.
The backtick escape thing that embeds the python -m pybind11 --includes command within the g++ doesn't work on cmd.exe in Windows.
Run the python -m pybind11 --includes command on its own line in the cmd shell. Take the output of that command and substitute in into the g++ command. It should be a bunch of -I include params.
So if the output of the python command is this:
-IC:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.7_3.7.2544.0_x64__qbz5n2kfra8p0\Include -IC:\Users\User\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.7_qbz5n2kfra8p0\LocalCache\local-packages\Python37\site-packages\pybind11\include
Expand your g++ command to be this:
g++ -O3 -Wall -shared -std=c++11 -fPIC "-IC:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.7_3.7.2544.0_x64__qbz5n2kfra8p0\Include" -IC:\Users\User\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.7_qbz5n2kfra8p0\LocalCache\local-packages\Python37\site-packages\pybind11\include EO_functions_bipartite.cpp -o extremal_bi.so
Notice the quotes I put around the first include directory because it has a space in its path.
The easiest way to start on native Windows if you have a Linux background is to install MSYS2 shell with MinGW-w64. This will provide an actual bash that allows you to run commands almost exactly the same way as on Linux, including support for backticks like in the case of your issue.
Though I would always recommend using $( ... ) instead of backticks, as this allows nesting.
Note that MinGW-w64 also exists on Windows to allow cross-building for Windows from Linux, but that may be a bit more difficult if you have never done any cross-building before.
Also -shared ... -o extremal_bi.so in your command should be replaced with -shared ... -o extremal_bi.dll -Wl,--out-implib,libextremal_bi.dll.a as .so files don't exist on Windows as Windows uses .dll files for shared libraries and the compiler uses .dll.a files as library objects for them.
Finally on Windows you need to tell the compiler or linker which symbols you will be exporting by either writing a libextremal_bi.def starting with the line EXPORTS followed all the symbols you want to be exported and include -def libextremal_bi.def in the link command, or using __declspec(dllexport)/__declspec(dllimport) when defining those symbols, which may be a bit complexer as it requires some conditional defines to determine if the code is being compiled for Windows and if it's during the actual build process of the shared library (__declspec(dllexport)) or code that uses it (__declspec(dllimport)). There is also another method to export all symbols, but that's a dirty method that may more easily cause symbol conflicts.

Error message while compiling a program

I’m a newbie to C++ and Linux. There is this code I’m playing with that requires me to install the HElib (Homomorphic encryption library and other libraries - GMP, NTL) which I did. I want to compile the code (main.cpp) that has a header file (FHE.h) in HElib. My problem is how can I link FHE.h (in HElib folder) and main.cpp (in another folder) together so that I can compile them. I have tried some commands
g++ -I/Home/HElib/src/FHE.h main.cpp -o main
Error message
main.cpp:1:17: fatal error: FHE.h: No such file or directory
compilation terminated.
Another command line
g++ -I/Home/HElib/Src/FHE.h -I/Home/SimpleFHESum-master/SimpleFHESum-master/main.cpp -o main]
Error Message
g++: fatal error: no input files
compilation terminated.
What's wrong and how can I fix this?
The -I flag adds the following directory to the include path of the compiler. This enables you to write e.g. #include "FHE.h" even though that file is not located in the same folder as the source file you're trying to compile.
Have you tried just removing the 'FHE.h' part from your -I directive?
g++ -I/Home/HElib/src ...

"fatal error: boost/regex.hpp: No such file or directory" when trying to compile C++ program using a makefile

I am trying to compile a piece of open source software called "SPECIES
Identification of Taxonomic Mentions in Text". I am on MacOS.
I downloaded the source code (which can be found here), moved into the directory and used the command make to compile. This is the error returned:
g++ -fpic -pthread -Wall -O3 -o organisms organisms.cxx -lm -lboost_regex
In file included from batch_tagger.h:5:0,
from organisms.cxx:3:
tagger.h:7:27: fatal error: boost/regex.hpp: No such file or directory
compilation terminated.
make: *** [organisms] Error 1
I installed the C++ boost library using brew install boostand tried the above steps again (it did not work).
I tried dropping the boost directory into the directory containing the source code (it did not work).
Any suggestions/help?
You need to tell the compiler where to find boost headers.
You need to use the include path option to specify where the boost headers can be find, use -I/path/to/boost/include.
Then include the file using #include <boost/regex.hpp> from your code.

Netbeans c++ compiler searches for deleted file

I'm working on a Ubuntu 16.04 and Netbeans 8.0.2
I deleted a source file and the corresponding header file, because I had no use for it anymore.
When I want to compile my code (clean + build), I get the following error:
make[2]: *** no rule to make target source_files/SolveODEwithAST.cpp“,
benötigt von „build/Debug/GNU-Linux-x86/source_files/SolveODEwithAST.o“, zu erstellen. Schluss.
-> My makefile is still looking for the deleted file.
I started to search in the makefile for the command to compile this deleted file:
I found the following:
in
Makefile-Release:
${OBJECTDIR}/source_files/SolveODEwithAST.o: source_files/SolveODEwithAST.cpp
${MKDIR} -p ${OBJECTDIR}/source_files
${RM} "$#.d"
$(COMPILE.cc) -O2 -MMD -MP -MF "$#.d" -o ${OBJECTDIR}/source_files/SolveODEwithAST.o source_files/SolveODEwithAST.cpp
and it is defined in the OBJECTFILES variable.
I deleted these lines of code, but the lines reappear after building the code.
So how can I change my makefile to make my code work again?
For all files in the projects /nbproject directory I searched for the deleted filenames.
$ls
configurations.xml Makefile-Debug.mk Makefile-impl.mk Makefile-Release.mk Makefile-variables.mk Package-Debug.bash Package-Release.bash private project.xml
It is important to delete the corresponding lines in the .xml files.
When I just delete the corresponding lines in the Makefiles, the lines reappear.

QT5 attaching project name with every sourcefile name, compiling error

i want to get started with QT. I donwloaded QT5 MINGW compiler with QT creator and i am trying to build the pre attached example named affine the problem is that the QT5 i think embed the project name with each of source file and thus gives error that file not found. some thing similar
:-1: error: ..affinemain.cpp: No such file or directory
while the file name is just
main.cpp
i don't know how to fix it. I searched lot on internet but could not found anything useful.
I even try to compile from command prompt but i am not fimmiliar with command prompt compiling as i am new to QT and previously i am totally developed with IDE in visual studio and eclipse for java so i have no idea about the make file and compiler command line arguments.
could some body please help me to fix this issue and can you tell please why compiler attaching project name with the source file name?
Thanks in advance
I have got the same problem and my solution may help you.
I am working with Qt5.0.1 now, and there are two distributions to work on windows with it: Qt5.0.1-mingw and Qt5.0.1-msvc2010.
I had to use mingw and there was a problem on my setup that "/" is ignored in path's.
So according to Qt Creator, compiler was called to process file mainwindow.cpp and this file was passed to it
g++ /*truncated*/ ..\qt-example\mainwindow.cpp
Below is the full compiler input:
g++ -c -pipe -fno-keep-inline-dllexport -g -frtti -Wall -Wextra -fexceptions -mthreads -DUNICODE -DQT_QML_DEBUG -DQT_DECLARATIVE_DEBUG -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_CORE_LIB -DQT_OPENGL_ES_2 -DQT_OPENGL_ES_2_ANGLE -DQT_NEEDS_QMAIN -I..\qt-example -I"..\..\..\..\..\..\Qt\Qt5.0.1\5.0.1\mingw47_32\include" -I"..\..\..\..\..\..\Qt\Qt5.0.1\5.0.1\mingw47_32\include\QtWidgets" -I"..\..\..\..\..\..\Qt\Qt5.0.1\5.0.1\mingw47_32\include\QtGui" -I"..\..\..\..\..\..\Qt\Qt5.0.1\5.0.1\mingw47_32\include\QtCore" -I"debug" -I"." -I"." -I"..\..\..\..\..\..\Qt\Qt5.0.1\5.0.1\mingw47_32\mkspecs\win32-g++" -o debug\mainwindow.o ..\qt-example\mainwindow.cpp
And the error produced.
g++.exe: error: ..qt-examplemainwindow.cpp: No such file or directory
g++.exe: fatal error: no input files
compilation terminated.
So, we can see that "\" is ignored by the compiler and file name is merged with directory name.
The solution to that problem goes to the tools that are used - MinGW (Minimalist ports of GCC and Binutils). And also MSYS - a collection of GNU utilities such as bash, make, gawk and grep to allow building of applications and programs which depend on traditionally UNIX tools to be present. In our case - g++.
MSYS is not shipped with Qt5.0.1-mingw and g++ is not using it, but having MSYS available in your PATH environment variable breaks the system.
MSYS is used for git scm, which I have installed, so my path contains links to MSYS that goes bundled with git. So I have next paths in my PATH environment variable.
C:\Program Files (x86)\git\bin;C:\Program Files (x86)\git\cmd
I have not found how MSYS is used by Qt Creator or g++, or where it is linked, but when I have dropped next path from PATH:
C:\Program Files (x86)\git\bin;
and restarted Qt Creator - g++ succeeded on compiling my file, it worked.
The question why/how it influences the Qt Creator/g++ that should not use MSYS utils installed with git is still open.
i can´t comment.
important : delete all the files in the release and debug folder (compiled version) before try the tips of the autor ...