He creado una aplicación simple que funciona bien. Sin embargo, ahora necesito vincularme con algunas bibliotecas en el siguiente directorio.vinculando bibliotecas de terceros
/opt/norton/lib
En mi archivo make Tengo el siguiente con las obras, pero tengo que usar cmake
LIBS_PATH = -L/opt/norton/lib
INC_PATH = -I/opt/norton/inc
LIBS = -lntctrl
En mi CMakeList.txt tengo esto, pero no funciona sigo gettng el siguiente error :
undefined reference to `nt_init'
Esta es mi CMakeList.txt
# Includes files
INCLUDE_DIRECTORIES(/opt/norton/inc)
# Link libraries
LINK_DIRECTORIES(/opt/norton/lib)
# Add the library that is used by nt_init
TARGET_LINK_LIBRARIES(-lntctrl)
ADD_LIBRARY(application initialize_nw)
Muchas gracias por cualquier consejo,
Hola, gracias por la respuesta. Sí, ya lo he intentado (ntctrl). En mi initilaize_nw.c, he incluido el encabezado ntctrllib.h, por lo que incluye el archivo de encabezado, ya que no muestra ningún error que no lo haya encontrado. ¿Estoy seguro de que TARGET_LINK_LIBRARIES es correcto de usar? Muchas gracias. – ant2009
Hola, sigo teniendo un problema cuando especifico la biblioteca ntctrl en TARGET_LINK_LIBRARIES (ntctrl). La biblioteca está en el directorio/opt/norton/lib. ¿Cómo sabe TARGET_LINK ... que necesita buscar en el directorio opt/norton/lib? Gracias. – ant2009
LINK_DIRECTORIES está bien, tal vez ponga la línea ADD_LIBRARY antes de TARGET_LINK_LIBRARIES, o incluso use ADD_EXECUTABLE en su lugar (me parece por el nombre que la aplicación no es una lib) – jdehaan