New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Windows (MSVC) Static Library #66

Closed
thejustinwalsh opened this Issue May 29, 2013 · 7 comments

Comments

Projects
None yet
3 participants
@thejustinwalsh

thejustinwalsh commented May 29, 2013

I am currently working on an Adobe Air Native Extension for EJDB and was wondering if there is an MSVC static library available for the windows port?

If not... Is there a project or any other way to build the windows API using MSVC, so that I may just build the source into my extension dll?

I already have the extension working on Mac and iOS. Windows is the last stop before the code makes it to github.

Any help in building with msvc would be appreciated.

@thejustinwalsh

This comment has been minimized.

thejustinwalsh commented May 30, 2013

Since my initial comment, I didn't realize the MSVC would simply consume the .a file for linking. So after defining EJDB_SATIC, I get a whole new mess of errors. Most likely from missing libraries, like zlib, pcre, mingw libstdc++, etc...

1>libtcejdb.a(bson.o) : error LNK2001: unresolved external symbol ___divdi3
1>libtcejdb.a(platform.o) : error LNK2001: unresolved external symbol ___divdi3
1>libtcejdb.a(bson.o) : error LNK2001: unresolved external symbol ___mingw_vfprintf
1>libtcejdb.a(tcutil.o) : error LNK2001: unresolved external symbol ___mingw_vfprintf
1>libtcejdb.a(tchdb.o) : error LNK2001: unresolved external symbol ___mingw_vfprintf
1>libtcejdb.a(bson.o) : error LNK2001: unresolved external symbol ___mingw_vsnprintf
1>libtcejdb.a(ejdb.o) : error LNK2001: unresolved external symbol ___mingw_vsnprintf
1>libtcejdb.a(tcbdb.o) : error LNK2001: unresolved external symbol ___mingw_vsprintf
1>libtcejdb.a(bson.o) : error LNK2001: unresolved external symbol ___mingw_vsprintf
1>libtcejdb.a(tcutil.o) : error LNK2001: unresolved external symbol ___mingw_vsprintf
1>libtcejdb.a(tctdb.o) : error LNK2001: unresolved external symbol ___mingw_vsprintf
1>libtcejdb.a(tchdb.o) : error LNK2001: unresolved external symbol ___mingw_vsprintf
1>libtcejdb.a(tcbdb.o) : error LNK2001: unresolved external symbol ___chkstk_ms
1>libtcejdb.a(myconf.o) : error LNK2001: unresolved external symbol ___chkstk_ms
1>libtcejdb.a(ejdb.o) : error LNK2001: unresolved external symbol ___chkstk_ms
1>libtcejdb.a(tcutil.o) : error LNK2001: unresolved external symbol ___chkstk_ms
1>libtcejdb.a(tctdb.o) : error LNK2001: unresolved external symbol ___chkstk_ms
1>libtcejdb.a(tchdb.o) : error LNK2001: unresolved external symbol ___chkstk_ms
1>libtcejdb.a(ejdb.o) : error LNK2001: unresolved external symbol _regexec
1>libtcejdb.a(tcutil.o) : error LNK2001: unresolved external symbol _regexec
1>libtcejdb.a(tctdb.o) : error LNK2001: unresolved external symbol _regexec
1>libtcejdb.a(ejdb.o) : error LNK2001: unresolved external symbol _regcomp
1>libtcejdb.a(tcutil.o) : error LNK2001: unresolved external symbol _regcomp
1>libtcejdb.a(tctdb.o) : error LNK2001: unresolved external symbol _regcomp
1>libtcejdb.a(tcbdb.o) : error LNK2001: unresolved external symbol _pthread_rwlock_destroy
1>libtcejdb.a(ejdb.o) : error LNK2001: unresolved external symbol _pthread_rwlock_destroy
1>libtcejdb.a(tcutil.o) : error LNK2001: unresolved external symbol _pthread_rwlock_destroy
1>libtcejdb.a(tctdb.o) : error LNK2001: unresolved external symbol _pthread_rwlock_destroy
1>libtcejdb.a(tchdb.o) : error LNK2001: unresolved external symbol _pthread_rwlock_destroy
1>libtcejdb.a(ejdb.o) : error LNK2001: unresolved external symbol _regfree
1>libtcejdb.a(tcutil.o) : error LNK2001: unresolved external symbol _regfree
1>libtcejdb.a(tctdb.o) : error LNK2001: unresolved external symbol _regfree
1>libtcejdb.a(tcbdb.o) : error LNK2001: unresolved external symbol _pthread_rwlock_init
1>libtcejdb.a(ejdb.o) : error LNK2001: unresolved external symbol _pthread_rwlock_init
1>libtcejdb.a(tcutil.o) : error LNK2001: unresolved external symbol _pthread_rwlock_init
1>libtcejdb.a(tctdb.o) : error LNK2001: unresolved external symbol _pthread_rwlock_init
1>libtcejdb.a(tchdb.o) : error LNK2001: unresolved external symbol _pthread_rwlock_init
1>libtcejdb.a(tcbdb.o) : error LNK2001: unresolved external symbol _pthread_rwlock_wrlock
1>libtcejdb.a(ejdb.o) : error LNK2001: unresolved external symbol _pthread_rwlock_wrlock
1>libtcejdb.a(tcutil.o) : error LNK2001: unresolved external symbol _pthread_rwlock_wrlock
1>libtcejdb.a(tctdb.o) : error LNK2001: unresolved external symbol _pthread_rwlock_wrlock
1>libtcejdb.a(tchdb.o) : error LNK2001: unresolved external symbol _pthread_rwlock_wrlock
1>libtcejdb.a(tcbdb.o) : error LNK2001: unresolved external symbol _pthread_rwlock_unlock
1>libtcejdb.a(ejdb.o) : error LNK2001: unresolved external symbol _pthread_rwlock_unlock
1>libtcejdb.a(tcutil.o) : error LNK2001: unresolved external symbol _pthread_rwlock_unlock
1>libtcejdb.a(tctdb.o) : error LNK2001: unresolved external symbol _pthread_rwlock_unlock
1>libtcejdb.a(tchdb.o) : error LNK2001: unresolved external symbol _pthread_rwlock_unlock
1>libtcejdb.a(tcbdb.o) : error LNK2001: unresolved external symbol _pthread_rwlock_rdlock
1>libtcejdb.a(ejdb.o) : error LNK2001: unresolved external symbol _pthread_rwlock_rdlock
1>libtcejdb.a(tcutil.o) : error LNK2001: unresolved external symbol _pthread_rwlock_rdlock
1>libtcejdb.a(tctdb.o) : error LNK2001: unresolved external symbol _pthread_rwlock_rdlock
1>libtcejdb.a(tchdb.o) : error LNK2001: unresolved external symbol _pthread_rwlock_rdlock
1>libtcejdb.a(tcutil.o) : error LNK2001: unresolved external symbol ___udivdi3
1>libtcejdb.a(tcutil.o) : error LNK2001: unresolved external symbol _pthread_mutex_lock
1>libtcejdb.a(tchdb.o) : error LNK2001: unresolved external symbol _pthread_mutex_lock
1>libtcejdb.a(tcbdb.o) : error LNK2001: unresolved external symbol _pthread_mutex_lock
1>libtcejdb.a(tcutil.o) : error LNK2001: unresolved external symbol _pthread_mutex_unlock
1>libtcejdb.a(tchdb.o) : error LNK2001: unresolved external symbol _pthread_mutex_unlock
1>libtcejdb.a(tcbdb.o) : error LNK2001: unresolved external symbol _pthread_mutex_unlock
1>libtcejdb.a(tcutil.o) : error LNK2001: unresolved external symbol _pthread_mutex_destroy
1>libtcejdb.a(tchdb.o) : error LNK2001: unresolved external symbol _pthread_mutex_destroy
1>libtcejdb.a(tcbdb.o) : error LNK2001: unresolved external symbol _pthread_mutex_destroy
1>libtcejdb.a(tcutil.o) : error LNK2001: unresolved external symbol _gettimeofday
1>libtcejdb.a(tcutil.o) : error LNK2001: unresolved external symbol _pthread_testcancel
1>libtcejdb.a(tcutil.o) : error LNK2001: unresolved external symbol _pthread_mutex_init
1>libtcejdb.a(tchdb.o) : error LNK2001: unresolved external symbol _pthread_mutex_init
1>libtcejdb.a(tcbdb.o) : error LNK2001: unresolved external symbol _pthread_mutex_init
1>libtcejdb.a(tcutil.o) : error LNK2001: unresolved external symbol _opendir
1>libtcejdb.a(tcutil.o) : error LNK2001: unresolved external symbol _readdir
1>libtcejdb.a(tcutil.o) : error LNK2001: unresolved external symbol _closedir
1>libtcejdb.a(tcutil.o) : error LNK2001: unresolved external symbol _pthread_once
1>libtcejdb.a(tctdb.o) : error LNK2001: unresolved external symbol ___moddi3
1>libtcejdb.a(tctdb.o) : error LNK2001: unresolved external symbol _usleep
1>libtcejdb.a(tchdb.o) : error LNK2001: unresolved external symbol _usleep
1>libtcejdb.a(tcbdb.o) : error LNK2001: unresolved external symbol _usleep
1>libtcejdb.a(tchdb.o) : error LNK2001: unresolved external symbol ___umoddi3
1>libtcejdb.a(tchdb.o) : error LNK2001: unresolved external symbol _pthread_getspecific
1>libtcejdb.a(tchdb.o) : error LNK2001: unresolved external symbol _pthread_setspecific
1>libtcejdb.a(tchdb.o) : error LNK2001: unresolved external symbol _pthread_mutexattr_init
1>libtcejdb.a(tchdb.o) : error LNK2001: unresolved external symbol _pthread_mutexattr_settype
1>libtcejdb.a(tchdb.o) : error LNK2001: unresolved external symbol _pthread_mutexattr_destroy
1>libtcejdb.a(tchdb.o) : error LNK2001: unresolved external symbol _pthread_key_create
1>libtcejdb.a(tchdb.o) : error LNK2001: unresolved external symbol _pthread_key_delete
1>libtcejdb.a(myconf.o) : error LNK2001: unresolved external symbol _crc32
1>libtcejdb.a(myconf.o) : error LNK2001: unresolved external symbol _inflateInit2_
1>libtcejdb.a(myconf.o) : error LNK2001: unresolved external symbol _inflate
1>libtcejdb.a(myconf.o) : error LNK2001: unresolved external symbol _inflateEnd
1>libtcejdb.a(myconf.o) : error LNK2001: unresolved external symbol _deflateInit2_
1>libtcejdb.a(myconf.o) : error LNK2001: unresolved external symbol _deflate
1>libtcejdb.a(myconf.o) : error LNK2001: unresolved external symbol _deflateEnd
@thejustinwalsh

This comment has been minimized.

thejustinwalsh commented May 30, 2013

And after including...

libtcejdb.a
libgcc.a
libmingw32.a
libmingwex.a
libpthread.a
libregex.a
libz.a

From mingw, I'm now missing all the bson and tokyo cabinet symbols... I'm not going to paste them as they are out of control.

So i'm back to square one. How do I embed EJDB statically into an MSVC built project?

@adamansky

This comment has been minimized.

Member

adamansky commented May 30, 2013

Hi Justin! I'm going to investigate this problem in next holidays. At the present time gcc is the only compiler to build ejdb due to usage of c99 and gcc specific extensions (_atomics builtins for example). Anyway EJDB DLLs should link with msvc without problems.

@thejustinwalsh

This comment has been minimized.

thejustinwalsh commented May 30, 2013

If there is anything I can do to help let me know. I've successfully linked the dll and run my MSVC application.

The issue for me lies in packaging an adobe air native extension. The extension has a hard time finding the DLL. I can get it to work so long as I ensure the DLL is in my path or working directory of the application, but that isn't nearly as elegant as statically linking the code and not requiring a DLL to be installed via an external installer.

EJDB on windows is awesome either way! Thanks for all the hard work!

adamansky added a commit that referenced this issue Jun 1, 2013

adamansky added a commit that referenced this issue Jun 1, 2013

adamansky added a commit that referenced this issue Jun 1, 2013

@adamansky

This comment has been minimized.

Member

adamansky commented Jun 1, 2013

Please checkout ejdb v1.1.11 (https://github.com/Softmotions/ejdb/blob/master/tcejdb/WIN32.md) windows package it includes sample with static linking.

@adamansky adamansky closed this Jun 1, 2013

adamansky added a commit that referenced this issue Jun 1, 2013

@thejustinwalsh

This comment has been minimized.

thejustinwalsh commented Jun 3, 2013

Works like a charm! Thanks for the quick turnaround on this one!

@knell

This comment has been minimized.

knell commented Feb 19, 2016

Hi.
There is same question from 2016. I would like to use ejdb Win32 build statically linked and have build it on my Linux machine but still have the same link errors as topic starter. The link (https://github.com/Softmotions/ejdb/blob/master/tcejdb/WIN32.md) is not accessible anymore, could you please provide any working solution for win32 static usage? I'm using VS2015 and have defined EJDB_STATIC before including ejdb.h.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment