FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

A lot of linker errors

 
Post new topic   Reply to topic     Forum Index -> General
View previous topic :: View next topic  
Author Message
beam



Joined: 23 Aug 2007
Posts: 4

PostPosted: Thu Aug 23, 2007 11:16 pm    Post subject: A lot of linker errors Reply with quote

This is just an example, but most of the time when I try to use a library, I get a few linker errors. This is what happens when I try to use the ini library from dprogramming.

This is the very simple code I'm using (which is from ini.d's unittest):

Code:

import ini;

int main()
{
   char[] inifile = "unittest.ini";
   Ini ini;

   ini = new Ini(inifile);
   
   return 0;
}


And here is the output:

Code:

> "C:\dmd\bin\dmd.exe" C:\dmd\packages\ini\examples\helloini.d ini.lib -I"C:\dmd\import"
C:\dmd\bin\..\..\dm\bin\link.exe helloini,,,ini.lib+user32+kernel32/noi;

OPTLINK (R) for Win32  Release 7.50B1
Copyright (C) Digital Mars 1989 - 2001  All Rights Reserved
   
helloini.obj(helloini)
 Error 42: Symbol Undefined _D3ini3Ini7__ClassZ
helloini.obj(helloini)
 Error 42: Symbol Undefined _D3ini3Ini5_ctorMFAaZC3ini3Ini


I'm taking extra care to make sure ini.lib is in the lib/ directory, and ini.d is in the import/ directory. It also happens when I try to use irclib and splat, but I'm taking care of one problem at a time, haha.

Edit:

Also, the linker generates the same errors whether or not I include ini.lib, that's strange.
Back to top
View user's profile Send private message
beam



Joined: 23 Aug 2007
Posts: 4

PostPosted: Fri Aug 24, 2007 12:46 pm    Post subject: Reply with quote

Alright, I fixed the problem. I recompiled ini.d with the -c switch, and ran lib on it myself to generate my own ini.lib, and it now works fine. For anyone who runs into a similar problem (or this same one), this is for you: http://tinydinosaur.com/files/dini.zip.

I just zipped up ini.d, the new ini.lib, and a readme outlining the process.
Back to top
View user's profile Send private message
aldacron



Joined: 05 May 2004
Posts: 1322
Location: Seoul, South Korea

PostPosted: Fri Aug 24, 2007 1:53 pm    Post subject: Reply with quote

Since it's just one module, why not just compile it in with the rest of your project? It seems rather excessive to compile a single module into a separate library.
_________________
The One With D | The One With Aldacron | D Bits
Back to top
View user's profile Send private message Send e-mail
beam



Joined: 23 Aug 2007
Posts: 4

PostPosted: Fri Aug 24, 2007 2:40 pm    Post subject: Reply with quote

I tried that, it had the same linker errors. I guess it was just the way dini was meant to be distributed, I'm not the creator of it so I don't know.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic     Forum Index -> General All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group