Skip to content

How to add .lib files in visual studio code with gcc compiler toolchain #774

Discussion options

You must be logged in to vote

Hi @meghnaembd.

The error message "undefined reference" is a linker error indicating that the function implementation, though declared, wasn't found during the linking phase.

To resolve the issue, you should ensure that:

  1. Your .lib file actually contains the missing definition. Not all .lib files will necessarily be compatible with the GCC toolchain, especially if they were built using a different tool like MSVC.
  2. The library is properly linked during the build.

From the provided tasks.json, here are some points to consider:

  1. Use Forward Slashes:

    Even on Windows, when specifying paths in GCC or G++, it's often better to use forward slashes (/) rather than backslashes (\).

  2. Library Paths…

Replies: 3 comments 1 reply

Comment options

You must be logged in to vote
0 replies
Answer selected by theReynald
Comment options

You must be logged in to vote
1 reply
@Karliz24
Comment options

Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
4 participants