LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 03-21-2009, 01:23 PM   #1
basbosa87
LQ Newbie
 
Registered: Feb 2009
Posts: 3

Rep: Reputation: 0
add dll file to eclipse c++


Hello,

I'm working with eclipse c++ under Kubuntu.

I want to know how to import dll file using eclipse c++.

Last edited by basbosa87; 03-21-2009 at 01:25 PM.
 
Old 03-21-2009, 01:56 PM   #2
paulsm4
LQ Guru
 
Registered: Mar 2004
Distribution: SusE 8.2
Posts: 5,863
Blog Entries: 1

Rep: Reputation: Disabled
Hi -

You add libraries (static "lib*.a" or shared "lib*.so" libraries) in your Eclipse/CDT project settings.

You're aware, of course, that a ".dll" is a Windows specific shared library: you can't use a Windows .dll under Linux any more than you can use a Linux .so under Windows.

Here's a great "howto":
http://whatwouldnickdo.com/wordpress...nux-libraries/

'Hope that helps .. PSM
 
Old 03-21-2009, 02:10 PM   #3
basbosa87
LQ Newbie
 
Registered: Feb 2009
Posts: 3

Original Poster
Rep: Reputation: 0
first,I want to thank you for your reply.

second, i want to ask you that if i convert the
dll file to lib using this:
http://www.binary-soft.com/dll2lib/dll2lib.htm

will it work under linux, if so is what code i have to write to
link to this lib and using its functions.
 
Old 03-21-2009, 02:52 PM   #4
TITiAN
Member
 
Registered: Mar 2008
Location: NRW, Germany
Distribution: Arch Linux, using KDE/Plasma
Posts: 392

Rep: Reputation: 49
O_O 999$ ... that's a lot. I think the chances are not really good for it to work, since Windows and Linux use different APIs. For example, Windows has an own API for making GUIs (and other windows), while Linux uses GTK+,QT4 etc.

If your dll files don't use any API (say, they can only calculate and say "Hello World"), it is possible that a procedure like this might work; I really don't suggest buying a $999 software program, though.

Another idea: You could try to cross-compile Windows applications using said dll files. You'd need wine to run it, though. I'm not really familiar with cross-compiling, but I think it can't be too hard if you have the development files for your dll.
 
Old 03-21-2009, 04:39 PM   #5
paulsm4
LQ Guru
 
Registered: Mar 2004
Distribution: SusE 8.2
Posts: 5,863
Blog Entries: 1

Rep: Reputation: Disabled
Hi -

1. TITiAN is correct on all counts.

2. "DLL to Lib" *won't* work - and it *can't* work - for your purposes.

Here's why:
a) As you probably know, "program libraries" generally come in two flavors: "shared libraries" and "static libraries".

b) With a "static library", everything the .exe program needs is copied into the executable when it's created (at "link time"). With a "shared library", the .exe merely has a bunch of "external references" to things it needs from the shared library. Using shared libraries makes for smaller .exe's, faster load times, and greater flexibility. The tradeoff is you need to make sure the library is available when the .exe needs it, and you also need to make sure you've got the *right* .dll with the *right* versions of external references. Hence the term ".dll Hell".

c) Libraries - and the code they contain - are by definition *different* for every platform. You can't (directly) run Windows code on Linux, or vice versa.

d) The whole purpose of the "Dll to Lib" product is to convert Windows .dll's (shared libraries) to Windows static libraries (it looks like it generates both Windows .lib and .tlb files). For the convenience of having a Windows static .lib (if you want one, and you don't have the luxury of building one from the original source code, I guess).

e) Congratulations. You just saved $1000 ;-)

3. So basically, whatever you want to use the .dll files for - you need to find different libraries - with the same functionality - for your platform.

Sorry .. PSM
 
Old 03-21-2009, 04:45 PM   #6
basbosa87
LQ Newbie
 
Registered: Feb 2009
Posts: 3

Original Poster
Rep: Reputation: 0
yes, you are right.

it was MSXML library for parsing xml, i have work with it
under windows very effectively, and I found that I have to
switch to Linux environment, so I will look for another library
to work with it under linux.
 
Old 03-21-2009, 05:50 PM   #7
paulsm4
LQ Guru
 
Registered: Mar 2004
Distribution: SusE 8.2
Posts: 5,863
Blog Entries: 1

Rep: Reputation: Disabled
Hi -

Here are a couple of options you might wish to consider:

http://expat.sourceforge.net/
http://xerces.apache.org/xerces-c/download.cgi
http://www.grinninglizard.com/tinyxml/

http://discuss.joelonsoftware.com/de...el.3.597252.22

Or perhaps you're interested in something higher-level (for example, maybe you're doing "SOAP", or "Web Services"), and you really don't need to mess with the XML directly.

There are lots of alternatives - and please feel free to open a new thread as questions arise!

Your .. PSM
 
  


Reply

Tags
linux, programming


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Hot to set Eclipse to link to dll files ? barbuceanu Linux - Software 0 05-12-2008 05:49 PM
hi i just want to know where to put the .dll file Paxmaster Linux - Software 1 10-20-2004 04:54 PM
Error: "A required .DLL file, CYGPCRE -0.DLL, was not found" when using man dipperdan Linux - Newbie 2 04-28-2004 03:55 PM
How can I add my Eclipse icon to the Panel chinaundead Red Hat 0 04-02-2004 01:56 PM
add dll to wine alaios Linux - General 1 03-22-2004 03:46 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 01:54 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration