I have downloaded OpenMPI, but after trying to run a simple parallelized Hello world program I get the following error:
Undefined symbols for architecture x86_64:
"_main", referenced from:
implicit entry/start for main executable
ld: symbol(s) not found for architecture x86_64
collect2: error: ld returned 1 exit status
I guess there is a problem with the compiler because I struggled quite a lot to install OpenMPI.
In order to get that error I typed from the terminal:
mpifort -o hello.f90
Someone can help me?
Related
I'm trying to compile a projet with a makefile but I get this error message :
g++ testVecteur2D.o Vecteur2D.o -o testVecteur2D
ld: warning: ignoring file Vecteur2D.o, building for macOS-arm64 but attempting to link with file built for unknown-x86_64
ld: warning: ignoring file testVecteur2D.o, building for macOS-arm64 but attempting to link with file built for unknown-x86_64
Undefined symbols for architecture arm64:
"_main", referenced from:
implicit entry/start for main executable
ld: symbol(s) not found for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make: *** [testVecteur2D] Error 1
my code is working on other computer so I don't understand why it is not on mine. For information I'm using de new m1 Mac maybe it has something to do with it.
I just installed OpenMP by running
$ brew install gcc
Than I ran my code using
$ gcc-10 -o task -fopenmp task.c
However I got the error message:
Undefined symbols for architecture x86_64:
"_main", referenced from:
implicit entry/start for main executable
ld: symbol(s) not found for architecture x86_64
collect2: error: ld returned 1 exit status
My code is:
#include <omp.h>
Can someone help me?
I solved this problem replacing gcc with g++
I was able to use umfpack, but I just found that I cannot use it as before. I guess the reason is my recent update of Mac.
I already installed SuiteSparse VERSION 4.5.4. I use the Fortran interface, umfpack.f90, from http://geo.mff.cuni.cz/~lh/Fortran/UMFPACK/. And use gfortran umfpack.f90 umfpack_simple_3subr.f90 -L/usr/local/lib -lumfpack to compile. But I got the following errors:
Undefined symbols for architecture x86_64:
"__gfortran_os_error_at", referenced from:
___mumfpack_MOD_umfpack_zi_operator_pcsr in ccAIP7gL.o
___mumfpack_MOD_umfpack_zi_operator_pcsc in ccAIP7gL.o
___mumfpack_MOD_umfpack_zi_operator_csr in ccAIP7gL.o
___mumfpack_MOD_umfpack_zi_operator_csc in ccAIP7gL.o
ld: symbol(s) not found for architecture x86_64
collect2: error: ld returned 1 exit status
I have no clue about solving the problem. Any suggestion is appreciated! Thank you in advance!
I have a program that i am trying to compile from my project directory and haven't been able to wrap my head around the following error
My compilation command
g++ grades.cpp -o grades
I see the following error
Undefined symbols for architecture x86_64:
"tbb::task_scheduler_init::initialize(int, unsigned long)", referenced from:
tbb::task_scheduler_init::task_scheduler_init(int, unsigned long) in grades-9c8d1a.o
"tbb::task_scheduler_init::terminate()", referenced from:
tbb::task_scheduler_init::~task_scheduler_init() in grades-9c8d1a.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
I am not sure how to debug this error.
You need to link against the tbb library you are tying to use,
g++ grades.cpp -o grades -ltbb
I am using Lear's implementation of the Gist descriptor for a project which can be found here: http://lear.inrialpes.fr/software.
I am writing an application in c++ and I want to use this library. I am having issues though with the makefile and linking in general.
These commands give me no errors:
g++ -c standalone_image.c -o standalone_image.o
g++ -c gist.c -o gist.o
However, this line
g++ compute_gist.c `pkg-config --cflags --libs opencv`
gives me the following error
Undefined symbols for architecture x86_64:
"color_gist_scaletab(color_image_t*, int, int, int const*)", referenced from:
_main in ccMFYbAU.o
"color_image_delete(color_image_t*)", referenced from:
_main in ccMFYbAU.o
"color_image_new(int, int)", referenced from:
load_ppm(char const*)in ccMFYbAU.o
ld: symbol(s) not found for architecture x86_64
collect2: ld returned 1 exit status
I have the Mosaic c++ code in a different directory. I also tried to compile gist and standalone_image seperately, copy into the mosaic directory, and compile the Mosaic code.
Which gives me the following error:
Undefined symbols for architecture x86_64:
"color_gist_scaletab(color_image_t*, int, int, int const*)", referenced from:
_main in main.o
ld: symbol(s) not found for architecture x86_64
collect2: ld returned 1 exit status
make: *** [mosaic] Error 1
I really want to use this library in my project, but I can't figure out a way to incorporate it in my c++.
Any help is GREATLY appreciated! Thanks!
Edit: I am using Mac Lion with:
gcc + g++ version: i686-apple-darwin11-llvm-gcc-4.2 (GCC) 4.2.1 (Based on Apple Inc. build 5658) (LLVM build 2336.1.00)
The lear library also uses the FFTW3 library that should work with C and C++.
The problem was that I needed the extern around the gist include, but the linking that was done in the Makefile was also wrong. It works now. :)