Pelles C forum

C language => Beginner questions => Topic started by: panos on February 17, 2016, 08:43:16 PM

Title: How to install external libriaries?
Post by: panos 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.
Title: Re: How to install external libriaries?
Post by: TimoVJL 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")
...
Title: Re: How to install external libriaries?
Post by: panos 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.
Title: Re: How to install external libriaries?
Post by: TimoVJL on February 18, 2016, 06:56:42 PM
When you create library, it was  probably using __stdcall convention,
so chance it to __cdecl.
Title: Re: How to install external libriaries?
Post by: panos on February 18, 2016, 08:37:13 PM
thank you. That fixed it.  :)