Code::Blocks Forums

User forums => Help => Topic started by: Eli_A on June 26, 2022, 04:51:06 pm

Title: ld.exe cannot find .lib
Post by: Eli_A on June 26, 2022, 04:51:06 pm
Hi all,

I get an error: "ld.exe cannot find -lPcap++" while running my program. I did the following modifications but the problem not resolved.

1) library files are in the correct directory C:/Eli/Projects/dRDI/test (See part of the Makefile below)

     PCAPPLUSPLUS_HOME := C:/Eli/Projects/dRDI/test
     # libs dir
     PCAPPP_LIBS_DIR := -L$(PCAPPLUSPLUS_HOME)

     # libs
      PCAPPP_LIBS = -lPcap++ -lPacket++ -lCommon++
   
2) I have added its path to the linker:

    Setting > Compiler > Linker settings

3) I also changed the compiler for staticlib from "ar.exe" to "g++.exe" in Setting > Compiler >Toolchain executables>Linker for static libs: g++.exe

4) I checked the environment path to see if just one compiler is added

    Environment variables > Path > edit > add "C:\Program Files\CodeBlocks\MinGW\bin"

But I still get an error. I greatly appreciate if someone could help me solve my problem.


Title: Re: ld.exe cannot find .lib
Post by: skoroglyadov on November 22, 2022, 01:26:59 pm
Good afternoon, did you manage to find a solution?