Using windows and trying to compile emscripten:
emmake mingw32-make SUBTARGET=pacmantest SOURCES=C:\Users\Adam\Documents\GitHub\mame\drivers\pacman.cpp
I'm not used to compiling C but I have the latest versions installed of GCC and Clang but it's not using them for some reason. It's throwing the following error:
'head' is not recognized as an internal or external command, operable program or batch file.
GCC 2.0.10 detected
clang version 6.0 or later needed.
mingw32-make: *** [makefile:1345: build/projects/sd1/mamepacmantest/gmake-asmjs/makefile] Error -1
Related
I have just got my new M1 MacBook Pro and am trying to compile a code base required for my university work. Here are the steps I have taken:
I set Terminal to always open using Rosetta.
Installed homebrew using /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
Installed cmake using brew install cmake
Run cmake <path to source> (this works fine)
Run make (this fails)
Here is the error I get:
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/stdlib.h:97:15: fatal error:
'stdlib.h' file not found
#include_next <stdlib.h>
I have tried uninstalling and re-installing Xcode and CommandLineTools to no avail.
When using the cmake gui app, I get a different error. I have it set to use CommandLineTools/SDKs/MacOsX11.0.sdk.
When running make after generating and configuring the build files using this cmake gui setup, I get this error:
-- The C compiler identification is AppleClang 12.0.0.12000032
-- The CXX compiler identification is AppleClang 12.0.0.12000032
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - failed
-- Check for working C compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc
-- Check for working C compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc - broken
CMake Error at /Applications/CMake.app/Contents/share/cmake-3.18/Modules/CMakeTestCCompiler.cmake:66 (message):
The C compiler
"/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc"
is not able to compile a simple test program.
It fails with the following output:
Change Dir: /Users/freyamurphy/nori/build/ext_build/src/tbb_p-build/CMakeFiles/CMakeTmp
If I run the command /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc test.c (Simple hello world program) I get this error:
test.c:1:10: fatal error: 'stdio.h' file not found
#include "stdio.h"
But using cc test.c everything works fine. (This runs usr/bin/cc).
Seems to me there is perhaps an issue with Xcode. Has anyone had any similar issues or could give me some advice? It would be much appreciated.
Have you reopen Terminal after xcode installed? It's needed to set the environment variable SDKROOT.
Close and run again Terminal or open a new tab in Terminal.
Or run the following command in the current Terminal
export SDKROOT=$(xcrun --sdk macosx --show-sdk-path)
Also be sure the proper xcode toolchain is selected
# list available xcode toolchains
xcode-select -p
# select one of listed above
sudo xcode-select -s /Applications/Xcode.app/Contents/Developer
I have been working this problem for more than a week. I installed the free version of QT off the QT site. I am trying to set up a cross compile environment for a Beaglebone Black ARM 8 platform. I have set up the compiler options using GNU ARM 6.3.0 GNU compiler -- The same compiler that is on my BBB. I successfully created the cross-compile environment and the Beaglebone device. The connect test worked correctly as well.
Here is the simple C++ application that I am trying to compile,
#include <iostream>
using namespace std;
int main()
{
cout << "Hello World!" << endl;
return 0;
}
Here is what my QT gcc compile options look like,
Here is my kit setup,
Here is my device setup,
When I build the default QT simple application I get these errors,
Running Windows Runtime device detection.
C:/Qt/5.11.0/winrt_armv7_msvc2015/bin/winrtrunner.exe --list-devices
Found 2 Windows Runtime devices.
Running "C:\Program Files (x86)\CMake\bin\cmake.exe -E server "--pipe=\.\pipe{2e664e46-cacb-46ae-b680-ed9c235dc502}" --experimental" in C:\Users\Stephen\AppData\Local\Temp\QtCreator-WLEKuI\qtc-cmake-IDzcFnnJ.
Starting to parse CMake project, using: "-DCMAKE_CXX_COMPILER:STRING=C:/SysGCC/beaglebone-6.3.0/bin/arm-linux-gnueabihf-g++.exe", "-DCMAKE_C_COMPILER:STRING=C:/SysGCC/beaglebone-6.3.0/bin/arm-linux-gnueabihf-gcc.exe", "-DCMAKE_PREFIX_PATH:STRING=", "-DQT_QMAKE_EXECUTABLE:STRING=".
The C compiler identification is GNU 6.3.0
The CXX compiler identification is GNU 6.3.0
Check for working C compiler: C:/SysGCC/beaglebone-6.3.0/bin/arm-linux-gnueabihf-gcc.exe
Check for working C compiler: C:/SysGCC/beaglebone-6.3.0/bin/arm-linux-gnueabihf-gcc.exe -- broken
CMake Error at C:/Program Files (x86)/CMake/share/cmake-3.10/Modules/CMakeTestCCompiler.cmake:52 (message):
The C compiler
"C:/SysGCC/beaglebone-6.3.0/bin/arm-linux-gnueabihf-gcc.exe"
is not able to compile a simple test program.
It fails with the following output:
Change Dir: C:/Users/Stephen/AppData/Local/Temp/QtCreator-WLEKuI/qtc-cmake-IDzcFnnJ/CMakeFiles/CMakeTmp
Run Build Command:"C:/PROGRA~2/Ninja/ninja.exe" "cmTC_c3136"
[1/2] Building C object CMakeFiles/cmTC_c3136.dir/testCCompiler.c.obj
[2/2] Linking C executable cmTC_c3136.exe
FAILED: cmTC_c3136.exe
cmd.exe /C "cd . && C:\SysGCC\beaglebone-6.3.0\bin\arm-linux-gnueabihf-gcc.exe CMakeFiles/cmTC_c3136.dir/testCCompiler.c.obj -o cmTC_c3136.exe -Wl,--out-implib,libcmTC_c3136.dll.a -Wl,--major-image-version,0,--minor-image-version,0 && cd ."
c:/sysgcc/beaglebone-6.3.0/bin/../lib/gcc/arm-linux-gnueabihf/6/../../../../arm-linux-gnueabihf/bin/ld.exe: unrecognized option '--major-image-version'
c:/sysgcc/beaglebone-6.3.0/bin/../lib/gcc/arm-linux-gnueabihf/6/../../../../arm-linux-gnueabihf/bin/ld.exe: use the --help option for usage information
collect2.exe: error: ld returned 1 exit status
ninja: build stopped: subcommand failed.
The build seems to issues a command to the GCC compiler suite to an executable called ld.exe. I verified the path to ld.exe and it is indeed in the directory and handles my "ld --version" command.The error messages show ld.exe '--major-image-version' and fails. ld.exe does not support --major-image-version. Not sure why it is issuing this command to ld.exe.
I know these compilers work as I have manually compiled this program using g++ 6.3.0 compiler. Any suggestions?
A make argument is wrong. Specifically:
unrecognized option '--major-image-version'
You should remove the argument "--major-image-version" from your project's Makefile LFLAGS.
On windows there are 3 makefiles, Makefile, Makefile.debug and Makefile.release
Remove the argument from the one matching your current build config.
I am trying to build a C++ project in NetBeans 8.2 under OS X with the C++14 standard. However, I am always getting the error while trying to build:
g++ -c -g -std=c++14 -MMD -MP -MF "build/Debug/GNU-MacOSX/test.o.d" -o build/Debug/GNU-MacOSX/test.o test.cpp
error: invalid value 'c++14' in '-std=c++14'
make[2]: *** [build/Debug/GNU-MacOSX/test.o] Error 1
make[1]: *** [.build-conf] Error 2
make: *** [.build-impl] Error 2
BUILD FAILED (exit value 2, total time: 570ms)
Nevertheless, I can run the same command from the terminal without any problems. My version of g++ is 7.0.0, and so the C++14 standard is fully supported.
Therefore, it seems like NetBeans tries to run some older version of g++, which was probably supplied with the system but now is replaced with a new one. To this I have two questions:
How can it be possible that default versions in the terminal and NetBeans are different?
How can I configure NetBeans to work with the terminal default version?
EDIT:
In the terminal which g++ yields /opt/local/bin/g++. The same is in the field Preferences -> C/C++ -> C++ compiler. Adding the --version argument in NetBeans yields Apple LLVM version 5.1 (clang-503.0.40) (based on LLVM 3.4svn), which is definitely different from the console version. So, I still do not understand: why calling g++ under the same path resolves to different versions in NetBeans and the terminal?
I tried to compile a Thor library. It depends on SFML. I didnt had any problem with compiling SFGUI which also depends on SFML. Previously I used exactly the same toolchain. Everything worked fine
CMake gui errors:
The C compiler identification is unknown
The CXX compiler identification is GNU 4.9.2
Check for working C compiler: E:/Programs_Portable/Dev-Cpp/minGW32/bin/gcc.exe
Check for working C compiler: E:/Programs_Portable/Dev-Cpp/minGW32/bin/gcc.exe -- broken
CMake Error at C:/CMake/share/cmake-3.4/Modules/CMakeTestCCompiler.cmake:61 (message):
The C compiler "E:/Programs_Portable/Dev-Cpp/minGW32/bin/gcc.exe" is not able to compile a simple test program.
It fails with the following output:
Change Dir: D:/Michal/Pliki/thor-v2.0-sdk/build/CMakeFiles/CMakeTmp
Run Build
Command:"E:/Programs_Portable/Dev-Cpp/minGW32/bin/mingw32-make.exe"
"cmTC_6b11a/fast"
E:/Programs_Portable/Dev-Cpp/minGW32/bin/mingw32-make.exe -f
CMakeFiles\cmTC_6b11a.dir\build.make CMakeFiles/cmTC_6b11a.dir/build
mingw32-make.exe[1]: Entering directory
'D:/Michal/Pliki/thor-v2.0-sdk/build/CMakeFiles/CMakeTmp'
Building C object CMakeFiles/cmTC_6b11a.dir/testCCompiler.c.obj
E:\Programs_Portable\Dev-Cpp\minGW32\bin\gcc.exe -o
CMakeFiles\cmTC_6b11a.dir\testCCompiler.c.obj -c
D:\Michal\Pliki\thor-v2.0-sdk\build\CMakeFiles\CMakeTmp\testCCompiler.c
<built-in>: internal compiler error: Segmentation fault
libbacktrace could not find executable to open
Please submit a full bug report,
with preprocessed source if appropriate.
See <http://sourceforge.net/projects/mingw-w64> for instructions.
CMakeFiles\cmTC_6b11a.dir\build.make:64: recipe for target
'CMakeFiles/cmTC_6b11a.dir/testCCompiler.c.obj' failed
mingw32-make.exe[1]: *** [CMakeFiles/cmTC_6b11a.dir/testCCompiler.c.obj]
Error 1
mingw32-make.exe[1]: Leaving directory
'D:/Michal/Pliki/thor-v2.0-sdk/build/CMakeFiles/CMakeTmp'
makefile:125: recipe for target 'cmTC_6b11a/fast' failed
mingw32-make.exe: *** [cmTC_6b11a/fast] Error 2
CMake will not be able to correctly generate this project.
Call Stack (most recent call first):
CMakeLists.txt:42 (project)
Configuring incomplete, errors occurred!
See also "D:/Michal/Pliki/thor-v2.0-sdk/build/CMakeFiles/CMakeOutput.log".
See also "D:/Michal/Pliki/thor-v2.0-sdk/build/CMakeFiles/CMakeError.log".
I tried compiling simple int main(){}. gcc works.
All paths are as intended. (Btw I don't use DevCpp, its just the path to the compiler).
I am surprised because g++ works, CMake is able to display identification but apparently not for gcc
Thanks for any help
The message appears on Solus OS if you don't install the essential build packages.
CMake Error at /usr/share/cmake-3.12/Modules/CMakeTestCCompiler.cmake:52 (message):
The C compiler
"/usr/bin/cc"
is not able to compile a simple test program.
You have to install the packages, using
sudo eopkg it -c system.devel
Then it works fine.
Fixed now by upgrading my GCC from 4.9.2 to 4.9.3. No more problems with crashing, however apparently there was a change related to C++11 standard and I need to manually edit CMakeLists.txt to change flag -std=c++11 to -std=gnu++11 when compiling any library and any program
MinGW / CxxTest bizarre errors
Edit: Switching/updating MinGW distro solved all problems. I tried updating the compiler to 7.2+/8.0+ versions and got rid of all confiuration problems. Likely it was a corrupted installaton or some older version bug
I'm getting this error while linking a C++ code.
I'm using g++ cross compiler for arm and building it on a Ubuntu machine.
Do I have to pass any flags or include some library?