External Libraries

Forum for software developers to discuss BCI2000 software development
Posts: 1
Joined: 06 Jan 2012, 08:09

External Libraries

Post by dmichler » 31 May 2012, 09:36

Hello! I am having a bit of trouble using external libraries into BCI2000.

I am using VS2010 and can successfully compile (so the library is included and linked correctly) but I am getting a runtime crash when one of the functions is actually used. I assume this must be due to my misunderstanding something about CMAKE. Is there a tutorial around for including external libraries, even if it is just specific to CMAKE, or some hint you can give me?

Many thanks

Posts: 1163
Joined: 12 Feb 2003, 11:06

Re: External Libraries

Post by mellinger » 04 Jun 2012, 11:57


when your code links successfully, I don't think there is anything wrong with your CMake setup. From what you write, it seems that you are linking against an import library (.lib file) coming with the library. Make sure that this .lib file matches the version of the actual library (.dll file), and that the header file coming with the library matches the version of both the dll and the lib file.

Problems may arise from inconsistent calling conventions (stdcall vs cdecl), but typically such inconsistencies lead to linker errors.

Also make sure that you read the documentation of the library. Often, it is required to call some initialization function from the library before calling any other function.



Who is online

Users browsing this forum: No registered users and 3 guests