pluginconfig lib missing in win32 VC9?

Questions or HOWTOs about the above? Post 'em here...
Post Reply
SkindupTruk
Private First Class
Private First Class
Posts: 19
Joined: Fri Apr 11, 2008 10:17 pm

pluginconfig lib missing in win32 VC9?

Post by SkindupTruk »

hi all,

i'm trying to compile the simplestats plugin http://my.bzflag.org/bb/viewtopic.php?f ... gh#p117532

i get quite close but there is a linking error. i'm using VC9 express on windows7 and can compile the bzsource ok, with all the various libs and directx etc. i can also compile the default plugins, however they do not make use of the pluginconfig class which is the problem i think.

i tried dropping in an #include "pluginconfig.h" but that said class redefinition error and casting errors from char * to type "PluginConfig" etc which I think is on the wrong track.

by commenting out the code that makes use of the PluginConfig class it will compile. i could hard wire in a work around but i'm curious about what i need to link.

i'm able to compile the plugin_utils dir and i notice that in the debug folder there is only plugin_utils.lib and NO pluginconfig.lib. so even tho i have VC9 with the right library path of C:\Users\SkindupTruk\Downloads\bzflag-2.0.12\bzflag-2.0.12\plugins\plugin_utils\VC71\Debug, there is no pluginconfig.lib file, is that the problem?

Code: Select all

BZF_PLUGIN_CALL int bz_Load ( const char* rawArgs )
{
  bz_registerEvent( bz_ePlayerDieEvent, &handler );
  bz_registerEvent( bz_eTickEvent, &handler );

  bz_registerCustomSlashCommand( "highscore", &handler );
  bz_registerCustomSlashCommand( "lowscore", &handler );
  bz_registerCustomSlashCommand( "resetscore", &handler );

  if( bz_getMaxWaitTime() > 60.0f )
    bz_setMaxWaitTime( 60.0f );

// if i chop this it works

  if( rawArgs && std::string( rawArgs ) != "" ) {
    PluginConfig config = PluginConfig( rawArgs );
    if( config.errors ) return -1;
    handler.filename = config.item( "SimpleStats", "StatFile" );

    handler.lastSave = bz_getMaxWaitTime();

    // Load the scores
    if( handler.filename != "" )
        handler.loadScores();
  }

//end chop

  bz_debugMessage(4,"SimpleStats plugin loaded");
  return 0;
}

Code: Select all

1>------ Build started: Project: SAMPLE_PLUGIN, Configuration: Debug Win32 ------
1>Compiling...
1>cl : Command line warning D9035 : option 'Wp64' has been deprecated and will be removed in a future release
1>SAMPLE_PLUGIN.cpp
1>c:\users\skinduptruk\downloads\bzflag-2.0.12\bzflag-2.0.12\plugins\sample_plugin\sample_plugin.cpp(262) : warning C4996: 'sprintf': This function or variable may be unsafe. Consider using sprintf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
1>        c:\program files\microsoft visual studio 9.0\vc\include\stdio.h(366) : see declaration of 'sprintf'
1>c:\users\skinduptruk\downloads\bzflag-2.0.12\bzflag-2.0.12\plugins\sample_plugin\sample_plugin.cpp(280) : warning C4996: 'sprintf': This function or variable may be unsafe. Consider using sprintf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
1>        c:\program files\microsoft visual studio 9.0\vc\include\stdio.h(366) : see declaration of 'sprintf'
1>c:\users\skinduptruk\downloads\bzflag-2.0.12\bzflag-2.0.12\plugins\sample_plugin\sample_plugin.cpp(294) : warning C4996: 'sprintf': This function or variable may be unsafe. Consider using sprintf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
1>        c:\program files\microsoft visual studio 9.0\vc\include\stdio.h(366) : see declaration of 'sprintf'
1>c:\users\skinduptruk\downloads\bzflag-2.0.12\bzflag-2.0.12\plugins\sample_plugin\sample_plugin.cpp(305) : warning C4996: 'sprintf': This function or variable may be unsafe. Consider using sprintf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
1>        c:\program files\microsoft visual studio 9.0\vc\include\stdio.h(366) : see declaration of 'sprintf'
1>c:\users\skinduptruk\downloads\bzflag-2.0.12\bzflag-2.0.12\plugins\sample_plugin\sample_plugin.cpp(316) : warning C4996: 'sprintf': This function or variable may be unsafe. Consider using sprintf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
1>        c:\program files\microsoft visual studio 9.0\vc\include\stdio.h(366) : see declaration of 'sprintf'
1>c:\users\skinduptruk\downloads\bzflag-2.0.12\bzflag-2.0.12\plugins\sample_plugin\sample_plugin.cpp(337) : warning C4996: 'sprintf': This function or variable may be unsafe. Consider using sprintf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
1>        c:\program files\microsoft visual studio 9.0\vc\include\stdio.h(366) : see declaration of 'sprintf'
1>c:\users\skinduptruk\downloads\bzflag-2.0.12\bzflag-2.0.12\plugins\sample_plugin\sample_plugin.cpp(350) : warning C4996: 'sprintf': This function or variable may be unsafe. Consider using sprintf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
1>        c:\program files\microsoft visual studio 9.0\vc\include\stdio.h(366) : see declaration of 'sprintf'
1>c:\users\skinduptruk\downloads\bzflag-2.0.12\bzflag-2.0.12\plugins\sample_plugin\sample_plugin.cpp(362) : warning C4996: 'sprintf': This function or variable may be unsafe. Consider using sprintf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
1>        c:\program files\microsoft visual studio 9.0\vc\include\stdio.h(366) : see declaration of 'sprintf'
1>c:\users\skinduptruk\downloads\bzflag-2.0.12\bzflag-2.0.12\plugins\sample_plugin\sample_plugin.cpp(373) : warning C4996: 'sprintf': This function or variable may be unsafe. Consider using sprintf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
1>        c:\program files\microsoft visual studio 9.0\vc\include\stdio.h(366) : see declaration of 'sprintf'
1>c:\users\skinduptruk\downloads\bzflag-2.0.12\bzflag-2.0.12\plugins\sample_plugin\sample_plugin.cpp(384) : warning C4996: 'sprintf': This function or variable may be unsafe. Consider using sprintf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
1>        c:\program files\microsoft visual studio 9.0\vc\include\stdio.h(366) : see declaration of 'sprintf'
1>c:\users\skinduptruk\downloads\bzflag-2.0.12\bzflag-2.0.12\plugins\sample_plugin\sample_plugin.cpp(411) : warning C4996: 'sprintf': This function or variable may be unsafe. Consider using sprintf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
1>        c:\program files\microsoft visual studio 9.0\vc\include\stdio.h(366) : see declaration of 'sprintf'
1>c:\users\skinduptruk\downloads\bzflag-2.0.12\bzflag-2.0.12\plugins\sample_plugin\sample_plugin.cpp(422) : warning C4996: 'sprintf': This function or variable may be unsafe. Consider using sprintf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
1>        c:\program files\microsoft visual studio 9.0\vc\include\stdio.h(366) : see declaration of 'sprintf'
1>c:\users\skinduptruk\downloads\bzflag-2.0.12\bzflag-2.0.12\plugins\sample_plugin\sample_plugin.cpp(438) : warning C4996: 'sprintf': This function or variable may be unsafe. Consider using sprintf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
1>        c:\program files\microsoft visual studio 9.0\vc\include\stdio.h(366) : see declaration of 'sprintf'
1>c:\users\skinduptruk\downloads\bzflag-2.0.12\bzflag-2.0.12\plugins\sample_plugin\sample_plugin.cpp(449) : warning C4996: 'sprintf': This function or variable may be unsafe. Consider using sprintf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
1>        c:\program files\microsoft visual studio 9.0\vc\include\stdio.h(366) : see declaration of 'sprintf'
1>Compiling manifest to resources...
1>Microsoft (R) Windows (R) Resource Compiler Version 6.1.6723.1
1>Copyright (C) Microsoft Corporation.  All rights reserved.
1>Linking...
1>SAMPLE_PLUGIN.def(2) : warning LNK4017: DESCRIPTION statement not supported for the target platform; ignored
1>   Creating library Debug/SAMPLE_PLUGIN.lib and object Debug/SAMPLE_PLUGIN.exp
1>SAMPLE_PLUGIN.obj : error LNK2019: unresolved external symbol "public: class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > __thiscall PluginConfig::item(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >,class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >)" (?item@PluginConfig@@QAE?AV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@V23@0@Z) referenced in function "int __cdecl bz_Load(char const *)" (?bz_Load@@YAHPBD@Z)
1>SAMPLE_PLUGIN.obj : error LNK2019: unresolved external symbol "public: __thiscall PluginConfig::PluginConfig(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >)" (??0PluginConfig@@QAE@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@Z) referenced in function "int __cdecl bz_Load(char const *)" (?bz_Load@@YAHPBD@Z)
1>Debug/SAMPLE_PLUGIN.dll : fatal error LNK1120: 2 unresolved externals
1>Build log was saved at "file://c:\Users\SkindupTruk\Downloads\bzflag-2.0.12\bzflag-2.0.12\plugins\SAMPLE_PLUGIN\Debug\BuildLog.htm"
1>SAMPLE_PLUGIN - 3 error(s), 16 warning(s)
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
User avatar
JeffM
Staff Sergeant
Staff Sergeant
Posts: 5196
Joined: Fri Dec 13, 2002 4:11 am

Re: pluginconfig lib missing in win32 VC9?

Post by JeffM »

That plugin is pretty old, the plugin config was moved into the plugin_utils code when it was merged into the sourcetree
You'll have to modify the project to include and link to that. (bzflag\plugins\plugin_utils)

Something like this (assumes a SimpleStats dir in the plugins dir)
Attachments
SimpleStats.zip
SimpleStats VC9 project
(22.71 KiB) Downloaded 166 times
ImageJeffM
Post Reply