How can i import LIBS
-
HI,
I am using SDK's library (#include "libsoc_gpio.h")
And I also added theese to the .pro file;
QMAKE_CXXFLAGS += -lpthread
LIBS +=-lpthreadLIBS += -llibsoc_gpio
But when i compile the code it's gives theese errors;
1-) :-1: error: collect2: error: ld returned 1 exit status
2-) :-1: error: [Makefile:653: LCD-SubMenus] Error 1NOTE: library path: /opt/tdx-xwayland/5.6.0/sysroots/armv7at2hf-neon-tdx-linux-gnueabi/usr/include
How can i use this?
Best regards.
-
@Yaldiz AFAIK, for Linux system, you should remove "lib" for the library name.
You can specify library path with-L
To summarize the correct way should be:
LIBS += -L/opt/tdx-xwayland/5.6.0/sysroots/armv7at2hf-neon-tdx-linux-gnueabi/usr/include -lsoc_gpio
-
I tried for sqlite like below and it's works fine;
LIBS += -L/opt/tdx-xwayland/5.6.0/sysroots/armv7at2hf-neon-tdx-linux-gnueabi/usr/include -lsqlite3
but when i try for libsoc_gpio it's gives same error.
I think there is another problem. What could be this problem? -
@Yaldiz said in How can i import LIBS:
/opt/tdx-xwayland/5.6.0/sysroots/armv7at2hf-neon-tdx-linux-gnueabi/usr/include
Are you really sure
/opt/tdx-xwayland/5.6.0/sysroots/armv7at2hf-neon-tdx-linux-gnueabi/usr/include
contains the library file libsoc_gpio.so? -
@Yaldiz said in How can i import LIBS:
Yes, exist libsoc_gpio.h
This is the header file not the library which you want to link with.
The library will have .so (for dynamic library) or .a (for static library) as extension.try this to find its location:
find opt/tdx-xwayland/5.6.0/sysroots/armv7at2hf-neon-tdx-linux-gnueabi/ -name libsoc_gpio.*
-
-
@Yaldiz said in How can i import LIBS:
No .so or .a file.
Did you try the search it with:
find /opt/tdx-xwayland/5.6.0/sysroots/armv7at2hf-neon-tdx-linux-gnueabi/ -name libsoc_gpio.*
or
find /opt/tdx-xwayland/5.6.0/sysroots/ -name libsoc_gpio.*