Quantcast
Channel: Active questions tagged gcc - Stack Overflow
Browsing all 22192 articles
Browse latest View live

Can not compile rtl8821CU wifi driver [closed]

I just installed a new Ubuntu 22.04 system on my desktop. I installed build-essentials and started installing drivers for my wifi adapter. I downloaded the rtl8821CU source code and ran make. I get the...

View Article


ld: error: undefined symbol: omp_init_nest_lock when executing C code on...

I'm developing a mobile application on Android Studio based on a code generated by MATLAB Coder.I've just added the .c files on CmakeFiles.txt to check if the gradle would compile. Instead, it is...

View Article


Is GCC/Clang able to auto-vectorize std::inner_product?

I have the following code:#include <iostream>#include <numeric>int main() { volatile float a0[4] = {1, 2, 3, 4}, a1[4] = {4, 5, 6, 7}; std::cout << std::inner_product(a0, a0 + 4, a1,...

View Article

Multiple glibc libraries on a single host

My linux (SLES-8) server currently has glibc-2.2.5-235, but I have a program which won't work on this version and requires glibc-2.3.3.Is it possible to have multiple glibcs installed on the same...

View Article

C++ code that compiles in gcc 9.3 but not in gcc 10.2

The following code compiles in gcc 9.3, but not in gcc 10.2:constexpr std::array<int, 2> opt = {1,2}; template <typename T>constexpr auto f(const T& arr) { std::array<int,...

View Article


How do I link startup file inside of static library in GCC?

ClarificationI want to create static library from my code to share the artifacts (but not the code). I will call this Main_Project.In my Main_Project, I have startup.s and flash.ld files.startup.s:...

View Article

Is there a 128 bit integer in gcc?

I want a 128 bit integer because I want to store results of multiplication of two 64 bit numbers. Is there any such thing in gcc 4.4 and above?

View Article

Getting auto-vectorization with GCC?

In the context of evaluating negative-log-likelihoods, I have toperform a bunch of operations that could benefit from vectorization:for (i = 1...n) { a[i] = 0; } // but this I thinkstd::fill(...

View Article


Are arrays treated as static data structures by gcc compiler or as dynamic?...

I thought arrays were considered static data structures.Then we executed this:#include <stdio.h>#include <stdlib.h>int main(){ int a[5] = {10,20,30,40,50}; a[5] = 100; a[6] = 200;...

View Article


How to compile unit tests for 32bit code with gcc14 to run on x86_64

I want to compile some unit tests for a 32bit device to run on my x86_64 host. I need to compile it in 32bit mode because some of the code uses bitwise operations to align pointers to 4 byte...

View Article

How to relocate .text sections when using LTO?

I have firmware a project that needs to have some .text sections split up into different memory areas.They are spilt using the names of the source-code files, or by function name wildcards in the...

View Article

Allow double floating point comparisons with Unity unit testing framework...

I'm having some trouble somewhere with the linker while trying to compile a test written using the Unity testing framework by Throw The Switch. I have other tests that compile and run perfectly fine so...

View Article

Strange libgcov profiling error: Version mismatch

I'm building a C++ application with g++ and code coverage using a docker container (see below). Everthing is fine until here.But when I execute the program in the same containerdocker run -it ... image...

View Article


Cast float to int with consistent results accross platforms/compilers/cpu...

I wrote a program to do some float caculation and cast the result to int; When I submit the job to the cluster multiple times, I got different result even when I provided same parameters; // compiled...

View Article

What kind of executable is produced by gcc wtih `-static-pie`?

The question is specific (but not limited to) to a bare-metal Risc-V code, I am trying to understand what would be required in order to compile a position-independent firmware binary. I tried to...

View Article


Define a fixed-position section within a Linker Script of...

I am trying to build a static position-independent executable with gcc provided option -static-pie. The target is bare-metal risc-v, so no OS, no dynamic loader. I have a linker script similar to...

View Article

Would a modern compiler optimize "if false" paths?

Would a modern compiler (GCC) be smart enough to optimize this no-op function out?I know that they can optimize no-op's out but I'm wondering how well they can determine if a function call is actually...

View Article


Why is clock_gettime() not working with MinGW, even though I have time.h

The linker keeps telling me that clock_gettime() is undefined.I have tried using -lrt but then gcc says that it can't find that either.Am I missing some extra library I needed to download?//...

View Article

different initializ and sign pointer value in global and function

I know I will get many down grade regarding this question, but I still write following test code:int *gPtr;//I know I can NOT write below code line, but I need know WHYgPtr = NULL;//or some other value...

View Article

‘INT_MAX’ not declared error in 3-rd party projerct [closed]

I'm trying to compile some third party project (FreeFT). I've installed all required dependencies, but when I issue make game this error "‘INT_MAX’ was not declared in this scope" occurs for any...

View Article
Browsing all 22192 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>