I am compiling linux source code for android emulator. When i execute make command(for building and cross-compiling the linux source) i get the following error "pmem.c" file.
root#ubuntu:~/common# make
CHK include/linux/version.h
CHK include/linux/utsrelease.h
SYMLINK include/asm -> include/asm-x86
CALL scripts/checksyscalls.sh
CHK include/linux/compile.h
CC drivers/misc/pmem.o
drivers/misc/pmem.c:441: error: conflicting types for ‘phys_mem_access_prot’
/home/preetam/common/arch/x86/include/asm/pgtable.h:383: note: previous declaration of ‘phys_mem_access_prot’ was here
drivers/misc/pmem.c: In function ‘flush_pmem_file’:
drivers/misc/pmem.c:805: error: implicit declaration of function ‘dmac_flush_range’
drivers/misc/pmem.c: In function ‘pmem_setup’:
drivers/misc/pmem.c:1265: error: implicit declaration of function ‘ioremap_cached’
drivers/misc/pmem.c:1266: warning: assignment makes pointer from integer without a cast
make[2]: *** [drivers/misc/pmem.o] Error 1
make[1]: *** [drivers/misc] Error 2
make: *** [drivers] Error 2
root#ubuntu:~/common#
how to resolve this error. It seems that there may some problems in the "pmem.c" file and i'll have to choose different git repository. but that would be a very complex thing, as now i have already done most of the things till here. I might have to see correct version of this file. please someone tell what should i do?
how to solve this errors.
please help..thankyou!
There are several errors in the message you pasted, both conflicting types and implicit declarations. Three things that you might want to verify:
did you choose the correct processor architecture (ARCH) and cross compiler definition
does the chosen architecture mix in files from another arch (this is difficult to check, but you can start by checking the location of the files that are mentioned in the error message)
check these files themselves, to see it this is a bug (very unlikely, but you never know) and that you actually have to change some code
Related
I'm completely new to microcontroller programming and I'm facing my first problem.
I'm following tutorials and web documentation in order to starting with STM32 libraries, I tried to add CMSIS and HAL drivers into my stm32IDE but every time I try to build a huge quantity of errors occure. Someone can explain to me what is wrong ?
../Drivers/CMSIS/Device/ST/STM32F4xx/Source/Templates/iar/startup_stm32f412zx.s:399: Error: bad instruction `section .text:CODE:REORDER:NOROOT(1)'
../Drivers/CMSIS/Device/ST/STM32F4xx/Source/Templates/iar/startup_stm32f412zx.s:400: Error: bad instruction `i2c2_ev_irqhandler'
../Drivers/CMSIS/Device/ST/STM32F4xx/Source/Templates/iar/startup_stm32f412zx.s:403: Error: bad instruction `pubweak I2C2_ER_IRQHandler'
../Drivers/CMSIS/Device/ST/STM32F4xx/Source/Templates/iar/startup_stm32f412zx.s:404: Error: bad instruction `section .text:CODE:REORDER:NOROOT(1)'
../Drivers/CMSIS/Device/ST/STM32F4xx/Source/Templates/iar/startup_stm32f412zx.s:405: Error: bad instruction `i2c2_er_irqhandler'
../Drivers/CMSIS/Device/ST/STM32F4xx/Source/Templates/iar/startup_stm32f412zx.s:408: Error: bad instruction `pubweak SPI1_IRQHandler'
../Drivers/CMSIS/Device/ST/STM32F4xx/Source/Templates/iar/startup_stm32f412zx.s:409:
.
.
.
.
make: *** [Drivers/CMSIS/Device/ST/STM32F4xx/Source/Templates/iar/subdir.mk:91: Drivers/CMSIS/Device/ST/STM32F4xx/Source/Templates/iar/startup_stm32f407xx.o] Error 1
"make -j12 all" terminated with exit code 2. Build might be incomplete.
00:32:15 Build Failed. 5895 errors, 0 warnings. (took 2s.475ms)
You are trying to compile the IAR startup files with the GCC compiler. The startup assembler file that you want is under the directory gcc. The two assemblers have different syntax.
When converting to use the new build system on Xcode 10, I get the following error in my output for several of my extension targets.
<unknown>:0: error: if any output files are specified, they all must be
Command CompileSwift failed with a nonzero exit code
I have looked for a solution online, but the only reference I can find to this error is in the Swift compiler source code itself.
https://www.google.com/search?q=error_if_any_output_files_are_specified_they_all_must_be
Does anyone know how this error is actually triggered, or what I can do to fix it?
Ok, I had the same problem with one of our projects. Building or Archiving are always stopped with the error <unknown>:0: error: if any output files are specified, they all must be.
The solution for us was to set Compilation Mode to Incremental instead of Whole Module.
This means, you have to ignore the Validate Project Settings warning:
I am currently trying to compile the netCDF-DataReader in JModelica but it appears the package has been developed in Dymola. The process fails at the compilation stage:
netCD = compile_fmu('NcDataReader2.Examples.Simple',r'H:\Modelica\Modelica Libraries\NcDataReader2',compiler_log_level= 'w,i:log.txt')
CcodeCompilationError: Compilation of generated C code failed.
The log file created contains 326 lines. Midway it says
====== Model compiled successfully =======
But there are many errors after. Some of the errors include:
Warning: .drectve `/DEFAULTLIB:"LIBCMT" /DEFAULTLIB:"OLDNAMES" '
unrecognized collect2.exe: error: ld returned 1 exit status
mingw32-make1: *** [ceval_] Error 1 Cannot export
??_C#_01LFCBOECM#?4?$AA#: symbol not found Cannot export
??_C#_01NOFIACDB#w?$AA#: symbol not found
C:\JModelica.org-2.1\install\Makefiles\MakeFile:190: recipe for target
'fmume10' failed
I don't have much experience with compilers and debugging C-code and would prefer to spend my time focused on creating models; therefore this leads to a number of questions:
Are there patterns in this errror log that could be addressed in such a way to make Dymola libraries useable in other Modelica based programs, such as JModelica?
Are then any other compilers that may be more suited to cross-compatible models?
Am I wasting my time trying to make Dymola models run in JModelica? Would it be more sensible to recreate the model separately in JModelica? The lack of a front-end interface makes this tricky.
The problem is that the external libraries available in netCDF-DataReader needs to be compiled using the GCC compiler available in the JModelica distribution. Try to recompile the libraries using GCC and put the libraries in NcDataReader2\Resources\Library\win32 (or even better put them in NcDataReader2\Resources\Library\win32\gcc472)
I'm trying to compile PJSIP (version 2.6) on my Raspberry Pi 3 model B.
While running make dep && make, I get this error:
../../webrtc/src/webrtc//system_wrappers/source/cpu_features.cc
../../webrtc/src/webrtc//modules/audio_processing/aec/aec_core_sse2.c:15:23: fatal error: emmintrin.h: No such file or directory
#include <emmintrin.h>
^
compilation terminated.
../../webrtc/src/webrtc//modules/audio_processing/aec/aec_rdft_sse2.c:13:23: fatal error: emmintrin.h: No such file or directory
#include <emmintrin.h>
^
compilation terminated.
How can this be fixed?
I ran into the exact same issue trying to do exactly what you are doing.
I found a few solutions online but was not satisfied with any of them. They all seemed like nasty hacks.
I looked into the configure script and discovered that sse2 is only required for compiling libwebrtc, which I did not need. Thus I simply disabled the compilation of libwebrtc alongside other things that I didn't need:
./configure --disable-sdl --disable-ffmpeg --disable-v4l2 --disable-openh264 --disable-libwebrtc
Note that --disable-v4l2 is referencing video4linux2.
After that the compilation completed successfully.
Looks like this was solved in this thread: https://www.raspberrypi.org/forums/viewtopic.php?f=28&t=178384
This question/answer will eventually serve as complete answer for this question: How can I manipulate/rotate a JPEG image in C++? Since the answers given to that question are only useful if you have already done all of this below.
I followed the guide here: Compiling libjpeg
(The accepted answer guide using MINGW32 Shell)
It doesn't work despite having downloaded a fresh copy:
$ make
make all-am
make[1]: Entering directory `/c/tmp/jpeg-9'
CC jaricom.lo
CC jcapimin.lo
jcapimin.c:127:1: error: conflicting types for 'jpeg_suppress_tables'
jcapimin.c:128:1: note: an argument type that has a default promotion can't matc
h an empty parameter name list declaration
In file included from jcapimin.c:22:0:
jpeglib.h:997:14: note: previous declaration of 'jpeg_suppress_tables' was here
make[1]: *** [jcapimin.lo] Error 1
make[1]: Leaving directory `/c/tmp/jpeg-9'
make: *** [all] Error 2
8d and 9 both do the same.
After making the change noted in this question: Compile libjpeg with mingw
Add the following definition to the jconfig.h
#define HAVE_PROTOTYPES 1
I get this output when making:
$ make
make all-am
make[1]: Entering directory `/c/tmp/jpeg-9'
CC jaricom.lo
In file included from jinclude.h:20:0,
from jaricom.c:17:
jconfig.h:5:24: warning: extra tokens at end of #undef directive [enabled by def
ault]
CC jcapimin.lo
In file included from jinclude.h:20:0,
from jcapimin.c:21:
jconfig.h:5:24: warning: extra tokens at end of #undef directive [enabled by def
ault]
jcapimin.c:127:1: error: conflicting types for 'jpeg_suppress_tables'
jcapimin.c:128:1: note: an argument type that has a default promotion can't matc
h an empty parameter name list declaration
In file included from jcapimin.c:22:0:
jpeglib.h:997:14: note: previous declaration of 'jpeg_suppress_tables' was here
make[1]: *** [jcapimin.lo] Error 1
make[1]: Leaving directory `/c/tmp/jpeg-9'
make: *** [all] Error 2
Then you have to run "autoheader" to fix this and make again.
It supposedly made but there is nothing in my build directory set by ./configure --prefix=/c/tmp/jpeg-9-build/
I found the libjpeg-9.dll in the .lib folder within the project directory.
Messy..Now the question is: How do I use it in Eclipse?
I have the exe's in the main directory, some exe's and the DLL in the .lib sub-directory but no .lib file - How do I go about importing these into an eclipse project so that I can call functions in the DLL?
$ make install gathered the files in the build directory.
I migrated the contents of the build directory into the working Eclipse project and linked the library and include paths:
I'm not sure if this is right for how I want to use it but it's something and it compiles. Next part: Calling functions out of the DLL?
Related to using compiled jpegtran.exe: jpegtran.exe not correctly rotating image
Trying to use libraries and compile in separate project: Need help compiling jpegtran.c code from libjpeg
Current issue: Need help compiling jpegtran.c code from libjpeg
Your advice for updating the jconfig.h file to #define HAVE_PROTOTYPES 1 is only a band-aid solution for a deeper problem: jconfig.h is corrupted and has incorrect #undef for many important items your compiler supports.
The proper way to work around this is to follow the install.txt advice to manually compile ckconfig.c and have it generate a jconfig.h for you, then proceed to make, and make install.