News:

When registered with our forums, feel free to send a "here I am" post here to differ human beings from SPAM bots.

Main Menu

how to properly set up a library?

Started by blueeyedlion, April 23, 2011, 12:59:27 AM

Previous topic - Next topic

blueeyedlion

This is where I got it:

pdcurses.sourceforge.net

blueeyedlion

Is there anything at all that I could try?

Someone must have had this problem before.

ouch

I checked the precompiled library files, and it doesn't look like there are any for gcc or mingw. (all the dll's come .lib files, gcc/mingw dll's usually come with .a files)

If so you will have to build one yourself.

this file seems to be the source:

http://sourceforge.net/projects/pdcurses/files/pdcurses/3.4/pdcurs34.zip/download

But i would just download the trunk from the svn repository for the latest source code.

but the directions to build it are in the win32 folder called README.

if you have troubles with that go to their forums and post a message. Once done, replace the library you have now with the new one you just made.

Note: With this library I would probably statically link it instead of dynamically anyway.

blueeyedlion

After looking into this a bit, it seems horribly complicated.  Is there some easier way to get pdcurses working?  Maybe switching compilers or something?  If there isn't an easier way, perhaps there is a step by step guide out there that someone could point me to?

oBFusCATed

I think gcc/mingw can use .lib directly (probably try -lmylib.lib), if it can there is a way to convert .lib to .a.
Search the net for the details, because I don't remember how it has to be done (I've done it long time ago for the opengl libs).
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

ouch

You could just forget making a library, and just add the source and header files associated with the functions you want directly into your project.

just right click on your project and add files, or add files recursively if you want to add a bunch. then compile your project.

blueeyedlion

"(probably try -lmylib.lib)"

Try this how?

oBFusCATed

Read this: http://wiki.codeblocks.org/index.php?title=FAQ#Q:_How_do_I_troubleshoot_an_compiler_problem.3F (and enable the full log)

-lmylib.lib is added in two places:
1. linker settings -> link libraries (don't use -l)
2. linker settings -> other linker options (this is not recommended)
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

blueeyedlion

oh.  method 1 was described in one of the earlier posts.  I did it and it still wouldn't work.

blueeyedlion

Is there any different compiler that would make using pdcurses easier?

Also I would like to remind you that I am using windows 7.

stahta01

#25
MinGW GCC can link directly to C DLLs. I am guessing this is a C DLL based on the header file I downloaded.

Try using the "pdcurses.dll" as the library name.

Tim S.
C Programmer working to learn more about C++.
On Windows 10 64 bit and Windows 11 64 bit.
--
When in doubt, read the CB WiKi FAQ. [url="http://wiki.codeblocks.org"]http://wiki.codeblocks.org[/url]

stahta01

Quote from: blueeyedlion on April 26, 2011, 05:39:44 AM
Is there any different compiler that would make using pdcurses easier?

Also I would like to remind you that I am using windows 7.

The same one the pdcurses project used to compile the library for windows would be easier.

Tim S.
C Programmer working to learn more about C++.
On Windows 10 64 bit and Windows 11 64 bit.
--
When in doubt, read the CB WiKi FAQ. [url="http://wiki.codeblocks.org"]http://wiki.codeblocks.org[/url]