Plugin help - Debug error

Provide easy-to-use, extensible software for modeling, simulating, controlling, and analyzing the neuromusculoskeletal system.
POST REPLY
User avatar
Nur Adila Faruk Senan
Posts: 75
Joined: Tue Apr 06, 2010 8:20 pm

Plugin help - Debug error

Post by Nur Adila Faruk Senan » Wed Jan 05, 2011 8:40 pm

Hey Ayman,

I've been having some trouble trying to build an OpenSim plugin. I've been following the directions in the Developer's guide (Chapter 3: Creating Your Own Analysis) and I've also checked around in the forum pages, but I haven't been able to find anything helpful. I've managed to go through steps 1 through 4 (Prepare a working directory --> Rename Template --> Run CMake --> Open the solution file OsimPlugin.sln), but every time I try and build my solution, I get this error message in Visual Studio:

------ Build started: Project: Libraries - osimPlugin, Configuration: Release Win32 ------
Compiling...
RegisterTypes_osimPlugin.cpp
..\plugin\RegisterTypes_osimPlugin.cpp(50) : error C3861: 'myAnalysisPlugin': identifier not found
myAnalysisPlugin.cpp
..\plugin\myAnalysisPlugin.cpp(56) : error C2653: 'myAnalysisPlugin' : is not a class or namespace name
..\plugin\myAnalysisPlugin.cpp(56) : fatal error C1903: unable to recover from previous error(s); stopping compilation
Generating Code...
Build log was saved at "file://c:\OpenSimPlugin\pluginBuild\osimPlugin.dir\Release\BuildLog.htm"
Libraries - osimPlugin - 3 error(s), 0 warning(s)
========== Build: 0 succeeded, 1 failed, 2 up-to-date, 0 skipped ==========

I've attached a link to a video of the whole process here if that's any help.

http://screencast.com/t/yZjV5Br3M42J

And here's an image of the files in my "plugin" folder
http://screencast.com/t/xNiDcHXbPii

I'm not sure where the error is -- I've gone through the other forum posts but haven't been able to figure it out from any of those posts.

Thanks a bunch,
adila

p.s. I replaced all the "AnalysisPlugin_Template" terms in the myAnalysisPlugin.h and myAnalysisPlugin.h files prior to doing anything to see if that would fix things (instead of doing a 'search and replace' on the entire solution after opening the OpenSimPlugin.sln solution file like suggested in the guide since that produced zero matches). I'm using CMake 2.6, Microsoft Visual C++ 2008 Express Edition and OpenSim 2.2 (released December 2nd 2010) if that's any help.


p.p.s. Here's the contents of the log file if that's any help:

Build Log Build started: Project: Libraries - osimPlugin, Configuration: Release|Win32
Command Lines Creating temporary file "c:\OpenSimPlugin\pluginBuild\osimPlugin.dir\Release\RSP00000121203152.rsp" with contents
[
/O2 /Ob2 /I "C:\OpenSim2.2\sdk\include" /I "C:\OpenSim2.2\sdk\include\xercesc" /I "C:\OpenSim2.2\sdk\include\SimTK\include" /D "WIN32" /D "_WINDOWS" /D "NDEBUG" /D "CMAKE_INTDIR=\"Release\"" /D "OSIMPLUGIN_EXPORTS" /D "_WINDLL" /D "_MBCS" /FD /EHsc /MD /Fo"osimPlugin.dir\Release\\" /Fd"C:/OpenSimPlugin/pluginBuild/Release/osimPlugin.pdb" /W3 /c /TP /Zm1000

..\plugin\RegisterTypes_osimPlugin.cpp

..\plugin\myAnalysisPlugin.cpp
]
Creating command line "cl.exe @c:\OpenSimPlugin\pluginBuild\osimPlugin.dir\Release\RSP00000121203152.rsp /nologo /errorReport:prompt"
Output Window Compiling...
RegisterTypes_osimPlugin.cpp
..\plugin\RegisterTypes_osimPlugin.cpp(50) : error C3861: 'myAnalysisPlugin': identifier not found
myAnalysisPlugin.cpp
..\plugin\myAnalysisPlugin.cpp(56) : error C2653: 'myAnalysisPlugin' : is not a class or namespace name
..\plugin\myAnalysisPlugin.cpp(56) : fatal error C1903: unable to recover from previous error(s); stopping compilation
Generating Code...
Results Build log was saved at "file://c:\OpenSimPlugin\pluginBuild\osimPlugin.dir\Release\BuildLog.htm"
Libraries - osimPlugin - 3 error(s), 0 warning(s)



User avatar
Moon Ki Jung
Posts: 44
Joined: Wed Oct 24, 2007 2:56 am

RE: Plugin help - Debug error

Post by Moon Ki Jung » Wed Jan 05, 2011 9:39 pm

Hi adila,

After seeing your post, I tested the chapter 3 of the developers guide to build my own OpenSim plugin and it works very well.

I guess that you replaced all the "AnalysisPlugin_Template" terms in the
myAnalysisPlugin.h and myAnalysisPlugin.h files manually by yourself instead of using replacing function in the Visual Studio.

In the "C:\OpenSimPlugin\plugin" folder, there is another file that contains the term "AnalysisPlugin_Template". It is "RegisterTypes_osimPlugin.cpp" file. In the file you should replace this term as what you renamed.

"osimPluginDLL.h" and "RegisterTypes_osimPlugin.h" file don't need to be changed as you know.

Please check this.

I hope this helps you.

Best regards,
Moonki

P.S) We can get the Visual Studio 2005 and 2008 professional editions at https://www.dreamspark.com/ if we have a valid email address of our Universities.

User avatar
Nur Adila Faruk Senan
Posts: 75
Joined: Tue Apr 06, 2010 8:20 pm

RE: Plugin help - Debug error

Post by Nur Adila Faruk Senan » Thu Jan 06, 2011 12:56 am

Hi Moonki,

Thank you very much for your suggestion. I double checked the "RegisterTypes_osimPlugin.cpp" file and all the "AnalysisPlugin_Template" terms had been replaced with "myAnalysisPlugin", so I don't know if that's the problem.

When I initially tried using the 'find and replace' function in Visual Studio, it gave me the following message:

The following specified text was not found:
AnalysisPlugin_Template

That's why I ended up changing the text from within the individual files.

Do you think my error messages are related to the version of Visual Studio I've checked around in the forum, and other users seem to be using the same version as I am (Visual C++ 2008 Express Edition) with no trouble.

Thanks again for your help!
adila

User avatar
Nur Adila Faruk Senan
Posts: 75
Joined: Tue Apr 06, 2010 8:20 pm

RE: Plugin help - Debug error

Post by Nur Adila Faruk Senan » Thu Jan 06, 2011 1:46 am

Hey Moonki,

I managed to find the error in the code - the myAnalysisPlugin.h file didn't have all of the AnalysisPlugin_Template terms replaced.

The code compiles now, and the plugins are built in the "plugins" folder in my OpenSim2.2. directory. Success! :)
Hopefully, everything else will go smoothly from here on out.

Thank you very, very much for your help!

adila

POST REPLY