Hiding symbol names in library
I want to hide symbol names which are not relevant to the last user and make visible only APIs in my shared or static library. I have a simple code like that:int f_b1(){ return 21 ; } int f_b3(){...
View ArticleHow do I import to my c project?
I'm using vscode and I have cl and gcc compilers.I want to use the winternl.h header in my C language project.When I compile with gcc (mingw), it gives me a fatal error that winternal.h is not...
View ArticleRemoving trailing newline character from fgets() input
I am trying to get some data from the user and send it to another function in gcc. The code is something like this.printf("Enter your Name: "); if (!(fgets(Name, sizeof Name, stdin) != NULL)) {...
View ArticleHow to run c unit testcases using CMOCKA framework?
I have recently started working on a project written in C language. To add unit test cases, I searched for C unit test frameworks and I came across this answer C-unittest-frameworks. So I chose mocka...
View ArticleWhere is PATH_MAX defined in Linux?
Which header file should I invoke with #include to be able to use PATH_MAX as an int for sizing a string?I want to be able to declare:char *current_path[PATH_MAX]; But when I do so my compiler...
View ArticleAddressSanitizer: How could we know that object file/executable in C is...
We are planning to integrate AddressSanitizer tool into our build infrastructure.For that i am working on our GNUmake files to compile all my C code with AddressSanitizer (adding flag...
View ArticleHow to add compiler flags on codeblocks
I've been trying to compile a simple multithreaded piece of code I found online in an effort to learn how to multithread. To run this piece of code I need to use the compiler flags: -pthread and...
View ArticleRuby Rails - issue with gcc on mac
I am trying to create my first application on ruby rails. I am on Mac OsX (Mavericks)I have the latest xCode installed (5 i believe) + command line toolsI have installed the bitnami bundle ruby stackI...
View Articlemingw32/bin/ld.exe ... undefined reference to [class] ... collect2.exe:...
Problem description while I am trying to move my code from Linux to Windows:MinGW on Windows linker problemshappens when I am calling a user-defined class inside my Main.cpp ( works fine if I do not...
View ArticleIn C language, can I access local variable of main function in another...
I need to access the value of variable a which is defined in main function without passing it as argument.main() { int a=10; func(); printf("%d\n",a); } void func(){ //i need access of variable a here....
View Articlegcc version not compatible with progol software
I am using an ILP system named proGol which is not anymore state of the art; progol implementation has been in C though the syntax of coding is similar to prolog. However, I can run it on old machines...
View Article`go run: cannot run non-main package` as Unprivileged User
I'm encountering an error with a recently-compiled golang compiler, but only as an unprivileged user. I'm hoping someone could provide advice on further troubleshooting ideas.As root:$ cd $HOME...
View ArticleLinker cannot find existing .so file passed to -l: with full path
I want to compile some C/C++ file against a shared object (.so file) which is not under the regular $LD_LIBRARY_PATH locations, using the -l:/path/to/file.so argument instead.(note that there are many...
View Articlewhat is implied by using the -L in gcc flag in gcc post-ceded by a dot
psp-gcc -I. -IC:/pspsdk/psp/sdk/include -O2 -G0 -Wall -D_PSP_FW_VERSION=150 -L. -LC:/pspsdk/psp/sdk/lib main.o -lpspdebug -lpspdisplay -lpspge -lpspctrl -lpspsdk -lc -lpspnet -lpspnet_inet...
View Articleopenssl fails to build with pip install
Please help.Trying to install python cryptography package:pip install triggergcc -pthread -B /home/dan/.conda/envs/py27/compiler_compat -Wl,--sysroot=/ -fno-strict-aliasing -g -O2 -DNDEBUG -g -fwrapv...
View ArticleHow to compile c++ files using Makefile
I am trying to compile makefile using make command and bitbake recipe both are showing different error. Important part of Makedfile is shown below CC = gcc VERSION = 0.0.1 #CFLAGS = -Wall -g -O2...
View ArticleWhy is C++ executable running so much faster when linked against newer...
I have a project (code here) in which I run benchmarks to compare the performance of different methods for computing dot product (Naive method, Eigen library, SIMD implementation, ect). I am testing on...
View ArticleUpdating libstdc++.so.6 to GLIBCXX_3.4.21 and CXXABI_1.3.9 after updating to...
I have a RHEL server (Maipo), and I did the Installing gcc 7.3 (gcc 7.3.0) - released 01/25/2018. For installing gcc, I followed How to Install gcc 5.3 with yum on CentOS 7.2?However, when installing...
View ArticleHow to generate .lib files with mingw toolchain?
I have installed MingW GCC 4.8.1 in my system. I am trying to build the LLVM source code( with some extra modification). Cmake 2.8.12 is used to generate the makefiles and visual studio solution files....
View ArticleChange text color using C
I've been reading some few articles about changing text color using C, but the problem is they all tend to be related to Turbo Ctextcolor(RED); And I have a need to change the color of variable: value...
View Article