Static Analyzer error with iOS8 SDK - static

Recently I updated to Xcode 6 beta 6 with iOS 8 SDK. And while running static analyser I jumped into a problem with the following errors.
error: error reading 'pic'
error: no analyzer checkers are associated with '-mrelocation-model'
2 errors generated.
Command /Applications/Xcode6-Beta6.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang failed with exit code 1
Any Idea what is these errors and how to fix it. Thanks.

It´s a issue with the clang static analyzer.
Add to your existing analyzer entry under "Target" -> "Build Phases" -> "Compiler Flags" the suffix -Xanalyzer deadcode.
Complete entry should read as follows:
-w -Xanalyzer -analyzer-disable-checker -Xanalyzer deadcode

I have solve this problem recently you can solve using go to Xcode > Preferences > Location and remove all derived data in derived data folder and then clean and analyze

With the above answers in Xcode 8, I noticed build errors when using Swift compilation. Here's what Compiler Flags worked for me:
-w -Xanalyzer -analyzer-disable-all-checks

Related

Error while building gcc cross compiler for i686-elf on ubuntu16.04

bash screenshot
/osd-src/gcc-6.1.0/isl/include/isl/ctx.h:108:8: error: attempt to use poisoned "malloc"
malloc(size)))
^
/home/desai/osd-src/gcc-6.1.0/isl/include/isl/ctx.h:112:8: error: attempt to use poisoned "realloc"
realloc(ptr,size)))
this is the error msg while i am performing this command
$ make all-target-libgcc
I am following this link for installation http://wiki.osdev.org/GCC_Cross-Compiler
I am new to Linux and stack-overflow, guide me.
Somewhere in your code (or included code ) there is a poison pragma which was put in place to prevent you from using these identifiers.
There was version of ILS-0.12 which was not supported with cloog-v0.18 . I updated new version and reinstalled it. Works now.

Compilation error on include with ljpeg library in C

I have a project for college, where i need to use libjpeg (C language), to complete 2 codes the teacher gave to us. It's a about transforming a pic into ASCII symbols (like the ASCII draws, you know)
We have a code for reading a jpg and a code for writing a jpg.
The problem is i had to install the libjpeg, i THINK the installation went well but i'm not sure so i have 2 questions
How can i verify libjpeg is correctly installed ? i didn't link it to gcc so i have to use the option for saying to gcc where is jpeg-6b (the folder which contains ljpeg) so i tried this :
Typing "gcc -L/jpeg-6b" the folder is jpeg-6b and it's right on the location where i do the command. i only get an error message about the fact the input is empty (normal ok), i think if the lib was not correctly installed, i should get an error for saying me i can't use the libjpeg version, right ?
In the 2 codes i said the teacher gave to us, she puts #include <libjpeg> on the beginning of it. But i saw on the internet that people use #include <jpeglib.h>, but both of them DON'T work and i get a message telling me :
test.c:1:21: fatal error: jpeglib.h: no such file or directory
#include <jpeglib.h>
is my include bad? or is the libjpeg bad installed ? (i read the doc and i did ./configure then make like it's said)
Just as you add -L/jpeg-6b you need -I/jpeg-6b/path/to/jpeg/headers too. I would recommend a Makefile to automate this.

Installing codeBlock

This is my first time of trying to develop with C programming language. I tried installing codeblock on my window 8 operating system, but whenever I run the codeblock program I get this error in the image below
I installed codeblock hopping that it would install the compiler alongside, but I was disappointed. I do not know how to install the standalone compiler, I checked it up online, but I really do not know from where to start, and I do not know if the problem is with my system. I would appreciate help on how to make my codeblock work properly or any other suggestions. Thanks all.
When running CB for the first time, you are prompted with a "Compiler auto-detection" dialog/window.
It looks like you chose the WRONG COMPILER -> GCC for MSP430 micro controller!
Correct that to GCC/MinGW
EDIT - 1: Its usually the first option on the "Compiler auto-detection" dialog
EDIT - 2
I think you may also have selected the wrong compiler for your CB project
For C project, Follow these steps:-
Create a new project -> Console application for C/C++,
Skip the first page, click next
Provide a title & path, click next
at compiler selection screen, select "GNU GCC Compiler" instead of "GNU GCC Compiler for MSP430"
The compiler might not be included in the Code::Blocks you downloaded (if you got codeblocks-12.11-setup.exe). There's another downloadable binary (codeblocks-12.11mingw-setup.exe) that includes the MinGW environment with the GNU GCC compiler. You might want to try that one.
Step-1 : Visit www.mingw.org/
Step-2 : Download and install all package.(Specially mark the the file starting from mingw)
Step-3 : Goto to installation and Apply Changes.
Step-4 : Now open your code block
Step-5 : Goto to Setting->Compiler
Step-6 : Now click toolchain executable AND SELECT GNU GCC COMPILER
Step-7: Click autodetect and then OK
I hope this will definitely work out, All the best
Just goto setting > compiler and click on "restore default" . Then yes and ok .Done . I think it will never occur the error.

Finding an absolute path to a folder in Cygwin

I am running a Eclipse for C/C++ using cygwin GCC. I need to get the library path of "libws2_32.a", which is in C:\cygwin\lib\w32api for me in windows. However I do not understand how this is translated into a cygwin-path.
I've tried stuff like:
/cygdrive/c/cygwin/lib/w32api
/lib/w32api
/usr/lib/w32api
Any ideas?
EDIT: update
Here's the make Eclipse log used for building, if it helps:
make all
Building target: Filesharing_core.dll
Invoking: Cygwin C Linker
gcc -L/cygdrive/c/cygwin/lib/w32api -shared -o"Filesharing_core.dll" ./src/test.o -llibws2_32.a
/usr/lib/gcc/i686-pc-cygwin/3.4.4/../../../../i686-pc-cygwin/bin/ld: cannot find -llibws2_32.a
collect2: ld returned 1 exit status
make: *** [Filesharing_core.dll] Error 1
It's not a problem with the path; it's a problem with the name of the library (the -l option).
Where you have entered libws2_32.a, instead enter ws2_32.
See the GCC manual for how the -l option works.
Generally, when asking for help with programming, don't describe, but show. Don't describe what you're doing; don't describe what you think the error is. Instead, show exactly what you're doing, show the exact code (or a cut down version that exhibits the same problem), and show the exact error message.
This way others don't have to guess as to what's wrong, and you are more likely to receive an answer right away that solves your problem.
You can use the find utility to find the file, although it may take a while.
find / -name libws2_32.a -print
Edit: Based on your edit to the question, simply move -llibws2_32.a to before ./src/test.o.
The folder C:\Opt\Cygwin\lib\w32api or whatever it is in your system is simply /lib/w32api from within Cygwin. The library you're looking for is /lib/w32api/libws2_32.a.
But I'm not sure what you're trying to achieve. I guess your Eclipse in running in Windows, and not from a Cygwin'ized version of Java? Why are you using Cygwin GCC? Do you want to compile for Cygwin? If not, MinGW or TDM-GCC would be the tool to pick.
If you do want to compile for the Cygwin environment using Eclipse (a combination I haven't tried), then user experience like the following might be helpful:
http://www.benjaminarai.com/benjamin_arai/index.php?display=/eclipsecygwingcc.php
(I simply googled: eclipse cygwin gcc)

Why am I getting the message "Single-stepping until exit . . . which has no line number information" in GDB?

I've compiled my C program using gcc 4.4.1 using the flag -g, but when I try to step through one of my functions in gdb version 7.0, I get the message:
"Single stepping until exit from function _DictionaryTree_getNodeList,
which has no line number information."
Can someone tell me why this is happening?
Just guessing, but is _DictionaryTree_getNodeList in another file that wasn't compiled with -g?
I had the same problem but in my case adding -g to the compiler wasn't enough so I used -ggdb as suggested by Manav.
In my case, the problem was version skew between gcc and gdb.
After landing here from search and none of these answers fit my situation, I figured out that (because of aliases / symlinks / Makefile / environment variables) I was accidentally using a newer GCC (4.8.x) and an older GDB (7.2). Stepping up to a newer version of GDB (7.8) fixed the problem. For some reason, using a newer GCC and older GDB didn't work.
I had this error message too but the source of my problem was different. If anyone is still having any problems, make sure you have #include <stdio.h> in your file, with the the appropriate brackets around stdio.h (the text message would not show up if I had it around stdio.h).
I had the same issue, when I compiled a file using -g option and without -g option.
For one of the file, the gdb showed line number without any issues(even when it was compiled without -g option)..
And for the other file, I had to explicitly mention -g flag...
Any ideas as to whether the source file could be loaded at run time in
GDB with cross referencing would be good solution... by mapping the
lines to the addresses :D.
I had this issue because I was debugging a shared library without pointing LD_LIBRARY_PATH to correct location with debug endstates.
you can use
export LD_LIBRARY_PATH=<location of the debug build of the .so file>:$LD_LIBRARY_PATH
Hopefully this is helpful to someone
I had the same trouble despite I was already compiling with -g2. Changing it to -g3 did the trick.
Im using GBD 12 , im not able to use any of these flags and options , also im debugging .exe file , so yes I used makefile

Resources