24 May '13 - 20:47 *
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
 
   Home   Help Search Login Register  
Pages: [1]
  Reply  |  Print  
Author Topic: [OT] LIB woes  (Read 2249 times)
Olego
Posts: 557


« on: 6 Aug '03 - 23:26 »
Reply with quoteQuote

Hello everyone,

My question doesn't have direct relevance to BASS other than the fact that I am making a LIB file in C/C++, and it involves threading.

I figured out the basic threading and the necessity to switch to /MT option for the linker (I use Visual Studio).  I also figured out that the project that uses my library needs to be /MT, otherwise it has runtime errors involving threads etc.

But then I realised that I need a C++ project for my C++ library.  Once I converted my library to C, C users could run it but C++ users couldn't.

Does anyone know more info on how to write libraries accessible using both C and C++, and how I should deal with threading (other than by making every .exe use the /MT switch)?  Please help!
~Olego~
Logged
Olego
Posts: 557


« Reply #1 on: 7 Aug '03 - 22:58 »
Reply with quoteQuote

Aha!  I knew there was something more to
extern "C" { ... }
than there seemed.  Perhaps that'll aid me in my struggles!~Olego~
Logged
Olego
Posts: 557


« Reply #2 on: 8 Aug '03 - 00:00 »
Reply with quoteQuote

So...  That is that is meant by
#ifdef __cplusplus
extern "C" {
#endif
!  Well, that seemed to have fixed my problems.  Furthermore,
_declspec (dllexport)
seemed to have created a successful DLL with a LIB. Is that how you made your LIB file, Ian?~Olego~
Logged
Pages: [1]
  Reply  |  Print  
 
Jump to:  

Powered by SMF 1.1.18 | SMF © 2013, Simple Machines