Page 1 of 1

New Source Module Compiler Errors

Posted: 16 Oct 2014, 15:44
by mugs
Hi everyone, this is my first post to this forum, so please forgive any errors on my part...

I'm working with BCI2000v3, and I'm adding a new data input ("SignalSource") module for some new hardware we recently bought. (The hardware is a Trigno EMG system from Delsys.) I think I just about have everything in order for it to compile, but I'm getting one persistent error that is preventing it from compiling. Here is the error that I'm getting:
error LNK2019: unresolved external symbol _WinMain@16 referenced in function ___tmainCRTStartup MSVCRT.lib TrignoSource
I can't seem to figure out this one despite a lot of help on the forum for other "unresolved external" errors, but those posts seem to be dealing with Qt issues, and this seems like it might be a larger Windows issue with BCI2000.

Any help is great, thanks!

FYI if it helps: Qt version is 4.8.5

Re: New Source Module Compiler Errors

Posted: 27 Oct 2014, 16:47
by mugs
I actually figured out that this is a bug that results from using an old version of BCI2000. If you get this error, you need to add a .cpp file to your source module. Give it a name like SourceSignalClient.cpp. It should have the following code within:
/* $BEGIN_BCI2000_LICENSE$
*
* This file is part of BCI2000, a platform for real-time bio-signal research.
* [ Copyright (C) 2000-2011: BCI2000 team and many external contributors ]
*
* BCI2000 is free software: you can redistribute it and/or modify it under the
* terms of the GNU General Public License as published by the Free Software
* Foundation, either version 3 of the License, or (at your option) any later
* version.
*
* BCI2000 is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY
* - without even the implied warranty of MERCHANTABILITY or FITNESS FOR
* A PARTICULAR PURPOSE. See the GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along with
* this program. If not, see <http_nospam_www.gnu.org/licenses/>.
*
* $END_BCI2000_LICENSE$
*/

#pragma hdrstop

#include "CoreModuleQT.h"
#include <float.h>

#ifdef _WIN32

int WINAPI
WinMain( HINSTANCE, HINSTANCE, LPSTR, int )

{

bool success = CoreModuleQT().Run( __argc, __argv );
return success ? 0 : -1;
}

#else // _WIN32

int main( int argc, char *argv[] )
{
bool success = CoreModuleQT().Run( argc, argv );
return success ? 0 : -1;
}

#endif // _WIN32
Hope this helps!