Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8638587
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T10:46:08+00:00 2026-06-12T10:46:08+00:00

I am trying to learn OpenMP, starting with the following simple snippet #include <stdio.h>

  • 0

I am trying to learn OpenMP, starting with the following simple snippet

#include <stdio.h>
#include <stdlib.h>

int main(void) {

    #pragma omp parallel
    printf("Hello OpenMP!\n");

    return 0;
}

Simply compiling from the command line works:

cls ~/Desktop $ gcc -fopenmp HelloOpenMP.c -o HelloOpenMP
cls ~/Desktop $ ./HelloOpenMP 
Hello OpenMP!
Hello OpenMP!

However, I’d like to use Eclipse with CDT. I created a new build configuration “OpenMP” and tried to add the -fopenmp flag under “Miscellaneous”, copying the other settings from the “Debug” build configuration.

enter image description here

The build fails with

14:56:16 **** Incremental Build of configuration OpenMP for project HelloOpenMP ****
make all 
Building file: ../src/HelloOpenMP.c
Invoking: GCC C Compiler
gcc -O0 -g3 -Wall -c -fmessage-length=0 -fopenmp -MMD -MP -MF"src/HelloOpenMP.d" -MT"src/HelloOpenMP.d" -o "src/HelloOpenMP.o" "../src/HelloOpenMP.c"
Finished building: ../src/HelloOpenMP.c

Building target: HelloOpenMP
Invoking: MacOS X C Linker
gcc  -o "HelloOpenMP"  ./src/HelloOpenMP.o   
Undefined symbols for architecture x86_64:
  "_GOMP_parallel_end", referenced from:
      _main in HelloOpenMP.o
  "_GOMP_parallel_start", referenced from:
      _main in HelloOpenMP.o
ld: symbol(s) not found for architecture x86_64
collect2: ld returned 1 exit status
make: *** [HelloOpenMP] Error 1

So I guess this was not the right place to add the -fopenmp compiler option? What configuration should I use to build with OpenMP?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-12T10:46:09+00:00Added an answer on June 12, 2026 at 10:46 am

    Add -fopenmp flag to the linker section as well.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to learn how to use OpenMP by parallelizing a monte carlo code
I was trying learn lex and yacc using the oreilly book. I tried following
Trying to learn C++ and working through a simple exercise on arrays. Basically, I've
Trying to learn jquery here so I took a regular javascript snippet that loops
Just trying to learn C++. I'm starting off with a scraper. The idea is
i am trying to learn building own jquery plugin . with the simple example
I'm trying to learn the concepts OpenMP and stumbled upon a case which I'm
Trying to learn asio, and I'm following the examples from the website. Why is
Trying to learn Haskell. I am trying to write a simple function to remove
Trying to learn shaders and get a dead simple directional light source working but

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.