0

I am trying to use scip package to solve vrp example but when i want to use ctrl+shift+B to build task, i encountered with this error
/tmp/ccu9Xcmg.o: In function execmain(int, char**): /home/fahime/Desktop/VRP/src/main_vrp.cpp:294: undefined reference to SCIPcreate ... collect2: error: ld returned 1 exit status The terminal process terminated with exit code: -1.

it is my include path in c_cpp_properties:

 "${workspaceFolder}/**",
            "/usr/local/"

and its task.json

"version": "2.0.0",
"tasks": [
    {
        "type": "cppbuild",
        "label": "C/C++: g++ build active file",
        "command": "/usr/bin/g++",
        "args": [
            "-g",
            "${workspaceFolder}\\/src\\/**.cpp",
            "-o",
            "${fileDirname}/${fileBasenameNoExtension}"
        ],
        "options": {
            "cwd": "/usr/bin"
        },
        "problemMatcher": [
            "$gcc"
        ],
        "group": {
            "kind": "build",
            "isDefault": true
        },
        "detail": "compiler: /usr/bin/g++"
    }
]

would you guide me please

user4581301
  • 33,082
  • 7
  • 33
  • 54
  • There are two separate things to deal with here. You've (apparently) added the correct path to your c_cpp_include. That tells the compiler where to find headers. You also need to tell the linker about the library that contains `SCIPCreate`, and (most likely) where that's located. This is a separate setting from the include path. The include path tells the *compiler* where to find the header, the other tells the linker where to find the library. – Jerry Coffin Nov 25 '20 at 07:01
  • For a rundown on the subject in general: https://stackoverflow.com/questions/12573816/what-is-an-undefined-reference-unresolved-external-symbol-error-and-how-do-i-fix?rq=1 – Jerry Coffin Nov 25 '20 at 07:03

0 Answers0