[osg-users] ??: A simple question from an learner.
Mike Wittman
mwittman at seismicmicro.com
Fri Aug 3 07:16:46 PDT 2007
Hi Bingli,
I suspect you've got "pure" CLR support (/clr:pure) selected in your project configuration, which tells the compiler you're only using managed code. You need to have standard CLR support (/clr) selected to compile against the native code of OSG. The setting is in the General section of your project's Configuration Properties.
-Mike
________________________________
From: osg-users-bounces at lists.openscenegraph.org [mailto:osg-users-bounces at lists.openscenegraph.org] On Behalf Of ijustfu
Sent: Thursday, August 02, 2007 8:57 PM
To: osg-users at lists.openscenegraph.org
Subject: [osg-users] ??: A simple question from an learner.
Dear Mike,
Thanks for you help. There are so many warnings and errors. Following are some statements:
1>------ Build started: Project: VGEForPRDAirPollution, Configuration: Debug Win32 ------
1>Compiling...
1>VGEForPRDAirPollution.cpp
1>C:\OpenSceneGraph2.0\OpenSceneGraph\include\OpenThreads/Mutex(40) : warning C4272: 'OpenThreads::Mutex::Mutex' : is marked __declspec(dllimport); must specify native calling convention when importing a function.
OpenThreads::Mutex::`vftable'' : per-appdomain symbol should not be marked with __declspec(dllimport)
1>C:\OpenSceneGraph2.0\OpenSceneGraph\include\osg/Referenced(64) : warning C4272: 'osg::Referenced::ref' : is marked
......
1>VGEForPRDAirPollution.obj : error LNK2028: unresolved token (0A00000C) "public: void __clrcall osg::Referenced::ref(void)const " (?ref at Referenced@osg@@$$FQBMXXZ) referenced in function "public: __clrcall osg::ref_ptr<class osg::Referenced>::ref_ptr<class osg::Referenced>(class osg::ref_ptr<class osg::Referenced> const &)" (??0?$ref_ptr at VReferenced@osg@@@osg@@$$FQAM at ABV01@@Z)
1>VGEForPRDAirPollution.obj : error LNK2028: unresolved token (0A00000D) "public: void __clrcall osg::Referenced::unref(void)const " (?unref at Referenced@osg@@$$FQBMXXZ) referenced in function "public: __clrcall osg::ref_ptr<class osg::Referenced>::~ref_ptr<class osg::Referenced>(void)" (??1?$ref_ptr at VReferenced@osg@@@osg@@$$FQAM at XZ)
1>VGEForPRDAirPollution.obj : error LNK2028: unresolved token (0A000011) "public: __clrcall osg::CopyOp::CopyOp(unsigned int)" (??0CopyOp at osg@@$$FQAM at I@Z) referenced in function "public: __clrcall osg::RefMatrixd::RefMatrixd(class osg::RefMatrixd const &)" (??0RefMatrixd at osg@@$$FQAM at ABV01@@Z)
1>VGEForPRDAirPollution.obj : error LNK2028: unresolved token (0A000012) "public: virtual __clrcall osg::CopyOp::~CopyOp(void)" (??1CopyOp at osg@@$$FUAM at XZ) referenced in function "public: __clrcall osg::RefMatrixd::RefMatrixd(class osg::RefMatrixd const &)" (??0RefMatrixd at osg@@$$FQAM at ABV01@@Z)
1>VGEForPRDAirPollution.obj : error LNK2028: unresolved token (0A000013) "public: __clrcall osg::Object::Object(void)" (??0Object at osg@@$$FQAM at XZ) referenced in function "public: __clrcall osg::StateAttribute::Callback::Callback(void)" (??0Callback at StateAttribute@osg@@$$FQAM at XZ)
1>VGEForPRDAirPollution.obj : error LNK2028: unresolved token (0A000014) "public: __clrcall osg::Object::Object(bool)" (??0Object at osg@@$$FQAM at _N@Z) referenced in function "public: __clrcall osg::RefMatrixd::RefMatrixd(void)" (??0RefMatrixd at osg@@$$FQAM at XZ)
......
1>Build log was saved at "file://d:\VGEForPRDAirPollution\TestNet\VGEForPRDAirPollution\VGEForPRDAirPollution\Debug\BuildLog.htm"
1>VGEForPRDAirPollution - 1227 error(s), 4507 warning(s)
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
Thanks and regards
Bingli
The Institute of Space and Earth Information Science,
The Chinese university of Hong Kong, Shatin, N.T., Hong Kong, P.R.China
-----邮件原件-----
发件人: osg-users-bounces at lists.openscenegraph.org [mailto:osg-users-bounces at lists.openscenegraph.org] 代表 Mike Wittman
发送时间: 2007年8月2日 22:23
收件人: osg-users at lists.openscenegraph.org
主题: Re: [osg-users] A simple question from an learner.
OSG can definitely be used with WinForms. It sounds like you're running
into some project configuration issue though. If you can post your
error messages we might be able to provide better help.
-Mike
> -----Original Message-----
> From: osg-users-bounces at lists.openscenegraph.org [mailto:osg-users-
> bounces at lists.openscenegraph.org] On Behalf Of ijustfu
> Sent: Thursday, August 02, 2007 4:25 AM
> To: osg-users at lists.openscenegraph.org
> Subject: [osg-users] A simple question from an learner.
>
> Dear Robert.
> I build a simple OSG program with visual studio2005.net. I use c++
> language , and select "window forms application", then get the
following
> codes:
>
> #include "stdafx.h"
> #include "Form1.h"
>
> #include <osgViewer/Viewer>
> #include <osgDB/ReadFile>
>
> using namespace VGEForPRDAirPollution;
>
> [STAThreadAttribute]
> int main(array<System::String ^> ^args)
> {
> // Enabling Windows XP visual effects before any controls are
> created
> Application::EnableVisualStyles();
> Application::SetCompatibleTextRenderingDefault(false);
> // Create the main window and run it
> Application::Run(gcnew Form1());
>
> osgViewer::Viewer viewer;
> viewer.setSceneData(osgDB::readNodeFile("cow.osg"));
> return viewer.run();
> }
>
> After adding osgViewerd.lib and osgDBd.lib into project, compile it
but
> fund
> so many warnings and errors.
>
> Above codes can be run under 'win32 console application'(c++).
>
> Does above means OSG can not be used under "window forms application"?
If
> yes, is there any setting of solution environment?
>
> Thanks.
> Bingli
>
>
>
> _______________________________________________
> osg-users mailing list
> osg-users at lists.openscenegraph.org
>
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.or
g
_______________________________________________
osg-users mailing list
osg-users at lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.openscenegraph.org/pipermail/osg-users-openscenegraph.org/attachments/20070803/3215c83a/attachment.html
More information about the osg-users
mailing list