Ayende @ Rahien

Hi!
My name is Oren Eini
Founder of Hibernating Rhinos LTD and RavenDB.
You can reach me by phone or email:

ayende@ayende.com

+972 52-548-6969

, @ Q c

Posts: 18 | Comments: 66

filter by tags archive

Comments

tobi

I never understood why the header-based link system is needed. .NET and Java don't need them either, and they work much better.

Ayende Rahien

tobi, They are needed because this way, you could write a single pass compiler. It meant very little memory was needed to actually do the compilation

eti
eti

Maybe the pre-processor conditionaly stripps the definition away?

Ayende Rahien

Eti, Nope, I made sure of that.

zdeslav

Does dumpbin show the correct symbol in corresponding obj file?

Ayende Rahien

D:\Work\lightningdb-win\liblmdb\Release [master +10 ~5 -0 !]> &"C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\b in\amd64\dumpbin.exe" /EXPORTS .\mdb.obj Microsoft (R) COFF/PE Dumper Version 11.00.50727.1 Copyright (C) Microsoft Corporation. All rights reserved.

Dump of file .\mdb.obj

File Type: ANONYMOUS OBJECT D:\Work\lightningdb-win\liblmdb\Release [master +10 ~5 -0 !]>

zdeslav

are you building with /GL option? also, try /SYMBOLS instead of /EXPORTS.

Ayende Rahien

zdeslav, I am looking at you now with glazed eyes. No idea what you are talking about.

zdeslav

sorry for succinctness, I was typing with child in my arms :)

i see that you call 'dumpbin /exports' but 'dumpbin /symbols' will list all the symbols, so you can check whether there is anything similar to mdbenvset_flags, or is it missing completely.

I ask about /GL flag, as it prevents using these flags.

Ayende Rahien

I removed /GL flag, and then used /symbols. The object has mdbenvsetflags in it.

zdeslav

hmm, markdown is messing up the formatting and stripping underscores. I understand that the symbol name in the obj file starts with the underscore, like _mdb_env_set_flags, without any additions (like @12)? In that case it all seems fine. it's a long shot, but are you sure that set_mapsize is linked from the same obj file and not some other?

Keith

those (env, ....)

I'm guessing they should be (&env, ....)

Ayende Rahien

Keith, No, that is already a pointer.

Keith

what do the 3 warnings say?

Alois Kraus

Maybe you have duplicate header files with different content? Check from where the header file is loaded for all projects. Could it be that set_flags does contain as input types ifdefed types which do change the actual signature? That would make it possible to compile it but fail at link time because the library was compiled with a differen set of ifdefs.

Kelly Sommers

Not enough details in this post to even suggest what the real problem is since I can't see what the project includes.

You need to have midl.h and midl.c in the project. Are they included?

Ayende Rahien

Kelly, That was mostly to vent. I work around that since I just needed to test something out. FWIW, this was in the lmdb-win project.

Jono

The missing symbol is prefixed with a "_" unlike your usage?

Rodrigo Zechin

The fact that both functions are defined in the same header doesn't mean they are implemented in the same library.

You need to find out on which *.lib file this function is implemented and reference it during the linking phase. The easiest (but ugliest) way of doing this is with a #pragma comment(lib, “xxx.lib”) on your *.c file

The "right" way would be to add the lib to your "Additional Dependencies" list on the project properties

Comment preview

Comments have been closed on this topic.

FUTURE POSTS

  1. RavenDB 3.0 New Stable Release - 5 hours from now
  2. Production postmortem: The case of the lying configuration file - about one day from now
  3. Production postmortem: The industry at large - 2 days from now
  4. The insidious cost of allocations - 3 days from now
  5. Buffer allocation strategies: A possible solution - 6 days from now

And 4 more posts are pending...

There are posts all the way to Sep 11, 2015

RECENT SERIES

  1. Find the bug (5):
    20 Apr 2011 - Why do I get a Null Reference Exception?
  2. Production postmortem (10):
    31 Aug 2015 - The case of the memory eater and high load
  3. What is new in RavenDB 3.5 (7):
    12 Aug 2015 - Monitoring support
  4. Career planning (6):
    24 Jul 2015 - The immortal choices aren't
View all series

Syndication

Main feed Feed Stats
Comments feed   Comments Feed Stats