openmp in Xcode 4.2 - c

I just got the latest Xcode 4.2 and I am running into problems with openmp. I have a couple of projects written in C that compiled without any problem with Xcode 3.2.6 but with the new version strange things happen.
One of my projects produces a static library and when I compile it I get this error (not a warning):
Lexical or Preprocessor Issue
'omp.h' not found
I have enabled openmp support and selected the LLVM GCC 4.2 compiler. Although I get this error the static library is still generated.
Thinking it could be a conversion problem between 2 different versions of xcode, I created another project with Xcode v4.2 with a simple hello world-like program. I get exactly the same error and the program runs as it should. If I compile this project using the command-line xcodebuild I do not get any error.
Has anyone encountered this problem?

Yep, i have exactly the same problem. Not sure this is actually a real problem because the project seems to be correctly compiled.
I'd love to know what's the matter behind that too.
EDIT : finally, there's no error. The problem just comes from the Xcode 4 LLVM engine which shows constantly errors in the editor. And it can't parse the path. Don't know why.
If you want to get rid of that "error", you can use the direct path instead :
/usr/llvm-gcc-4.2/lib/gcc/i686-apple-darwin10/4.2.1/include/omp.h

Although the topic is old, I had the same problem with Xcode 5.1.
However, using the direct path doesn't suit for me, because I have to share the code in a developer group.
The problem here is I think, Xcode and the used compiler don't have the same search paths, so Xcode doesn't find the header meanwhile the compiler does.
I worked around this issue by copying the header to the folder of the set Framework:
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk/usr/include
This solved the problem for me.

Related

Clion: Error running 'makefile': Cannot build 'makefile'

I have not seen any thread talk about this specific error so here is the problem:
I have set up a C project in Clion and I configured in Setting -> Build,Execution,Deployment -> Toolchains a file usr/bin/make as the Make.
I could run my code yesterday but today, i get the warning in a red window popping-up: Error running 'makefile': Cannot build 'makefile' when I try to run my code.
What could possibly cause this?
It seems like you’re trying to run the makefile instead of the program that is built by it.
Have you tried doing a build first? Or maybe you should try to clean the project too.
Have a look a the blog post of JetBrains https://blog.jetbrains.com/clion/2020/06/makefile-projects-in-clion/. There’s a gif that shows how to clean the project. Hope this helps, if not maybe post your makefile so we can check if it has any errors.

ld: library not found for -lgmpxx

I'm new to c++ and trying to run the code here https://github.com/chussong/virasoro. After installing GMP and do a "make", I got the following error. I've no idea how to fix it now. Could anybody tell me what should I look into? Is that anything wrong with my gcc? Or how can I reinstall everything on my Mac to fix any possible issues? Thank you!
As mentioned in the comment above, a likely cause of the error above is that you have not installed libgmpxx, which is a supplementary library used by GMP to provide C++ class wrappers around the basic GMP library. If you built GMP from the source provided by the developers of the library (https://gmplib.org/) you can do this by specifying the --enable-cxx option when running configure. If you installed a packaged version from some repository, you should look at that repository to see if libgmpxx is also available there.

Eclipse nothing to build message in C project

I downloaded Eclipse Mars although I have been doing most of my work on Android Studio. The reason is I need another tool, which is not compatible with Android Studio. The procedures I followed instructed to create an executable C project. I then added hello world to it, but I can an error stating there is nothing to build. What am I doing wrong? All of this is setup on Ubuntu Virtual Machine. I have reviewed the posts online, but the error seems to be specific to each case. Here is a screen capture...
Compiler is simply telling you that your code was already compiled and there are no changes in your code, then it does not compile.
Is a builtin feature of compilers, if there are no changes in source code file, compilers do not waste time.
Clean Project before to Build Project or modify Hello.c and Build your project.

Using OpenCV2.2 with Code::Blocks 10.05. Error: ld.exe cannot find -lhighgui

I'm trying to build a simple webcam application in C++. I'm using wxWidget for GUI and OpenCV for image and video operations. But I'm having trouble setting up OpenCV on my IDE. When i try to run a sample code, or any code for that matter, I get an error that says:
ld.exe cannot find -lhighgui
I'v properly given the library and include links to the IDE. OpenCV's path is also added, I checked. I even tried linking each library file individually but id didnt work.
Please Help. :)
I'm using Windows 7 Professional X64 and Code::Blocks 10.05
Any kind of help will be appreciated.
--Aayush Shrestha
OpenCV library files have been renamed with version 2.2. You can link to the new library opencv_highgui instead of highgui.
You also need to do this for other OpenCV libraries you use.

Compiling C code as static library for use in iPhone app?

Pardon me if this is a "noob" question, I'm overextending myself a bit with this.
I'm trying to compile a library written in C for use in an iPhone app I'm developing. I can't seem to figure out how to do this, and I've been searching and trying things for hours.
I've tried using an External Build System project, and selecting the folder where the makefile.in.am.mingw are.
I've tried creating a Static Library project and adding the header\source files to the project. Which looked good until I tried to compile and got 260k+ errors.
When I 'cd' to the directory with the makefiles and type 'make' I get:
No targets specified and no makefile found. Stop.
I have no idea how makefiles work, I just want to use the library!
Is there a simple way to do this? If someone could at least point me in the right direction, I would be quite appreciative.
The makefiles you have are for GNU automake (under MINGW by the look of it). Even if you get them working (automake can be tricky, but it is included in Mac OS X's development thankfully), it probably won't help you much in building an iPhone library.
I did this with an existing C library by creating a new framework target in Xcode with the right include settings, etc gleaned from looking at the makefiles. That created a .framework bundle with headers and an iPhone .a library ready to be used by an iPhone project. You could also just import the C source into the iPhone project, and have it compiled in that way which would probably be quicker.

Resources