Compilation error - c

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.

Related

Why Terminal told me this "No rule to make target 'xxx.o', needed by 'xxx.mod'. Stop" when I run 'make' on Ubuntu18.04LTS?

I'm trying to cross compile a drive for xilinx ZynqMPsoc's ARM Cortex A53 cpu on Ubuntu 18.04LTS, My Linux version is 5.4.0-131-generic (buildd#lcy02-amd64-092) , gcc version is 7.5.0 (Ubuntu 7.5.0-3ubuntu1~18.04)
The workspace folder contains 2 files: chrdevbase.c, Makefile. The details of Makefile are shown below:
`
KERN_DIR := /home/edaos/programfiles/linuxkernel-xlnx-xilinx-v2022.1/linux-xlnx-xilinx-v2022.1
obj-m := chrdevbase.o
all:
make ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu- -C $(KERN_DIR) M=$(PWD) modules
clean:
make -C $(KERN_DIR) M=$(PWD) clean
`
When I entered 'make' in terminal, it told me:
`
warning: the compiler differs from the one used to build the kernel
The kernel was built by: gcc (Ubuntu 7.5.0-3ubuntu1~18.04) 7.5.0
You are using: aarch64-xilinx-linux-gcc.real (GCC) 11.2.0
make[2]: *** No rule to make target '/home/edaos/programfiles/linuxkernel-xlnx-xilinx-v2022.1/linux-xlnx-xilinx-v2022.1/drivers/1_chrdevbase/chrdevbase.o', needed by '/home/edaos/programfiles/linuxkernel-xlnx-xilinx-v2022.1/linux-xlnx-xilinx-v2022.1/drivers/1_chrdevbase/chrdevbase.mod'. Stop.
Makefile:1868: recipe for target '/home/edaos/programfiles/linuxkernel-xlnx-xilinx-v2022.1/linux-xlnx-xilinx-v2022.1/drivers/1_chrdevbase' failed
make[1]: *** [/home/edaos/programfiles/linuxkernel-xlnx-xilinx-v2022.1/linux-xlnx-xilinx-v2022.1/drivers/1_chrdevbase] Error 2
`
Then I checked my workspace folder, it still contained 2 files: chrdevbase.c, Makefile.
So I wonder what is 'chrdevbase.mod' said in error? And what should I do to fix this bug?
Thank you very much for answering my question.
I tried to cross compile chrdevbase.c directly with aarch64-linux-gnu-gcc, the commands are as flows:
aarch64-linux-gnu-gcc -I /home/edaos/programfiles/linuxkernel-xlnx-xilinx-v2022.1/linux-xlnx-xilinx-v2022.1/include -l /home/edaos/programfiles/linuxkernel-xlnx-xilinx-v2022.1/linux-xlnx-xilinx-v2022.1/lib chrdevbase.c (/home/edaos/programfiles/linuxkernel-xlnx-xilinx-v2022.1/linux-xlnx-xlinx-v2022.1 is the folder where the linux's source code is stored )
Then the errors occurred again:
`
In file included from /home/edaos/programfiles/linuxkernel-xlnx-xilinx-v2022.1/linux-xlnx-xilinx-v2022.1/include/linux/kernel.h:8,
from chrdevbase.c:13:
/home/edaos/programfiles/linuxkernel-xlnx-xilinx-v2022.1/linux-xlnx-xilinx-v2022.1/include/linux/linkage.h:8:10: fatal error: asm/linkage.h: No such file or directory
8 | #include <asm/linkage.h>
| ^~~~~~~~~~~~~~~
compilation terminated.
`
I entered ($linux_source)/include, found that there is no folder named 'asm',but 'asm-generic'. At the same time, the folder '/usr/aarch64-linux-gnu/include' contained 'asm' and 'asm-generic'. Why is it so? What should I do to compile my drive file?

What does this linking error mean when installing portmidi?

After I configured the cmake file for portmidi, and proceeded to use make to make the necessary files, I encountered this error during compilation:
- Build files have been written to: /home/mycomputername
/Desktop/portmedia/portmidi
[ 2%] Linking C shared library /Release/libpmjni.so
/usr/bin/x86_64-linux-gnu-ld: cannot open output file /Release/libpmjni.so: No such file or directory
collect2: error: ld returned 1 exit status
pm_common/CMakeFiles/pmjni.dir/build.make:251: recipe for target '/Release/libpmjni.so' failed
make[2]: *** [/Release/libpmjni.so] Error 1
CMakeFiles/Makefile2:87: recipe for target 'pm_common/CMakeFiles/pmjni.dir/all' failed
make[1]: *** [pm_common/CMakeFiles/pmjni.dir/all] Error 2
Makefile:129: recipe for target 'all' failed
make: *** [all] Error 2
I'm quite confused. I've tried to insert the flags -fpic in the cxx-flags section of ccmake and change the default java install paths to no avail. Quite frankly, I think it has to do with the messing up of execution order, but I don't know where.
Any help will be greatly appreciated.
Apparently, there was some configuring to do in the directories that CMake points to in ccmake configuration. I just redownloaded the files and unzipped it into a newly made portmedia directory. Also, to make sure that you don't get any hiccups in making pm_defaults, refer to Nate's answer. To quote:
Apparently, one of the Makefiles generated by ccmake is broken. I was able to fix the issue by running
sed -i 's/pm_java\/pm_java/pm_java/' build.make
in the pm_java/CMakeFiles/pmdefaults_target.dir/ subdirectory of the
project after running ccmake . (on Ubuntu, though). (The sed
command replaces all occurrences of pm_java/pm_java by pm_java.)
Everything compiles, and I can even run pmdefaults from the
Release directory using
java -Djava.library.path=. -jar pmdefaults.jar

Cross-compiling mDNSPosix to armv6, "unable to recognise format of mdnsd"

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

Compile Contiki application with MRuby

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

PJSIP Application linking error

I'm trying to write a very small, very simple project using PJSIP. But I'm already stuck on the first step, incorporating PJSIP in my project. I'm trying to build and compile on a Ubuntu 14.04 system using an arm-linux-gnueabihf-gcc cross compiler. For the coding itself I'm using Eclipse CDT, but the crosscompiling part is working in a normal order.
I downloaded de pjproject-2.3 folder to my system, configured it with this command:
./configure --host=arm-linux-gnueabihf CFLAGS='--sysroot=/home/david/rpi/rootfs' LDFLAGS='--sysroot=/home/david/rpi/rootfs'
The /home/david/rpi/rootfs folder is where I copied the rootsystem of my Pi. I then ran 'make dep' and 'make'. I copied all the static libraries *.a to my Eclipse project folder and added the libraries to the linker (-l).
But when I want to build I get the following error:
Invoking: Cross G++ Linker
arm-linux-gnueabihf-g++ -L"/home/david/workspace/VoIPBenchmark" -L/home/david/rpi/rootfs/usr/lib -L/home/david/rpi/rootfs/usr/lib/arm-linux-gnueabihf --sysroot=/home/david/rpi/rootfs/ -o "VoIPBenchmark" ./src/SipImplemantation.o ./src/SipImplementationPJ.o ./src/Timer.o ./main.o -lpjsua2-arm-unknown-linux-gnueabihf -lpjsua-arm-unknown-linux-gnueabihf -lpjsip-ua-arm-unknown-linux-gnueabihf -lpjsip-simple-arm-unknown-linux-gnueabihf -lpjsip-arm-unknown-linux-gnueabihf -lpjsdp-arm-unknown-linux-gnueabihf -lpjmedia-audiodev-arm-unknown-linux-gnueabihf -lportaudio-arm-unknown-linux-gnueabihf -lpjmedia-codec-arm-unknown-linux-gnueabihf -lpjmedia-arm-unknown-linux-gnueabihf -lspeex-arm-unknown-linux-gnueabihf -lgsmcodec-arm-unknown-linux-gnueabihf -lsrtp-arm-unknown-linux-gnueabihf -lilbccodec-arm-unknown-linux-gnueabihf -lresample-arm-unknown-linux-gnueabihf -lpjnath-arm-unknown-linux-gnueabihf -lpjlib-util-arm-unknown-linux-gnueabihf -lpj-arm-unknown-linux-gnueabihf -lpthread -lm -lrt -lasound -llinphone
/home/david/rpi/tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian/bin/../lib/gcc/arm-linux-gnueabihf/4.8.3/../../../../arm-linux-gnueabihf/bin/ld: /home/david/workspace/VoIPBenchmark/libsrtp-arm-unknown-linux-gnueabihf.a(ctr_prng.o)(.text+0x8c): unresolvable R_ARM_ABS32 relocation against symbol `ctr_prng'
/home/david/rpi/tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian/bin/../lib/gcc/arm-linux-gnueabihf/4.8.3/../../../../arm-linux-gnueabihf/bin/ld: final link failed: Nonrepresentable section on output
collect2: error: ld returned 1 exit status
make: *** [VoIPBenchmark] Error 1
I googled some and tried to add -fPIC in the ./configure step above, recopied the libraries, but without result. Does anyone know what this message is saying me, and better yet, knows a solution?
This problem has been resolved. I was using a library that also linked to the srtp library, this evidently conflicted. So I am now not using the library that causes the problem.

Resources