Greetings to all.
First of all, in my ubuntu 18.04 system I installed libpcre3 and libpcre3-dev in order to obtain the non-standard C pcre library, however. After generating a Cmake file "source code is proven to work and is only one residing on the src folder on my project" I get the following error after executing my generated makefile.
Code:
[ 50%] Building C object CMakeFiles/main.dir/src/main.c.o
[100%] Linking C executable main
/usr/bin/ld: cannot find -lregexlist
/usr/bin/ld: cannot find -lregexlist.c
collect2: error: ld returned 1 exit status
CMakeFiles/main.dir/build.make:94: recipe for target 'main' failed
make[2]: *** [main] Error 1
CMakeFiles/Makefile2:67: recipe for target 'CMakeFiles/main.dir/all' failed
make[1]: *** [CMakeFiles/main.dir/all] Error 2
Makefile:83: recipe for target 'all' failed
make: *** [all] Error 2
diego@diego-Swift-SF113-31:~/Documents/desarrollo/regex/c/ejemplo-1/build$
The Cmake in question is the following
Code:
cmake_minimum_required(VERSION 2.8.9)
project(directory_test)
# Incluye los encabezados .h
#include_directories(include)
# Agrega fuentes
file(GLOB SOURCES "src/*.c")
# Crea el ejecutable
add_executable(main ${SOURCES})
# Agrega librería externa
target_link_libraries(main regexlist regexlist.c -lpcre)
# Agrega flags de compilación
target_compile_options(main PUBLIC -Wall)
Any help would be greatly appreciated.