rageworx / fl_imgtk

FLTK image toolkit for some useful effects

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[HELP] undefined reference error

Luciogi opened this issue · comments

even I use in my actual code I get same error
library is compiled using g++

$ cat test.cpp

#include "/home/oggy/projects/PicMe/fl_imgtk/lib/fl_imgtk.h"
#include <FL/Fl_PNG_Image.H>
int main(){
  Fl_PNG_Image* img = new Fl_PNG_Image("/home/oggy/Pictures/Square_200x200.png");
  fl_imgtk::rotate90(img);
}

$ g++ -lfltk -lfltk_images -std=c++11 -L /home/oggy/projects/PicMe/fl_imgtk/lib -l fl_imgtk test.cpp

/usr/bin/ld: /tmp/ccVPeWoH.o: in function `main':
test.cpp:(.text+0x3e): undefined reference to `fl_imgtk::rotate90(Fl_RGB_Image*)'
collect2: error: ld returned 1 exit status

Show us the output of the command nm /home/oggy/projects/PicMe/fl_imgtk/lib/fl_imgtk.a | grep "rotate90". The symbol must not be visible from the library you're linking against.

Here's my output for reference:

kevin@LMintDev1:~/proj/fl_imgtk/lib$ nm libfl_imgtk.a | grep "rotate90"
0000000000003838 T _ZN8fl_imgtk8rotate90EP12Fl_RGB_Image
00000000000000f6 t _ZN8fl_imgtk8rotate90EP12Fl_RGB_Image._omp_fn.0

Better yet, do nm -C, e.g:

kevin@LMintDev1:~/proj/fl_imgtk/lib$ nm -C libfl_imgtk.a | grep "rotate90"
0000000000003838 T fl_imgtk::rotate90(Fl_RGB_Image*)
00000000000000f6 t fl_imgtk::rotate90(Fl_RGB_Image*) [clone ._omp_fn.0]

@fire-eggs here is output of nm -C /home/oggy/projects/PicMe/fl_imgtk/lib/libfl_imgtk.a | grep "rotate90"

00000000 T fl_imgtk::rotate90(Fl_RGB_Image*)

full output

fl_imgtk_tonemap.o:
00000000 T fl_imgtk_F2Y(fl_imgtk_fimg*)
00000000 T fl_imgtk_F2RGB(fl_imgtk_fimg*, bool)
00000000 T fl_imgtk_F2YXY(fl_imgtk_fimg*)
00000000 T fl_imgtk_RGB2F(Fl_RGB_Image*)
00000000 T fl_imgtk_YXY2F(fl_imgtk_fimg*)
00000000 T fl_imgtk_F2RGB_ex(Fl_RGB_Image*, fl_imgtk_fimg*, bool)
00000000 T fl_imgtk_clamp_F2RGB(fl_imgtk_fimg*)
00000000 T fl_imgtk_discard_fimg(fl_imgtk_fimg*&)
00000000 T fl_imgtk_clamp_F2RGB_ex(Fl_RGB_Image*, fl_imgtk_fimg*)
00000000 T fl_imgtk_luminancefromY(fl_imgtk_fimg*, float&, float&, float&, float&)
00000000 T fl_imgtk_luminancefromYXY(fl_imgtk_fimg*, float&, float&, float&)
00000000 T fl_imgtk_tonemappingdrago(fl_imgtk_fimg*, float, float, float, float)
00000000 T fl_imgtk_rec709gammacorrect(fl_imgtk_fimg*, float)
00000000 T fl_imgtk_tonemappingreinhard(fl_imgtk_fimg*, fl_imgtk_fimg*, float, float, float, float)
         U Fl_RGB_Image::Fl_RGB_Image(unsigned char const*, int, int, int, int)
00000000 T fl_imgtk::tonemapping_drago(Fl_RGB_Image*, float, float)
00000000 T fl_imgtk::tonemapping_drago_ex(Fl_RGB_Image*, float, float)
00000000 T fl_imgtk::tonemapping_reinhard(Fl_RGB_Image*, float, float, float, float)
00000000 T fl_imgtk::tonemapping_reinhard_ex(Fl_RGB_Image*, float, float, float, float)
         U operator delete[](void*)
         U operator delete(void*)
         U operator new[](unsigned long)
         U operator new(unsigned long)
         U __gxx_personality_v0

fl_smimg.o:
         U Fl_RGB_Image::Fl_RGB_Image(unsigned char const*, int, int, int, int)
00000000 T ResizeEngine::verticalFilter(unsigned char const*, unsigned int, unsigned int, unsigned int, unsigned int, unsigned int, unsigned char*, unsigned int, unsigned int)
00000000 T ResizeEngine::horizontalFilter(unsigned char const*, unsigned int, unsigned int, unsigned int, unsigned int, unsigned int, unsigned char*, unsigned int)
00000000 T ResizeEngine::useSingleChannel(bool, char)
00000000 T ResizeEngine::scale(Fl_RGB_Image*, unsigned int, unsigned int)
00000000 T ResizeEngine::ResizeEngine(GenericFilter*)
00000000 T ResizeEngine::ResizeEngine(GenericFilter*)
00000000 W ResizeEngine::~ResizeEngine()
00000000 W ResizeEngine::~ResizeEngine()
00000000 T WeightsTable::getLeftBoundary(unsigned int)
00000000 T WeightsTable::getRightBoundary(unsigned int)
00000000 T WeightsTable::getWeight(unsigned int, unsigned int)
00000000 T WeightsTable::WeightsTable(GenericFilter*, unsigned int, unsigned int)
00000000 T WeightsTable::WeightsTable(GenericFilter*, unsigned int, unsigned int)
00000000 T WeightsTable::~WeightsTable()
00000000 T WeightsTable::~WeightsTable()
00000000 W typeinfo for ResizeEngine
00000000 W typeinfo name for ResizeEngine
00000000 W vtable for ResizeEngine
         U vtable for __cxxabiv1::__class_type_info
         U operator delete[](void*)
         U operator delete(void*)
         U operator new[](unsigned long)
         U operator new(unsigned long)
         U __gxx_personality_v0

fl_imgtk_clahe.o:
00000000 T applyCLAHE(unsigned char*, unsigned int, unsigned int, unsigned char, unsigned char, unsigned int, unsigned int, unsigned int, float)
00000000 T CLAHE_MakeLut(unsigned char*, unsigned char, unsigned char, unsigned int)
00000000 T CLAHE_Interpolate(unsigned char*, int, unsigned int*, unsigned int*, unsigned int*, unsigned int*, unsigned int, unsigned int, unsigned char*)
00000000 T CLAHE_MapHistogram(unsigned int*, unsigned char, unsigned char, unsigned int, unsigned int)
00000000 T CLAHE_ClipHistogram(unsigned int*, unsigned int, unsigned int)
00000000 T CLAHE_MakeHistogram(unsigned char*, unsigned int, unsigned int, unsigned int, unsigned int*, unsigned int, unsigned char*)
00000000 T fl_imgtk::CLAHE(Fl_RGB_Image*, unsigned int, unsigned int, float)
00000000 T fl_imgtk::noire(Fl_RGB_Image*, unsigned int, unsigned int, float, float)
00000000 T fl_imgtk::CLAHE_ex(Fl_RGB_Image*, unsigned int, unsigned int, float)
00000000 T fl_imgtk::noire_ex(Fl_RGB_Image*, unsigned int, unsigned int, float, float)
         U operator delete[](void*)
         U operator new[](unsigned long)

fl_imgtk.o:
         U fl_read_image(unsigned char*, int, int, int, int, int)
00000000 T fl_imgtk_curve(Fl_RGB_Image*, unsigned char const*)
00000000 T fl_imgtk_curve_ex(Fl_RGB_Image*, unsigned char const*)
00000000 T fl_imgtk_convertrgb(unsigned char*&, unsigned int, unsigned int, unsigned int, unsigned char*, unsigned int)
00000000 T fl_imgtk_gen_lowfreq(unsigned char**, unsigned char const*, unsigned int, unsigned int, unsigned int, unsigned int)
00000000 T fl_imgtk_sortcondition(int, int)
00000000 T fl_imgtk_putimgonbuffer(unsigned char*, unsigned int, unsigned int, unsigned int, Fl_RGB_Image*, int, int, float)
00000000 T fl_imgtk_subimgonbuffer(unsigned char*, unsigned int, unsigned int, unsigned int, Fl_RGB_Image*, int, int, float)
00000000 T fl_imgtk_t_set_kfconfig(fl_imgtk::kfconfig*, unsigned char, unsigned char, float, float, float const*)
         U Fl_RGB_Image::Fl_RGB_Image(unsigned char const*, int, int, int, int)
         U ResizeEngine::scale(Fl_RGB_Image*, unsigned int, unsigned int)
         U ResizeEngine::ResizeEngine(GenericFilter*)
00000000 W BSplineFilter::Filter(double)
00000000 W BSplineFilter::~BSplineFilter()
00000000 W BicubicFilter::Filter(double)
00000000 W BicubicFilter::~BicubicFilter()
00000000 W GenericFilter::~GenericFilter()
00000000 W BilinearFilter::Filter(double)
00000000 W BilinearFilter::~BilinearFilter()
00000000 W Lanczos3Filter::Filter(double)
00000000 W Lanczos3Filter::~Lanczos3Filter()
         U Fl_Image_Surface::draw(Fl_Widget*, int, int)
         U Fl_Image_Surface::image()
         U Fl_Image_Surface::Fl_Image_Surface(int, int, int)
         U Fl_Display_Device::display_device()
         U Fl::first_window()
00000000 T fl_imgtk::applyalpha(Fl_RGB_Image*, unsigned char*, unsigned int)
00000000 T fl_imgtk::applyalpha(Fl_RGB_Image*, float)
00000000 T fl_imgtk::brightness(Fl_RGB_Image*, double)
00000000 T fl_imgtk::rotatefree(Fl_RGB_Image*, float)
00000000 T fl_imgtk::contrast_ex(Fl_RGB_Image*, double)
00000000 T fl_imgtk::drawonimage(Fl_RGB_Image*, Fl_RGB_Image*, int, int, float)
00000000 T fl_imgtk::edgeenhance(Fl_RGB_Image*, unsigned int, unsigned int)
00000000 T fl_imgtk::filtered_ex(Fl_RGB_Image*, fl_imgtk::kfconfig*)
00000000 T fl_imgtk::makeanempty(unsigned int, unsigned int, unsigned int, unsigned long)
00000000 T fl_imgtk::sbutract_ex(Fl_RGB_Image*, Fl_RGB_Image*, int, int, float)
00000000 T fl_imgtk::blurredimage(Fl_RGB_Image*, float)
00000000 T fl_imgtk::draw_polygon(Fl_RGB_Image*, fl_imgtk::vecpoint const*, unsigned int, unsigned long)
00000000 T fl_imgtk::flipvertical(Fl_RGB_Image*)
00000000 T fl_imgtk::makealphamap(unsigned char*&, Fl_RGB_Image*, float)
00000000 T fl_imgtk::makealphamap(unsigned char*&, unsigned int, unsigned int, unsigned char)
00000000 T fl_imgtk::new_kfconfig(char const*)
00000000 T fl_imgtk::applyalpha_ex(Fl_RGB_Image*, float)
00000000 T fl_imgtk::brightness_ex(Fl_RGB_Image*, double)
00000000 T fl_imgtk::draw_fillrect(Fl_RGB_Image*, int, int, int, int, unsigned long)
00000000 T fl_imgtk::edgeenhance_ex(Fl_RGB_Image*, unsigned int, unsigned int)
00000000 T fl_imgtk::fliphorizontal(Fl_RGB_Image*)
00000000 T fl_imgtk::blurredimage_ex(Fl_RGB_Image*, float)
00000000 T fl_imgtk::createBMPmemory(char const*, unsigned int)
00000000 T fl_imgtk::flipvertical_ex(Fl_RGB_Image*)
00000000 T fl_imgtk::makegradation_h(unsigned int, unsigned int, unsigned long, unsigned long, bool)
00000000 T fl_imgtk::makegradation_v(unsigned int, unsigned int, unsigned long, unsigned long, bool)
00000000 T fl_imgtk::discard_kfconfig(fl_imgtk::kfconfig*&)
00000000 T fl_imgtk::draw_smooth_line(Fl_RGB_Image*, int, int, int, int, unsigned long)
00000000 T fl_imgtk::draw_widgetimage(Fl_Widget*)
00000000 T fl_imgtk::draw_2xaa_polygon(Fl_RGB_Image*, fl_imgtk::vecpoint const*, unsigned int, unsigned long)
00000000 T fl_imgtk::fliphorizontal_ex(Fl_RGB_Image*)
00000000 T fl_imgtk::draw_currentwindow(void*)
00000000 T fl_imgtk::draw_smooth_line_ex(Fl_RGB_Image*, int, int, int, int, float, unsigned long)
00000000 T fl_imgtk::discard_user_rgb_image(Fl_RGB_Image*&)
00000000 T fl_imgtk::drawblurred_widgetimage(Fl_Widget*, float)
00000000 T fl_imgtk::crop(Fl_RGB_Image*, unsigned int, unsigned int, unsigned int, unsigned int)
00000000 T fl_imgtk::gamma(Fl_RGB_Image*, double)
00000000 T fl_imgtk::merge(Fl_RGB_Image*, Fl_RGB_Image*, fl_imgtk::mergeconfig*)
00000000 T fl_imgtk::invert(Fl_RGB_Image*)
00000000 T fl_imgtk::rescale(Fl_RGB_Image*, unsigned int, unsigned int, fl_imgtk::rescaletype)
00000000 T fl_imgtk::contrast(Fl_RGB_Image*, double)
00000000 T fl_imgtk::filtered(Fl_RGB_Image*, fl_imgtk::kfconfig*)
00000000 T fl_imgtk::gamma_ex(Fl_RGB_Image*, double)
00000000 T fl_imgtk::rotate90(Fl_RGB_Image*)
00000000 T fl_imgtk::subtract(Fl_RGB_Image*, Fl_RGB_Image*, int, int, float)
00000000 T fl_imgtk::draw_line(Fl_RGB_Image*, int, int, int, int, unsigned long)
00000000 T fl_imgtk::draw_rect(Fl_RGB_Image*, int, int, int, int, unsigned long)
00000000 T fl_imgtk::invert_ex(Fl_RGB_Image*)
00000000 T fl_imgtk::rotate180(Fl_RGB_Image*)
00000000 T fl_imgtk::rotate270(Fl_RGB_Image*)
00000000 W BoxFilter::Filter(double)
00000000 W BoxFilter::~BoxFilter()
         U Fl_Widget::visible_r() const
00000000 W void std::__introsort_loop<__gnu_cxx::__normal_iterator<double*, std::vector<double, std::allocator<double> > >, long, __gnu_cxx::__ops::_Iter_comp_iter<bool (*)(int, int)> >(__gnu_cxx::__normal_iterator<double*, std::vector<double, std::allocator<double> > >, __gnu_cxx::__normal_iterator<double*, std::vector<double, std::allocator<double> > >, long, __gnu_cxx::__ops::_Iter_comp_iter<bool (*)(int, int)>)
         U std::__throw_length_error(char const*)
00000000 W void std::__move_median_to_first<__gnu_cxx::__normal_iterator<double*, std::vector<double, std::allocator<double> > >, __gnu_cxx::__ops::_Iter_comp_iter<bool (*)(int, int)> >(__gnu_cxx::__normal_iterator<double*, std::vector<double, std::allocator<double> > >, __gnu_cxx::__normal_iterator<double*, std::vector<double, std::allocator<double> > >, __gnu_cxx::__normal_iterator<double*, std::vector<double, std::allocator<double> > >, __gnu_cxx::__normal_iterator<double*, std::vector<double, std::allocator<double> > >, __gnu_cxx::__ops::_Iter_comp_iter<bool (*)(int, int)>)
00000000 W typeinfo for BSplineFilter
00000000 W typeinfo for BicubicFilter
00000000 W typeinfo for GenericFilter
00000000 W typeinfo for BilinearFilter
00000000 W typeinfo for Lanczos3Filter
00000000 W typeinfo for BoxFilter
00000000 W typeinfo name for BSplineFilter
00000000 W typeinfo name for BicubicFilter
00000000 W typeinfo name for GenericFilter
00000000 W typeinfo name for BilinearFilter
00000000 W typeinfo name for Lanczos3Filter
00000000 W typeinfo name for BoxFilter
00000000 W vtable for BSplineFilter
00000000 W vtable for BicubicFilter
00000000 W vtable for BilinearFilter
00000000 W vtable for Lanczos3Filter
00000000 W vtable for BoxFilter
         U vtable for __cxxabiv1::__class_type_info
         U vtable for __cxxabiv1::__si_class_type_info
         U operator delete[](void*)
         U operator delete(void*)
         U operator new[](unsigned long)
         U operator new(unsigned long)
         U __gxx_personality_v0
         U rand
         U strcmp

object file generation with this command resolve the issue , so it is problem with makefile
g++ ../src/*.cpp -I../inc -lfltk -lfltk_images -c

I found, by removing

OPTIMIZEOPT = -ffast-math -fopenmp -Os -s

fixes problem

Edit: For Makefile.llvm , No idea what is causing issue

Dear @Luciogi ,

I found, by removing

OPTIMIZEOPT = -ffast-math -fopenmp -Os -s

fixes problem

Edit: For Makefile.llvm , No idea what is causing issue

I will look for your case, by removing -Os and -s from makefile.
Thank you !

Dear @fire-eggs ,
Thank you Kevin !

#include "/home/oggy/projects/PicMe/fl_imgtk/lib/fl_imgtk.h"
#include <FL/Fl_PNG_Image.H>
int main(){
Fl_PNG_Image* img = new Fl_PNG_Image("/home/oggy/Pictures/Square_200x200.png");
fl_imgtk::rotate90(img);
}

Dear @Luciogi ,
as right usage is ...

#include <FL/Fl_PNG_Image.H>
#include "fl_imgtk.h"

int main(){
  Fl_PNG_Image* img = new Fl_PNG_Image("/home/oggy/Pictures/Square_200x200.png");
  fl_RGB_Image* imgRotated = fl_imgtk::rotate90(img);
  
  // do something ...
  
  delete imgRotated;
  
  // ...
}

I hope it could be helpful usage for you.

@rageworx specifically -fopenmp flag is causing problem

Edit: If I dont change

OPTIMIZEOPT = -ffast-math -fopenmp -Os -s

and compile test.cpp with -fopenmp works
running command : g++ test.cpp -lfltk -L../fl_imgtk/lib/ -lfl_imgtk -lfltk_images give this error whihc can be fixed by flag fopenmp

/usr/bin/ld: ../fl_imgtk/lib//libfl_imgtk.a(fl_imgtk.o): in function `fl_imgtk::makeanempty(unsigned int, unsigned int, unsigned int, unsigned long) [clone ._omp_fn.0]':
fl_imgtk.cpp:(.text+0x16): undefined reference to `omp_get_num_threads'
/usr/bin/ld: fl_imgtk.cpp:(.text+0x1e): undefined reference to `omp_get_thread_num'
/usr/bin/ld: ../fl_imgtk/lib//libfl_imgtk.a(fl_imgtk.o): in function `fl_imgtk::makeanempty(unsigned int, unsigned int, unsigned int, unsigned long) [clone ._omp_fn.1]':
fl_imgtk.cpp:(.text+0x88): undefined reference to `omp_get_num_threads'
/usr/bin/ld: fl_imgtk.cpp:(.text+0x90): undefined reference to `omp_get_thread_num'
/usr/bin/ld: ../fl_imgtk/lib//libfl_imgtk.a(fl_imgtk.o): in function `fl_imgtk::rotate90(Fl_RGB_Image*) [clone ._omp_fn.0]':
fl_imgtk.cpp:(.text+0x102): undefined reference to `omp_get_num_threads'
/usr/bin/ld: fl_imgtk.cpp:(.text+0x10a): undefined reference to `omp_get_thread_num'
/usr/bin/ld: ../fl_imgtk/lib//libfl_imgtk.a(fl_imgtk.o): in function `fl_imgtk::rotate270(Fl_RGB_Image*) [clone ._omp_fn.0]':
fl_imgtk.cpp:(.text+0x1b7): undefined reference to `omp_get_num_threads'
/usr/bin/ld: fl_imgtk.cpp:(.text+0x1bf): undefined reference to `omp_get_thread_num'
/usr/bin/ld: ../fl_imgtk/lib//libfl_imgtk.a(fl_imgtk.o): in function `fl_imgtk::rotatefree(Fl_RGB_Image*, float) [clone ._omp_fn.0]':
fl_imgtk.cpp:(.text+0x263): undefined reference to `omp_get_num_threads'
/usr/bin/ld: fl_imgtk.cpp:(.text+0x26a): undefined reference to `omp_get_thread_num'
/usr/bin/ld: ../fl_imgtk/lib//libfl_imgtk.a(fl_imgtk.o): in function `fl_imgtk_curve(Fl_RGB_Image*, unsigned char const*) [clone ._omp_fn.0]':
fl_imgtk.cpp:(.text+0x520): undefined reference to `omp_get_num_threads'
/usr/bin/ld: fl_imgtk.cpp:(.text+0x528): undefined reference to `omp_get_thread_num'
/usr/bin/ld: ../fl_imgtk/lib//libfl_imgtk.a(fl_imgtk.o): in function `fl_imgtk_curve_ex(Fl_RGB_Image*, unsigned char const*) [clone ._omp_fn.0]':
fl_imgtk.cpp:(.text+0x5b0): undefined reference to `omp_get_num_threads'
/usr/bin/ld: fl_imgtk.cpp:(.text+0x5b8): undefined reference to `omp_get_thread_num'
/usr/bin/ld: ../fl_imgtk/lib//libfl_imgtk.a(fl_imgtk.o): in function `fl_imgtk::invert(Fl_RGB_Image*) [clone ._omp_fn.0]':
fl_imgtk.cpp:(.text+0x647): undefined reference to `omp_get_num_threads'
/usr/bin/ld: fl_imgtk.cpp:(.text+0x64f): undefined reference to `omp_get_thread_num'
/usr/bin/ld: ../fl_imgtk/lib//libfl_imgtk.a(fl_imgtk.o): in function `fl_imgtk::invert_ex(Fl_RGB_Image*) [clone ._omp_fn.0]':
fl_imgtk.cpp:(.text+0x6f1): undefined reference to `omp_get_num_threads'
/usr/bin/ld: fl_imgtk.cpp:(.text+0x6f9): undefined reference to `omp_get_thread_num'
/usr/bin/ld: ../fl_imgtk/lib//libfl_imgtk.a(fl_imgtk.o): in function `fl_imgtk::filtered(Fl_RGB_Image*, fl_imgtk::kfconfig*) [clone ._omp_fn.0]':
fl_imgtk.cpp:(.text+0x797): undefined reference to `omp_get_num_threads'
/usr/bin/ld: fl_imgtk.cpp:(.text+0x79f): undefined reference to `omp_get_thread_num'
/usr/bin/ld: ../fl_imgtk/lib//libfl_imgtk.a(fl_imgtk.o): in function `fl_imgtk::filtered_ex(Fl_RGB_Image*, fl_imgtk::kfconfig*) [clone ._omp_fn.0]':
fl_imgtk.cpp:(.text+0xa31): undefined reference to `omp_get_num_threads'
/usr/bin/ld: fl_imgtk.cpp:(.text+0xa39): undefined reference to `omp_get_thread_num'
/usr/bin/ld: ../fl_imgtk/lib//libfl_imgtk.a(fl_imgtk.o): in function `fl_imgtk_gen_lowfreq(unsigned char**, unsigned char const*, unsigned int, unsigned int, unsigned int, unsigned int) [clone ._omp_fn.0]':
fl_imgtk.cpp:(.text+0xc93): undefined reference to `omp_get_num_threads'
/usr/bin/ld: fl_imgtk.cpp:(.text+0xc9b): undefined reference to `omp_get_thread_num'
/usr/bin/ld: ../fl_imgtk/lib//libfl_imgtk.a(fl_imgtk.o): in function `fl_imgtk::edgeenhance(Fl_RGB_Image*, unsigned int, unsigned int) [clone ._omp_fn.0]':
fl_imgtk.cpp:(.text+0xe59): undefined reference to `omp_get_num_threads'
/usr/bin/ld: fl_imgtk.cpp:(.text+0xe60): undefined reference to `omp_get_thread_num'
/usr/bin/ld: ../fl_imgtk/lib//libfl_imgtk.a(fl_imgtk.o): in function `fl_imgtk::edgeenhance_ex(Fl_RGB_Image*, unsigned int, unsigned int) [clone ._omp_fn.0]':
fl_imgtk.cpp:(.text+0xfd3): undefined reference to `omp_get_num_threads'
/usr/bin/ld: fl_imgtk.cpp:(.text+0xfdb): undefined reference to `omp_get_thread_num'
/usr/bin/ld: ../fl_imgtk/lib//libfl_imgtk.a(fl_imgtk.o): in function `fl_imgtk::crop(Fl_RGB_Image*, unsigned int, unsigned int, unsigned int, unsigned int) [clone ._omp_fn.0]':
fl_imgtk.cpp:(.text+0x10f6): undefined reference to `omp_get_num_threads'
/usr/bin/ld: fl_imgtk.cpp:(.text+0x10fe): undefined reference to `omp_get_thread_num'
/usr/bin/ld: ../fl_imgtk/lib//libfl_imgtk.a(fl_imgtk.o): in function `fl_imgtk_convertrgb(unsigned char*&, unsigned int, unsigned int, unsigned int, unsigned char*, unsigned int) [clone ._omp_fn.0]':
fl_imgtk.cpp:(.text+0x11ee): undefined reference to `omp_get_num_threads'
/usr/bin/ld: fl_imgtk.cpp:(.text+0x11f6): undefined reference to `omp_get_thread_num'
/usr/bin/ld: ../fl_imgtk/lib//libfl_imgtk.a(fl_imgtk.o): in function `fl_imgtk_convertrgb(unsigned char*&, unsigned int, unsigned int, unsigned int, unsigned char*, unsigned int) [clone ._omp_fn.1]':
fl_imgtk.cpp:(.text+0x12c9): undefined reference to `omp_get_num_threads'
/usr/bin/ld: fl_imgtk.cpp:(.text+0x12d1): undefined reference to `omp_get_thread_num'
/usr/bin/ld: ../fl_imgtk/lib//libfl_imgtk.a(fl_imgtk.o): in function `fl_imgtk_putimgonbuffer(unsigned char*, unsigned int, unsigned int, unsigned int, Fl_RGB_Image*, int, int, float) [clone ._omp_fn.0]':
fl_imgtk.cpp:(.text+0x13bb): undefined reference to `omp_get_num_threads'
/usr/bin/ld: fl_imgtk.cpp:(.text+0x13c3): undefined reference to `omp_get_thread_num'
/usr/bin/ld: ../fl_imgtk/lib//libfl_imgtk.a(fl_imgtk.o): in function `fl_imgtk_putimgonbuffer(unsigned char*, unsigned int, unsigned int, unsigned int, Fl_RGB_Image*, int, int, float) [clone ._omp_fn.1]':
fl_imgtk.cpp:(.text+0x16ec): undefined reference to `omp_get_num_threads'
/usr/bin/ld: fl_imgtk.cpp:(.text+0x16f4): undefined reference to `omp_get_thread_num'
/usr/bin/ld: ../fl_imgtk/lib//libfl_imgtk.a(fl_imgtk.o): in function `fl_imgtk_putimgonbuffer(unsigned char*, unsigned int, unsigned int, unsigned int, Fl_RGB_Image*, int, int, float) [clone ._omp_fn.2]':
fl_imgtk.cpp:(.text+0x177f): undefined reference to `omp_get_num_threads'
/usr/bin/ld: fl_imgtk.cpp:(.text+0x1787): undefined reference to `omp_get_thread_num'
/usr/bin/ld: ../fl_imgtk/lib//libfl_imgtk.a(fl_imgtk.o): in function `fl_imgtk_subimgonbuffer(unsigned char*, unsigned int, unsigned int, unsigned int, Fl_RGB_Image*, int, int, float) [clone ._omp_fn.0]':
fl_imgtk.cpp:(.text+0x182d): undefined reference to `omp_get_num_threads'
/usr/bin/ld: fl_imgtk.cpp:(.text+0x1835): undefined reference to `omp_get_thread_num'
/usr/bin/ld: ../fl_imgtk/lib//libfl_imgtk.a(fl_imgtk.o): in function `fl_imgtk_subimgonbuffer(unsigned char*, unsigned int, unsigned int, unsigned int, Fl_RGB_Image*, int, int, float) [clone ._omp_fn.1]':
fl_imgtk.cpp:(.text+0x19c4): undefined reference to `omp_get_num_threads'
/usr/bin/ld: fl_imgtk.cpp:(.text+0x19cc): undefined reference to `omp_get_thread_num'
/usr/bin/ld: ../fl_imgtk/lib//libfl_imgtk.a(fl_imgtk.o): in function `fl_imgtk_subimgonbuffer(unsigned char*, unsigned int, unsigned int, unsigned int, Fl_RGB_Image*, int, int, float) [clone ._omp_fn.2]':
fl_imgtk.cpp:(.text+0x1a57): undefined reference to `omp_get_num_threads'
/usr/bin/ld: fl_imgtk.cpp:(.text+0x1a5f): undefined reference to `omp_get_thread_num'
/usr/bin/ld: ../fl_imgtk/lib//libfl_imgtk.a(fl_imgtk.o): in function `fl_imgtk::makealphamap(unsigned char*&, Fl_RGB_Image*, float) [clone ._omp_fn.0]':
fl_imgtk.cpp:(.text+0x1af3): undefined reference to `omp_get_num_threads'
/usr/bin/ld: fl_imgtk.cpp:(.text+0x1afb): undefined reference to `omp_get_thread_num'
/usr/bin/ld: ../fl_imgtk/lib//libfl_imgtk.a(fl_imgtk.o): in function `fl_imgtk::makealphamap(unsigned char*&, Fl_RGB_Image*, float) [clone ._omp_fn.1]':
fl_imgtk.cpp:(.text+0x1b70): undefined reference to `omp_get_num_threads'
/usr/bin/ld: fl_imgtk.cpp:(.text+0x1b78): undefined reference to `omp_get_thread_num'
/usr/bin/ld: ../fl_imgtk/lib//libfl_imgtk.a(fl_imgtk.o): in function `fl_imgtk::applyalpha(Fl_RGB_Image*, float) [clone ._omp_fn.0]':
fl_imgtk.cpp:(.text+0x1c0f): undefined reference to `omp_get_num_threads'
/usr/bin/ld: fl_imgtk.cpp:(.text+0x1c16): undefined reference to `omp_get_thread_num'
/usr/bin/ld: ../fl_imgtk/lib//libfl_imgtk.a(fl_imgtk.o): in function `fl_imgtk::applyalpha(Fl_RGB_Image*, float) [clone ._omp_fn.1]':
fl_imgtk.cpp:(.text+0x1c90): undefined reference to `omp_get_num_threads'
/usr/bin/ld: fl_imgtk.cpp:(.text+0x1c97): undefined reference to `omp_get_thread_num'
/usr/bin/ld: ../fl_imgtk/lib//libfl_imgtk.a(fl_imgtk.o): in function `fl_imgtk::applyalpha(Fl_RGB_Image*, unsigned char*, unsigned int) [clone ._omp_fn.0]':
fl_imgtk.cpp:(.text+0x1d05): undefined reference to `omp_get_num_threads'
/usr/bin/ld: fl_imgtk.cpp:(.text+0x1d0c): undefined reference to `omp_get_thread_num'
/usr/bin/ld: ../fl_imgtk/lib//libfl_imgtk.a(fl_imgtk.o): in function `fl_imgtk::applyalpha(Fl_RGB_Image*, unsigned char*, unsigned int) [clone ._omp_fn.1]':
fl_imgtk.cpp:(.text+0x1d7a): undefined reference to `omp_get_num_threads'
/usr/bin/ld: fl_imgtk.cpp:(.text+0x1d81): undefined reference to `omp_get_thread_num'
/usr/bin/ld: ../fl_imgtk/lib//libfl_imgtk.a(fl_imgtk.o): in function `fl_imgtk::applyalpha_ex(Fl_RGB_Image*, float) [clone ._omp_fn.0]':
fl_imgtk.cpp:(.text+0x1ddf): undefined reference to `omp_get_num_threads'
/usr/bin/ld: fl_imgtk.cpp:(.text+0x1de6): undefined reference to `omp_get_thread_num'
/usr/bin/ld: ../fl_imgtk/lib//libfl_imgtk.a(fl_imgtk.o): in function `fl_imgtk::applyalpha_ex(Fl_RGB_Image*, float) [clone ._omp_fn.1]':
fl_imgtk.cpp:(.text+0x1e54): undefined reference to `omp_get_num_threads'
/usr/bin/ld: fl_imgtk.cpp:(.text+0x1e5b): undefined reference to `omp_get_thread_num'
/usr/bin/ld: ../fl_imgtk/lib//libfl_imgtk.a(fl_imgtk.o): in function `fl_imgtk::makegradation_h(unsigned int, unsigned int, unsigned long, unsigned long, bool) [clone ._omp_fn.0]':
fl_imgtk.cpp:(.text+0x1eea): undefined reference to `omp_get_num_threads'
/usr/bin/ld: fl_imgtk.cpp:(.text+0x1ef1): undefined reference to `omp_get_thread_num'
/usr/bin/ld: ../fl_imgtk/lib//libfl_imgtk.a(fl_imgtk.o): in function `fl_imgtk::makegradation_v(unsigned int, unsigned int, unsigned long, unsigned long, bool) [clone ._omp_fn.0]':
fl_imgtk.cpp:(.text+0x21dd): undefined reference to `omp_get_num_threads'
/usr/bin/ld: fl_imgtk.cpp:(.text+0x21e4): undefined reference to `omp_get_thread_num'
/usr/bin/ld: ../fl_imgtk/lib//libfl_imgtk.a(fl_imgtk.o): in function `fl_imgtk::fliphorizontal(Fl_RGB_Image*) [clone ._omp_fn.0]':
fl_imgtk.cpp:(.text+0x24e4): undefined reference to `omp_get_num_threads'
/usr/bin/ld: fl_imgtk.cpp:(.text+0x24eb): undefined reference to `omp_get_thread_num'
/usr/bin/ld: ../fl_imgtk/lib//libfl_imgtk.a(fl_imgtk.o): in function `fl_imgtk::fliphorizontal_ex(Fl_RGB_Image*) [clone ._omp_fn.0]':
fl_imgtk.cpp:(.text+0x25dc): undefined reference to `omp_get_num_threads'
/usr/bin/ld: fl_imgtk.cpp:(.text+0x25e3): undefined reference to `omp_get_thread_num'
/usr/bin/ld: ../fl_imgtk/lib//libfl_imgtk.a(fl_imgtk.o): in function `fl_imgtk::flipvertical(Fl_RGB_Image*) [clone ._omp_fn.0]':
fl_imgtk.cpp:(.text+0x26c7): undefined reference to `omp_get_num_threads'
/usr/bin/ld: fl_imgtk.cpp:(.text+0x26ce): undefined reference to `omp_get_thread_num'
/usr/bin/ld: ../fl_imgtk/lib//libfl_imgtk.a(fl_imgtk.o): in function `fl_imgtk::flipvertical_ex(Fl_RGB_Image*) [clone ._omp_fn.0]':
fl_imgtk.cpp:(.text+0x27e2): undefined reference to `omp_get_num_threads'
/usr/bin/ld: fl_imgtk.cpp:(.text+0x27e9): undefined reference to `omp_get_thread_num'
/usr/bin/ld: ../fl_imgtk/lib//libfl_imgtk.a(fl_imgtk.o): in function `fl_imgtk::rotate180(Fl_RGB_Image*) [clone ._omp_fn.0]':
fl_imgtk.cpp:(.text+0x28f7): undefined reference to `omp_get_num_threads'
/usr/bin/ld: fl_imgtk.cpp:(.text+0x28ff): undefined reference to `omp_get_thread_num'
/usr/bin/ld: ../fl_imgtk/lib//libfl_imgtk.a(fl_imgtk.o): in function `fl_imgtk::makeanempty(unsigned int, unsigned int, unsigned int, unsigned long)':
fl_imgtk.cpp:(.text+0x2ae4): undefined reference to `GOMP_parallel'
/usr/bin/ld: fl_imgtk.cpp:(.text+0x2b67): undefined reference to `GOMP_parallel'
/usr/bin/ld: ../fl_imgtk/lib//libfl_imgtk.a(fl_imgtk.o): in function `fl_imgtk::fliphorizontal(Fl_RGB_Image*)':
fl_imgtk.cpp:(.text+0x3520): undefined reference to `GOMP_parallel'
/usr/bin/ld: ../fl_imgtk/lib//libfl_imgtk.a(fl_imgtk.o): in function `fl_imgtk::fliphorizontal_ex(Fl_RGB_Image*)':
fl_imgtk.cpp:(.text+0x361e): undefined reference to `GOMP_parallel'
/usr/bin/ld: ../fl_imgtk/lib//libfl_imgtk.a(fl_imgtk.o): in function `fl_imgtk::flipvertical(Fl_RGB_Image*)':
fl_imgtk.cpp:(.text+0x36f6): undefined reference to `GOMP_parallel'
/usr/bin/ld: ../fl_imgtk/lib//libfl_imgtk.a(fl_imgtk.o):fl_imgtk.cpp:(.text+0x37ea): more undefined references to `GOMP_parallel' follow
/usr/bin/ld: ../fl_imgtk/lib//libfl_imgtk.a(fl_imgtk.o): in function `fl_imgtk::draw_smooth_line_ex(Fl_RGB_Image*, int, int, int, int, float, unsigned long) [clone ._omp_fn.0]':
fl_imgtk.cpp:(.text+0x64f6): undefined reference to `omp_get_num_threads'
/usr/bin/ld: fl_imgtk.cpp:(.text+0x64fe): undefined reference to `omp_get_thread_num'
/usr/bin/ld: ../fl_imgtk/lib//libfl_imgtk.a(fl_imgtk.o): in function `fl_imgtk::draw_smooth_line_ex(Fl_RGB_Image*, int, int, int, int, float, unsigned long)':
fl_imgtk.cpp:(.text+0x6c0a): undefined reference to `GOMP_parallel'
/usr/bin/ld: ../fl_imgtk/lib//libfl_imgtk.a(fl_imgtk.o): in function `fl_imgtk::draw_fillrect(Fl_RGB_Image*, int, int, int, int, unsigned long) [clone ._omp_fn.0]':
fl_imgtk.cpp:(.text+0x6c4d): undefined reference to `omp_get_num_threads'
/usr/bin/ld: fl_imgtk.cpp:(.text+0x6c55): undefined reference to `omp_get_thread_num'
/usr/bin/ld: ../fl_imgtk/lib//libfl_imgtk.a(fl_imgtk.o): in function `fl_imgtk::draw_fillrect(Fl_RGB_Image*, int, int, int, int, unsigned long)':
fl_imgtk.cpp:(.text+0x71f2): undefined reference to `GOMP_parallel'
/usr/bin/ld: ../fl_imgtk/lib//libfl_imgtk.a(fl_smimg.o): in function `WeightsTable::WeightsTable(GenericFilter*, unsigned int, unsigned int) [clone ._omp_fn.0]':
fl_smimg.cpp:(.text+0x21): undefined reference to `omp_get_num_threads'
/usr/bin/ld: fl_smimg.cpp:(.text+0x29): undefined reference to `omp_get_thread_num'
/usr/bin/ld: ../fl_imgtk/lib//libfl_imgtk.a(fl_smimg.o): in function `WeightsTable::WeightsTable(GenericFilter*, unsigned int, unsigned int)':
fl_smimg.cpp:(.text+0x39b): undefined reference to `GOMP_parallel'
/usr/bin/ld: ../fl_imgtk/lib//libfl_imgtk.a(fl_smimg.o): in function `ResizeEngine::horizontalFilter(unsigned char const*, unsigned int, unsigned int, unsigned int, unsigned int, unsigned int, unsigned char*, unsigned int) [clone ._omp_fn.0]':
fl_smimg.cpp:(.text+0x43d): undefined reference to `omp_get_num_threads'
/usr/bin/ld: fl_smimg.cpp:(.text+0x444): undefined reference to `omp_get_thread_num'
/usr/bin/ld: ../fl_imgtk/lib//libfl_imgtk.a(fl_smimg.o): in function `ResizeEngine::horizontalFilter(unsigned char const*, unsigned int, unsigned int, unsigned int, unsigned int, unsigned int, unsigned char*, unsigned int) [clone ._omp_fn.1]':
fl_smimg.cpp:(.text+0x5b2): undefined reference to `omp_get_num_threads'
/usr/bin/ld: fl_smimg.cpp:(.text+0x5ba): undefined reference to `omp_get_thread_num'
/usr/bin/ld: ../fl_imgtk/lib//libfl_imgtk.a(fl_smimg.o): in function `ResizeEngine::horizontalFilter(unsigned char const*, unsigned int, unsigned int, unsigned int, unsigned int, unsigned int, unsigned char*, unsigned int) [clone ._omp_fn.2]':
fl_smimg.cpp:(.text+0x749): undefined reference to `omp_get_num_threads'
/usr/bin/ld: fl_smimg.cpp:(.text+0x750): undefined reference to `omp_get_thread_num'
/usr/bin/ld: ../fl_imgtk/lib//libfl_imgtk.a(fl_smimg.o): in function `ResizeEngine::horizontalFilter(unsigned char const*, unsigned int, unsigned int, unsigned int, unsigned int, unsigned int, unsigned char*, unsigned int) [clone ._omp_fn.3]':
fl_smimg.cpp:(.text+0x963): undefined reference to `omp_get_num_threads'
/usr/bin/ld: fl_smimg.cpp:(.text+0x96a): undefined reference to `omp_get_thread_num'
/usr/bin/ld: ../fl_imgtk/lib//libfl_imgtk.a(fl_smimg.o): in function `ResizeEngine::verticalFilter(unsigned char const*, unsigned int, unsigned int, unsigned int, unsigned int, unsigned int, unsigned char*, unsigned int, unsigned int) [clone ._omp_fn.0]':
fl_smimg.cpp:(.text+0xbaa): undefined reference to `omp_get_num_threads'
/usr/bin/ld: fl_smimg.cpp:(.text+0xbb2): undefined reference to `omp_get_thread_num'
/usr/bin/ld: ../fl_imgtk/lib//libfl_imgtk.a(fl_smimg.o): in function `ResizeEngine::verticalFilter(unsigned char const*, unsigned int, unsigned int, unsigned int, unsigned int, unsigned int, unsigned char*, unsigned int, unsigned int) [clone ._omp_fn.1]':
fl_smimg.cpp:(.text+0xd4a): undefined reference to `omp_get_num_threads'
/usr/bin/ld: fl_smimg.cpp:(.text+0xd52): undefined reference to `omp_get_thread_num'
/usr/bin/ld: ../fl_imgtk/lib//libfl_imgtk.a(fl_smimg.o): in function `ResizeEngine::verticalFilter(unsigned char const*, unsigned int, unsigned int, unsigned int, unsigned int, unsigned int, unsigned char*, unsigned int, unsigned int) [clone ._omp_fn.2]':
fl_smimg.cpp:(.text+0xf1a): undefined reference to `omp_get_num_threads'
/usr/bin/ld: fl_smimg.cpp:(.text+0xf22): undefined reference to `omp_get_thread_num'
/usr/bin/ld: ../fl_imgtk/lib//libfl_imgtk.a(fl_smimg.o): in function `ResizeEngine::verticalFilter(unsigned char const*, unsigned int, unsigned int, unsigned int, unsigned int, unsigned int, unsigned char*, unsigned int, unsigned int) [clone ._omp_fn.3]':
fl_smimg.cpp:(.text+0x113a): undefined reference to `omp_get_num_threads'
/usr/bin/ld: fl_smimg.cpp:(.text+0x1142): undefined reference to `omp_get_thread_num'
/usr/bin/ld: ../fl_imgtk/lib//libfl_imgtk.a(fl_smimg.o): in function `ResizeEngine::horizontalFilter(unsigned char const*, unsigned int, unsigned int, unsigned int, unsigned int, unsigned int, unsigned char*, unsigned int)':
fl_smimg.cpp:(.text+0x1586): undefined reference to `GOMP_parallel'
/usr/bin/ld: ../fl_imgtk/lib//libfl_imgtk.a(fl_smimg.o): in function `ResizeEngine::verticalFilter(unsigned char const*, unsigned int, unsigned int, unsigned int, unsigned int, unsigned int, unsigned char*, unsigned int, unsigned int)':
fl_smimg.cpp:(.text+0x1770): undefined reference to `GOMP_parallel'
collect2: error: ld returned 1 exit status

while running g++ -lfltk -lfltk_images -L../fl_imgtk/lib -l fl_imgtk test.cpp give this error

/usr/bin/ld: /tmp/ccJ5HaaY.o: in function `main':
test.cpp:(.text+0x3e): undefined reference to `fl_imgtk::rotate90(Fl_RGB_Image*)'
collect2: error: ld returned 1 exit status

I am getting confused

g++ /path/to/cppfile ... -fopenmp works without any modifcation in makefile

Dear @Luciogi ,
Please refer to #22 (comment).
Looks same question, right ?

Dear @Luciogi ,
Is it also solved for you ?

Yup, solved