I'm trying to compile mDNS for ARMv6 to use in embedded applications on Axis cameras. I do this on Ubuntu 4.8.0-27. I'm not an expert on makefiles, but I tried to replace mDNSPosix' makefile gcc commands with Axis bundled arm-axis-linux-gnueabi-gcc, and run the makefile to compile this: https://opensource.apple.com/source/mDNSResponder/mDNSResponder-625.41.2/mDNSPosix/
It went okey until a certain line in the makefile that gave me this error:
strip: Unable to recognise the format of the input file `build/prod/mdnsd'
Makefile:251: recipe for target 'build/prod/mdnsd' failed
make: *** [build/prod/mdnsd] Error 1
The modified makefile: http://pastebin.com/wbhGC5s1
Any hints how to proceed with this error and change the makefile to work?
Thanks
Related
I write the C program using MinGW on windows 10 with Clion IDE. I had everything working and compiled successfully multiple times before. Can't link the error with any action but now cmake test in Clion fails - "Test Cmake run finished with errors" and I can't compile. Cmake error:
-- The C compiler identification is GNU 9.2.0
-- The CXX compiler identification is GNU 9.2.0
-- Check for working C compiler: C:/msys64/mingw64/bin/gcc.exe
-- Check for working C compiler: C:/msys64/mingw64/bin/gcc.exe -- broken
CMake Error at C:/Users/karol/AppData/Local/JetBrains/Toolbox/apps/CLion/ch-0/193.6015.37/bin/cmake/win/share/cmake-3.15/Modules/CMakeTestCCompiler.cmake:60 (message):
The C compiler
"C:/msys64/mingw64/bin/gcc.exe"
is not able to compile a simple test program.
It fails with the following output:
Change Dir: C:/Users/karol/AppData/Local/Temp/cmake_check_environment/_build11621595605978509144/CMakeFiles/CMakeTmp
Run Build Command(s):C:/msys64/mingw64/bin/mingw32-make.exe cmTC_15aad/fast && C:/msys64/mingw64/bin/mingw32-make.exe -f CMakeFiles\cmTC_15aad.dir\build.make CMakeFiles/cmTC_15aad.dir/build
mingw32-make.exe[1]: Entering directory 'C:/Users/karol/AppData/Local/Temp/cmake_check_environment/_build11621595605978509144/CMakeFiles/CMakeTmp'
Building C object CMakeFiles/cmTC_15aad.dir/testCCompiler.c.obj
C:\msys64\mingw64\bin\gcc.exe -o CMakeFiles\cmTC_15aad.dir\testCCompiler.c.obj -c C:\Users\karol\AppData\Local\Temp\cmake_check_environment\_build11621595605978509144\CMakeFiles\CMakeTmp\testCCompiler.c
Linking C executable cmTC_15aad.exe
C:\Users\karol\AppData\Local\JetBrains\Toolbox\apps\CLion\ch-0\193.6015.37\bin\cmake\win\bin\cmake.exe -E cmake_link_script CMakeFiles\cmTC_15aad.dir\link.txt --verbose=1
C:\Users\karol\AppData\Local\JetBrains\Toolbox\apps\CLion\ch-0\193.6015.37\bin\cmake\win\bin\cmake.exe -E remove -f CMakeFiles\cmTC_15aad.dir/objects.a
C:\msys64\mingw64\bin\ar.exe cr CMakeFiles\cmTC_15aad.dir/objects.a #CMakeFiles\cmTC_15aad.dir\objects1.rsp
C:\msys64\mingw64\bin\gcc.exe -Wl,--whole-archive CMakeFiles\cmTC_15aad.dir/objects.a -Wl,--no-whole-archive -o cmTC_15aad.exe -Wl,--out-implib,libcmTC_15aad.dll.a -Wl,--major-image-version,0,--minor-image-version,0 #CMakeFiles\cmTC_15aad.dir\linklibs.rsp
gcc.exe: fatal error: cannot execute 'ld': CreateProcess: No such file or directory
compilation terminated.
mingw32-make.exe[1]: *** [CMakeFiles\cmTC_15aad.dir\build.make:88: cmTC_15aad.exe] Error 1
mingw32-make.exe[1]: Leaving directory 'C:/Users/karol/AppData/Local/Temp/cmake_check_environment/_build11621595605978509144/CMakeFiles/CMakeTmp'
mingw32-make.exe: *** [Makefile:120: cmTC_15aad/fast] Error 2
CMake will not be able to correctly generate this project.
Call Stack (most recent call first):
CMakeLists.txt:1 (project)
-- Configuring incomplete, errors occurred!
See also "C:/Users/karol/AppData/Local/Temp/cmake_check_environment/_build11621595605978509144/CMakeFiles/CMakeOutput.log".
See also "C:/Users/karol/AppData/Local/Temp/cmake_check_environment/_build11621595605978509144/CMakeFiles/CMakeError.log".
Error code: 1
I don't know what caused it. One thing I did around the time it broke is turn off avast cyber capture. But now I turned off avast antivirus completely and turned off "Check apps and files" option in Defender. The latter I did when Clion popped a notification saying "Windows Defender might be interrupting build speed". I also clicked "fix" in this Clion pop-up and it added project folders to exceptions. Clion notified me of it not immediately after the error but way later.
The directory "C:/Users/karol/AppData/Local/Temp/cmake_check_environment/" mentioned in the error report doesn't exist. I tried unchecking "read-only access" of AppData/Local/temp directory but Windows keeps putting it on. Between those changes and antivirus changes, I was restarting windows many times.
The error message i get when trying to compile:
C:\Users\karol\AppData\Local\JetBrains\Toolbox\apps\CLion\ch-0\193.6015.37\bin\cmake\win\bin\cmake.exe --build C:\Users\karol\Desktop\studia\wstep_do_C\final_project\cmake-build-debug --target final_project -- -j 2
[ 20%] Linking C executable final_project.exe
gcc.exe: fatal error: cannot execute 'ld': CreateProcess: No such file or directory
compilation terminated.
mingw32-make.exe[3]: *** [CMakeFiles\final_project.dir\build.make:134: final_project.exe] Error 1
mingw32-make.exe[2]: *** [CMakeFiles\Makefile2:75: CMakeFiles/final_project.dir/all] Error 2
mingw32-make.exe[1]: *** [CMakeFiles\Makefile2:82: CMakeFiles/final_project.dir/rule] Error 2
mingw32-make.exe: *** [Makefile:117: final_project] Error 2
Many poeple experienced simmilar error caused by non-latin characters in path, not the case here. Also i don't suspect mingw installation as it used to work.
Clion toolchains settings
I am trying to compile a Contiki application that includes MRuby libraries and executes some simple ruby code. The problem is, I don't know how to include the MRuby libraries in the compilation.
Here is the project: https://github.com/matus-tomlein/contiki-mruby-example/tree/wrong
The code I want to execute is in contiki-mruby-example.c. The problem is probably in the Makefile. This is what I have currently:
CONTIKI_PROJECT = contiki-mruby-example
all: $(CONTIKI_PROJECT)
CONTIKIDIRS += mruby/include
CFLAGS += -v
CFLAGS += -Imruby/include
CONTIKI = contiki
include $(CONTIKI)/Makefile.include
I get the following error when I execute make:
ld: can't map file, errno=22 file 'mruby/include' for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
The MRuby code I want to include is in mruby/include.
This is a similar question: How to use external libraries and compile them along with a Contiki application
But using TARGET_LIBFILES or LDFLAGS didn't help. I guess that is because I am compiling plain source code, not libraries.
There probably is a simple answer that I am missing. Thanks for any suggestions.
Thanks #kfx for the comment, you were right that I should have linked the library in the Makefile.
Just to help anyone else that might have this problem:
Go to the mruby subfolder and execute make
Add this to Makefile: TARGET_LIBFILES += mruby/build/host/lib/libmruby.a
I have updated the example repo with the fix: https://github.com/matus-tomlein/contiki-mruby-example
I'm currently trying to get a toolchain setup so I can build an AVR project from CLion.
My starting point is this, specifically, the Blink example. The issue is that it, along with existing CMake for AVR examples, are all for Linux based systems.
What I've tried is installing WinAVR to get the executables. I've modified the CMakeList.txt so the program names contain the following:
set(AVRCPP "C:/WinAVR-20100110/bin/avr-g++")
set(AVRC "C:/WinAVR-20100110/bin/avr-gcc")
set(AVRSTRIP "C:/WinAVR-20100110/bin/avr-strip")
set(OBJCOPY "C:/WinAVR-20100110/bin/avr-objcopy")
set(OBJDUMP "C:/WinAVR-20100110/bin/avr-objdump")
set(AVRSIZE "C:/WinAVR-20100110/bin/avr-size")
set(AVRDUDE "C:/WinAVR-20100110/bin/avrdude")
set(AVRAS "C:/WinAVR-20100110/bin/avr-as")
While using the Cygwin environment, CMake has no issue finding my compilers, but when I try to build the project, avr-gcc is being passed parameters in Linux format.
C:/WinAVR-20100110/bin/avr-gcc.exe -o CMakeFiles/cmTryCompileExec420260872.dir/testCCompiler.c.obj -c /cygdrive/c/Users/Daniel/.clion10/system/cmake/generated/2eb381d5/2eb381d5/__default__/CMakeFiles/CMakeTmp/testCCompiler.c
avr-gcc.exe: /cygdrive/c/Users/Daniel/.clion10/system/cmake/generated/2eb381d5/2eb381d5/__default__/CMakeFiles/CMakeTmp/testCCompiler.c: No such file or directory
Is there a way to have CMake pass avr-gcc arguments in a format it can work with?
For reference, this is the full output:
Error:The C compiler "C:/WinAVR-20100110/bin/avr-gcc" is not able to compile a simple test program.
It fails with the following output:
Change Dir: /cygdrive/c/Users/Daniel/.clion10/system/cmake/generated/2eb381d5/2eb381d5/__default__/CMakeFiles/CMakeTmp
Run Build Command:/usr/bin/make.exe "cmTryCompileExec420260872/fast"
/usr/bin/make -f CMakeFiles/cmTryCompileExec420260872.dir/build.make CMakeFiles/cmTryCompileExec420260872.dir/build
make[1]: Entering directory '/cygdrive/c/Users/Daniel/.clion10/system/cmake/generated/2eb381d5/2eb381d5/__default__/CMakeFiles/CMakeTmp'
/usr/bin/cmake.exe -E cmake_progress_report /cygdrive/c/Users/Daniel/.clion10/system/cmake/generated/2eb381d5/2eb381d5/__default__/CMakeFiles/CMakeTmp/CMakeFiles 1
Building C object CMakeFiles/cmTryCompileExec420260872.dir/testCCompiler.c.obj
C:/WinAVR-20100110/bin/avr-gcc.exe -o CMakeFiles/cmTryCompileExec420260872.dir/testCCompiler.c.obj -c /cygdrive/c/Users/Daniel/.clion10/system/cmake/generated/2eb381d5/2eb381d5/__default__/CMakeFiles/CMakeTmp/testCCompiler.c
avr-gcc.exe: /cygdrive/c/Users/Daniel/.clion10/system/cmake/generated/2eb381d5/2eb381d5/__default__/CMakeFiles/CMakeTmp/testCCompiler.c: No such file or directory
avr-gcc.exe: no input files
CMakeFiles/cmTryCompileExec420260872.dir/build.make:60: recipe for target 'CMakeFiles/cmTryCompileExec420260872.dir/testCCompiler.c.obj' failed
make[1]: Leaving directory '/cygdrive/c/Users/Daniel/.clion10/system/cmake/generated/2eb381d5/2eb381d5/__default__/CMakeFiles/CMakeTmp'
make[1]: *** [CMakeFiles/cmTryCompileExec420260872.dir/testCCompiler.c.obj] Error 1
Makefile:117: recipe for target 'cmTryCompileExec420260872/fast' failed
make: *** [cmTryCompileExec420260872/fast] Error 2
CMake will not be able to correctly generate this project.
I use cmake and avr on windows and on linux.
The syntax is the same. Why do you want to use cygwin in the mid of that?
In any case you didn't show your toolchain file.
When cross compiling using cmake you need to provide a toolchain file where you set all the configuration related to the compiler.
You need to do this because when cmake starts it try to compile a simple program and it try to run it. If you are using an avr compiler on a computer cmake can't run the executable, so it fails.
You need to put an extra care including this command in the toolchain:
SET(CMAKE_SYSTEM_NAME Generic)
it is needed for skip this compilation and so to avoid the failure.
I think this is a good read where to begin:
http://playground.arduino.cc/Code/CmakeBuild
I have been trying to get this to work for the last 2 days but cannot. Maybe someone can help me. Let me explain my setup first;
windows 7 64bit
nidaqmx 9.1.7
mingw 64 bit
Netbeans 7.1.2
I created a def file (from C:\Program Files (x86)\National Instruments\Shared\ExternalCompilerSupport\C\lib64\msvc\nidaqmx.lib). Although the def file does not have the # symbols in it. Is it correct?
I then ran dlltool and created the libnidaq.a file which i used in my linker.
Everything works up to there. The problem is when i try to build i get the following error:
c:/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/4.7.0/../../../../x86_64-w64-mingw32/bin/ld.exe: i386 architecture of input file `../../Createdef/libnidaq.a(dyyrh.o)' is incompatible with i386:x86-64 output
c:/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/4.7.0/../../../../x86_64-w64-mingw32/bin/ld.exe: i386 architecture of input file `../../Createdef/libnidaq.a(dyyrt.o)' is incompatible with i386:x86-64 output
collect2.exe: error: ld returned 1 exit status
make[2]: *** [dist/Debug/MinGW-Windows/libHelloWorldC.dll] Error 1
make[1]: *** [.build-conf] Error 2
make: *** [.build-impl] Error 2
I am pretty sure everything is 64 bit so i don't know where this error is coming from.
Any help would be greatly appreciated.
../../x86_64-w64-mingw32/bin/ld.exe: i386 architecture of input file `../../Createdef/libnidaq.a(dyyrh.o)' is incompatible with i386:x86-64 output
That message means you're trying to link a 32-bit library (i386) to a 64-bit executable (x86-64). Since you didn't show what the exact commands were used to generate dyyrh.o and libnidaq.a there's no way to tell what you did wrong.
I would suggest checking the switches and options being passed in when you generated those two files. If you're using windres.exe, for example, make sure -F x86-64 is used. Similar if you're using dlltool.exe, there's a similar switch -m x86-64.
You can use objdump on your generated files to check that its format is correct and consistent with the rest of your project build. eg.
objdump -t dyyrh.o
and
objdump -t libnidaq.a
Can anybody help me?
gcc -o uartsim.exe xtmpmain.o uartsim.o fiber_driver.o xtmp_options.o getopt.o D:\usr\xtensa\XtDevToolsDE\install\tools\RB-2008.4-win32\XtensaTools\lib\iss\xtmp.lib
gcc: xtmpmain.o: No such file or directory
make: *** [uartsim.exe] Error 1
You are trying to build an executable (uartsim.exe) and some of the things you need to build it aren't present. That is to say, you haven't built the .o files before trying to link them into an exe. Your makefile is probably broken.