NO

Author Topic: How to install external libriaries?  (Read 1813 times)

panos

  • Guest
How to install external libriaries?
« on: February 17, 2016, 08:43:16 pm »
Hi i am new to c and pelles c compiler. I am trying to install a library that comes with an online course. Cs50.h. I copied cs50.h to the include folder and also i compiled the cs50.c to cs50.lib. Then i copied the cs50.lib into the library directory on the pelles c installation. But the compiler still doesnt understand functions from cs50 library.

Offline TimoVJL

  • Global Moderator
  • Member
  • *****
  • Posts: 1899
Re: How to install external libriaries?
« Reply #1 on: February 18, 2016, 08:34:52 am »
You can include lib in IDE from menu Project -> Project options... -> Linker -> Library and object files
and project path Project -> Project options... -> Folders -> Libraries
if source code
Code: [Select]
...
#pragma comment(lib, "cb50.lib")
...
May the source be with you

panos

  • Guest
Re: How to install external libriaries?
« Reply #2 on: February 18, 2016, 06:06:55 pm »
I dont understand what i am doing wrong. I did what you wrote and still get this error POLINK: error: Unresolved external symbol '_GetInt'.

GetInt is a function from the library.

Offline TimoVJL

  • Global Moderator
  • Member
  • *****
  • Posts: 1899
Re: How to install external libriaries?
« Reply #3 on: February 18, 2016, 06:56:42 pm »
When you create library, it was  probably using __stdcall convention,
so chance it to __cdecl.
May the source be with you

panos

  • Guest
Re: How to install external libriaries?
« Reply #4 on: February 18, 2016, 08:37:13 pm »
thank you. That fixed it.  :)