Skip to content

Linker won't find shared libraries no matter what i tell it. #112523

@magicmouse

Description

@magicmouse

The linker is not obeying the commands to find some shared libraries.

I am trying to compile a C project in MS Visual Studio Code on Centos 7. THe shared libraries are located in /usr/lib64. I can't seem to get the compiler to swallow my loader options in the cpp command line. No matter whether i specify the paths explicitly, or add the .so suffix, etc. , no matter what i do to my tasks.json file, i get loader errors saying "/usr/bin/ld: Cannot find -lllibpthread", etc.

Here is my tasks.json file:

{
    "tasks": [
        {
            "type": "cppbuild",
            "label": "C/C++: gcc build active file",
            "command": "/usr/bin/gcc",
            "args": [
                "-std=c99",
                "-g",
                "${fileDirname}/*.h",
                "${fileDirname}/*.c",
                "-o",
                "${fileDirname}/${fileBasenameNoExtension}",
                "-L/usr/lib64/",
                "-llibpthread",
                "-llibpcap"
            ],
            "options": {
                "cwd": "${workspaceFolder}"
            },
            "problemMatcher": [
                "$gcc"
            ],
            "group": {
                "kind": "build",
                "isDefault": true
            },
            "detail": "Task generated by Debugger."
        }
    ],
    "version": "2.0.0"
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions