compilation

Edit and compile a kernel module

五迷三道 提交于 2021-01-29 07:17:18
问题 I'm trying to edit one module from kernel source and compile it for kernel: 5.4.0-40-generic #44-Ubuntu . This is how i did it: git clone git://git.launchpad.net/~ubuntu-kernel/ubuntu/+source/linux/+git/focal git checkout -b temp Ubuntu-5.4.0-40.44 nano drivers/media/usb/siano/smsusb.c make oldconfig make prepare make modules_prepare make SUBDIRS=scripts/mod make SUBDIRS=drivers/media/usb/siano modules cd drivers/media/usb/siano/ insmod smsusb.ko I got this error: insmod: ERROR: could not

Make Eclipse generate C++ executable file

妖精的绣舞 提交于 2021-01-29 05:21:49
问题 Using latest MinGW and C++ Eclipse. If I create an "Executable Hello World" project, build it and run it, everything works as expected. If I create an "Executable Empty Project", then create a main.cpp file, build and run, I get the error message "Launch failed. Binary not found." How can I make empty project generate binary files? I looked everywhere in the project properties but I must have missed it. 回答1: For me the solution was this: select your project and goto "project"-menu/properties

Gradle not generate jar

我们两清 提交于 2021-01-28 08:54:08
问题 I have a problem with gradle. My project It consists of several modules (osgi). When I run command: ./gradlew clean assemble Gradle generate the jar file for each module, but I want use the command: ./gradlew clean compileJava to speed up the work, but with this command gradle don't generate the jar file for two module. what could be the reason? 回答1: You can see in the diagram in figure 1 from this documentation the dependencies between Java plugin tasks: see that assemble tasks dependes on

Define new code section in assembly code to compile ELF binary

 ̄綄美尐妖づ 提交于 2021-01-28 08:06:41
问题 I defined a new code section in my assembly program, which is going to be compiled into 32-bit ELF binary, on x86. I use the linker scripts to assign a specified address for this new code section, it works. However, I noticed that this new section does not be loaded to the memory, after some debugging! I use readelf and figure out that there is no "execution" privilege of this new section: [15] .trampoline PROGBITS 080483d0 004020 000117 00 0 0 16 Then I did this: objcopy --set-section-flags

Error while compiling Inkscape from source code

…衆ロ難τιáo~ 提交于 2021-01-28 05:22:13
问题 Not having well knowledge on dealing with C++ projects, I have downloaded the source code of Inkscape from its GitLab repository and made few changes (adding small feature) and tried to compile based on the instruction provided in INSTALL.md and other sources available on their website. While it seems I have all the dependencies installed on the system, I get this result after running cmake in build folder: ------------------------------ Building Makefile for Inkscape ------------------------

Detecting wrongful aliasing at compile or run time

浪尽此生 提交于 2021-01-28 04:37:42
问题 Is there some tool (or compile flag) that can detect problematic aliasing in Fortran code either during compilation or at run time? I see gfortran has -Waliasing , but that only detects the most egregious case (e.g. call whatever(x,x) , but not call whatever(x(1),x(1)) ). Intel's ifort has -fno-alias , but apparently that just means the compiled code may give different results. Consider a code like this: program main implicit none real :: x(100) integer :: i do i=1,size(x) x(i) = i end do

How to make xcodebuild print compile errors and warnings to stderr?

与世无争的帅哥 提交于 2021-01-27 22:36:18
问题 Seems like xcodebuild prints everything to stdout. $ /Applications/Xcode.app/Contents/Developer/usr/bin/xcodebuild -project test.xcodeproj build -target test -configuration Debug -jobs 3 2>err # xcodebuild stdout with bunch of warnings and errors $ cat err ** BUILD FAILED ** The following build commands failed: CompileC _build/test.build/Objects-normal/x86_64/test.o /Users/me/test/test.cpp normal x86_64 objective-c++ com.apple.compilers.llvm.clang.1_0.compiler (1 failure) That doesn't let my

Can you pass your code directly into gcc? For example: gcc -? 'int main(){return 0;}'

≡放荡痞女 提交于 2021-01-27 18:54:19
问题 Can you pass your code directly into gcc? If so what is the command line option for it? For example: g++ -? 'int main(){return 0;}' I need to know because I am using a system command and I rather not make files: system("g++ -C "+code_string+" -o run.out"); Basile Starynkevitch solution worked, however I am getting compile errors when I use newlines: echo '#include\nint main(){printf("Hello World"); return 0;}' | g++ -x c++ -Wall -o myprog /dev/stdin Edit: fixed it echo -e '#include\nint main(

How can flex return multiple terminals at one time

故事扮演 提交于 2021-01-27 18:51:22
问题 In order to make my question easy to understand I want to use the following example: The following code is called nonblock do-loop in fortran language DO 20 I=1, N ! line 1 DO 20 J=1, N ! line 2 ! more codes 20 CONTINUE ! line 4 Pay attention that the label 20 at line 4 means the end of both the inner do-loop and the outer do-loop. I want my flex program to parse the feature correctly: when flex reads the label 20 , it will return ENDDO terminal twice. Firstly, because I also use bison, so

How to compile Qt 5.8 statically with PostgreSQL plugin in VS2015

北战南征 提交于 2021-01-27 17:39:55
问题 Can anybody who may have any idea compiling Qt 5.8 Open Source statically with PostgreSQL support on Windows. I tried all the options known to me including the below. I'm using qt 5.8 sources on Windows 10 x64. configure -opensource -confirm-license -debug-and-release -static -platform win32-msvc2015 -nomake examples -nomake tests -sql-psql PSQL_LIBS="C:\PSQL\9.6\lib\libpq.lib" -I C:\PSQL\9.6\include\libpq -I C:\PSQL\9.6\include -L C:\PSQL\9.6\lib\libpq.lib After running the config above, I