Re: [osg-users] Installation Problems.VS10 - unresolved external symbol

2012-01-15 Thread Kirill Serebtiakov
Ok.After brief reflection, I decided that the problem with
x64 was because i've tried to compile it like x86 Application (yes,my bad).
x86 was because i've changed Environment variable and didn't reboot my system, 
so when it tried to compile project, it used .dll files from x64 bin folder, 
that was set in path variable before.
As a result, I had the same errors in both cases.
btw switching between Multi-Byte Character Set / Unicode Character Set does not 
affect the work of application.
Anyway, I want to share my experience of the pre-compiled OSG setup for VS10. 
Hope it will be useful for someone.
Here is my step-by-step instructions for Dummies.
1. Download latest version of pre-compiled binaries from AlphaPixel 
(http://openscenegraph.alphapixel.com/osg/downloads/free-openscenegraph-binary-downloads).
 You will need at least two archives x86-debugx86-release or/and 
x64-debugx64-release
2. Unpack debug and release into one folder. (u will have 
bin,data,doc,include,lib,share folders). If u install x86 and x64, You can 
remove doc, data from one folder because it is the same files. (I've made root 
folder OSG,which contains data,doc,x64,x86 folders.And x86/x64 contains 
bin,lib,include folders.) You can also remove share folder, you dont need it 
for work.
3. Configure your Environment variables (choose one step only)
3.1 Do it yourself
3.1.1 Right click on the Computer icon and choose Properties option.
3.1.2 In the System window click on Advanced system settings in the left pane.
3.1.3 In the System Properties window select Advanced tab and click on 
Environment Variables… button.
3.1.4 In the Environment Variables window you will notice two columns User 
variables for a username and System variables. You should edit system vars.

Code:
OSG_ROOT - your OSG root folder
OSG_BIN_PATH = %OSG_ROOT%\bin 
OSG_INCLUDE_PATH = %OSG_ROOT%\include 
OSG_LIB_PATH = %OSG_ROOT%\lib 


not necessary:

Code:
OSG_SAMPLES_PATH = %OSG_ROOT%\share\OpenSceneGraph\bin 
OSG_FILE_PATH = %OSG_ROOT%\data
path = %path%;%OSG_BIN_PATH%;%OSG_SAMPLES_PATH%;


btw try to avoid spaces in your paths
3.2 Use batch file

Code:
@echo off
rem Tested on Win7x64, pre-compiled OSG 3.0.1 from AlphaPixel, VisualStudio2010
rem must work on Win7Vista x86/x64
rem ©Kirill Serebriakov (17:06 14.01.2012)

set x86path=--!SET PATH TO YOUR X86 osg FOLDER!--
set x64path=--!SET PATH TO YOUR X64 osg FOLDER!--

rem data folder is not necessary
set data=--!SET PATH TO YOUR X64 data FOLDER!--
IF NOT EXIST %x86path% (echo x86path is not set or incorrect
GOTO x64)
:x86
SETX OSG_ROOTx86 %x86path% -m
SETX OSG_BIN_PATHx86 %%OSG_ROOTx86%%\bin -m 
SETX OSG_INCLUDE_PATHx86 %%OSG_ROOTx86%%\include -m
SETX OSG_LIB_PATHx86 %%OSG_ROOTx86%%\lib -m
:x64
IF NOT EXIST %x64path% (echo x64path is not set or incorrect 
GOTO finish)
SETX OSG_ROOTx64 %x64path% -m
SETX OSG_BIN_PATHx64 %%OSG_ROOTx64%%\bin -m
SETX OSG_INCLUDE_PATHx64 %%OSG_ROOTx64%%\include -m
SETX OSG_LIB_PATHx64 %%OSG_ROOTx64%%\lib -m
:finish
IF EXIST %data% (SETX OSG_FILE_PATH %data% -m)
echo reboot Your system
pause


and this one to delete paths

Code:
@echo off
:x86
echo Removing x86 OSG path
REG delete HKLM\SYSTEM\CurrentControlSet\Control\Session Manager\Environment 
/f /V OSG_ROOTx86
REG delete HKLM\SYSTEM\CurrentControlSet\Control\Session Manager\Environment 
/f /V OSG_BIN_PATHx86
REG delete HKLM\SYSTEM\CurrentControlSet\Control\Session Manager\Environment 
/f /V OSG_INCLUDE_PATHx86
REG delete HKLM\SYSTEM\CurrentControlSet\Control\Session Manager\Environment 
/f /V OSG_LIB_PATHx86
:x64
echo Removing x64 OSG path
REG delete HKLM\SYSTEM\CurrentControlSet\Control\Session Manager\Environment 
/f /V OSG_ROOTx64
REG delete HKLM\SYSTEM\CurrentControlSet\Control\Session Manager\Environment 
/f /V OSG_BIN_PATHx64
REG delete HKLM\SYSTEM\CurrentControlSet\Control\Session Manager\Environment 
/f /V OSG_INCLUDE_PATHx64
REG delete HKLM\SYSTEM\CurrentControlSet\Control\Session Manager\Environment 
/f /V OSG_LIB_PATHx64
:data
REG delete HKLM\SYSTEM\CurrentControlSet\Control\Session Manager\Environment 
/f /V OSG_FILE_PATH
:finish
echo reboot Your system
pause


3.3 Or you can skip this step, but you'll have to spend a little more time to 
configure Visual Studio
4. Don't forget to reboot your system if u change Environment variables.
5. Open Visual Studio. File - New - Project - Visual C++ - Empty Project 
6. Config your project. Project - Properties
6.1. You must set path to your lib folder and include folder

Code:
C/C++ - General - Additional Include Directories add $(OSG_INCLUDE_PATH) 
Linker - General - Additional Library Directories add $(OSG_LIB_PATH) 


or

Code:
VC++ Directories - Include Directories add $(OSG_INCLUDE_PATH) 
VC++ Directories - Library Directories add $(OSG_LIB_PATH) 


if you skiped step 3, you must set absolute path to your folders.
6.2. Add Lib files

Code:
Linker - Input - Additional Dependencies add all .lib files that you need 
(for Debug LibNamed.lib)/without -d(for Release) 


6.3 

[osg-users] Installation Problems.VS10 - unresolved external symbol

2012-01-12 Thread Kirill Serebtiakov
Hi,

I tried to install OSG, but it seems that i missed something.
I'll try to describe what i have done.

Preparations:
1. Download pre-compiled binaries from AlphaPixel. 3.0.1 Debug + Realease for 
both architecture (x64/x86). (didn't download PDBs).
2. Download pre-compiled binaries from AlphaPixel. 2.8.5 Debug + Realease for 
both architecture (x64/x86). (didn't download PDBs).
3. Download source code (version 3.0.1) from openscenegraph.
4. Download and install CMake.
5. Download SampleDatasets for 3.0.0 from openscenegraph.

Installation:
First:
1. Unpack  pre-compiled binaries (ReleaseDebug x64) into one folder. (i have 
Win7x64)
2. Configurate my system pathes.

Code:
OSG_ROOT - my root folder (W:\Programs\Development\OpenSceneGraph_3.0.1_VS10x64)
OSG_BIN_PATH = %OSG_ROOT%\bin
OSG_INCLUDE_PATH = %OSG_ROOT%\include
OSG_LIB_PATH = %OSG_ROOT%\lib
OSG_SAMPLES_PATH = %OSG_ROOT%\share\OpenSceneGraph\bin
OSG_FILE_PATH = %OSG_ROOT%\data


3. Check... 

Code:
Run - cmd - osversion - works (OpenSceneGraph Library 3.0.1).
Run - cmd - osgviewer cow.osg - works too.


4. Run VS10.
5. Created C++ Win32 Empty Project.
6. Add new cpp file and pasted code from BasicGeometry Tutorial.
7. Configurate my project.

Code:
Project - Properties - C/C++ - General - Additional Include Directories add 
$(OSG_INCLUDE_PATH)
Project - Properties - C/C++ - Preprocessor - Preprocessor Definitions add 
WIN32;_WIN32;_DEBUG(for Debug)/WIN32;_WIN32;NDEBUG (for Release)
Project - Properties - Linker - General - Additional Library Directories 
add $(OSG_LIB_PATH)
Project - Properties - Linker - Input - Additional Dependencies add 
osgd.lib osgGAd.lib osgDBd.lib osgViewerd.lib (for Debug)/without -d(for 
Release)
Project - Properties - General - Character Set - Use Multi-Byte Character 
Set
Project - Properties - C/C++ - Language - Enable Run-Time Type Information 
- Yes(/GR)


8. Tried to Run in Debug. Fail.

Code:
error LNK1120: 162 unresolved externals
error LNK2001: unresolved external symbol protected: virtual void __thiscall 
osg::Group::childInserted(unsigned int) (?childInserted@Group@osg@@MAEXI@Z)
...


9. Tried to Run in Release. Same errors.
Seems like it didnt detect my lib files, but i'm sure i've pointed the path.
10. Well, for reinsurance...

Code:
Project - Properties - C/C++ - General - Additional Include Directories add 
W:\Programs\Development\OpenSceneGraph_3.0.1_VS10x64\include
Project - Properties - Linker - General - Additional Library Directories 
add W:\Programs\Development\OpenSceneGraph_3.0.1_VS10x64\lib


nope...didn't help.

Second:
1. same steps but for pre-compiled binaries x86.Same results.

Third(compile src by myself):
1.Open CMake.
2.Pointed to my OSG folder with sources.
3.Press Configure...Something happens. Well as result i've got .sln file.
4.Open .sln and compile.
5. Wait...
6. Wait...
7. Ok.Finished, got lib folder.
8. Copied bin,lib,include folders into a new one, added other folders from 
pre-compiled version (share,data).
9. And repeat from First-2 to the end...Same results.

Fourth and Fifth:
1. Checked pre-compiled binaries for 2.8.5 x64  x86. Yeah...have 157 errors 
instead of 162...realy nice...

Yeah...i knew that I've done too much excess,  but miracles happensbut not 
this time...
As a conclusion i think i've missed something...but i dont have an idea what to 
do...
Hope someone can tell me what should i do.

Thank you!

Cheers,
Kirill

--
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=44763#44763





___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] Installation Problems.VS10 - unresolved external symbol

2012-01-12 Thread Jean-Sébastien Guay

Hello Kirill,


Project -  Properties -  General -  Character Set -  Use Multi-Byte 
Character Set


I think this is your mistake, I have never had to set this, and I 
believe it creates incompatible binaries. Meaning if the OSG libs were 
not compiled using multi-byte character set, and you try to link to them 
in a project that is, it will fail.


So if in your own project you change this back to the default, you 
should be able to use the pre-compiled binaries. Extra kudos for having 
tried all the other paths as well, though! I think they all failed for 
the same reason - even when you create your own project files using 
CMake from the OSG sources, it will not use multi-byte character set, so 
the binaries it compiled were incompatible with the project you created 
which did.


Hope this helps, let us know how it goes.

J-S
--
__
Jean-Sebastien Guay  jean_...@videotron.ca
http://whitestar02.dyndns-web.com/
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] Installation Problems.VS10 - unresolved external symbol

2012-01-12 Thread Chris 'Xenon' Hanson
On 1/12/2012 9:26 AM, Jean-Sébastien Guay wrote:
 Hello Kirill,
 Project -  Properties -  General -  Character Set -  Use Multi-Byte 
 Character Set
 I think this is your mistake, I have never had to set this, and I believe it 
 creates
 incompatible binaries. Meaning if the OSG libs were not compiled using 
 multi-byte
 character set, and you try to link to them in a project that is, it will fail.

  I concur. This generates code with a different set of name mangling, and 
therefore will
intentionally fail to link.

  If you _absolutely_ need MBCS support, you'll probably have to build OSG (and 
all the
third-party dependencies) with MBCS support.

  If you want, I could make you an estimate for having our build farm build it 
that way.

 J-S


-- 
Chris 'Xenon' Hanson, omo sanza lettere. xe...@alphapixel.com 
http://www.alphapixel.com/
  Digital Imaging. OpenGL. Scene Graphs. GIS. GPS. Training. Consulting. 
Contracting.
There is no Truth. There is only Perception. To Perceive is to Exist. - 
Xen
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] Installation Problems.VS10 - unresolved external symbol

2012-01-12 Thread Kirill Serebtiakov

Jean-Sébastien Guay wrote:
 
 
  Project -  Properties -  General -  Character Set -  Use Multi-Byte 
  Character Set
  
 
 I think this is your mistake

Nope...First time tried with unicode.Then i've found 
OsgInstallationOnWindows.rar which have .txt instructions (How to run 
OpenSceneGraph 2.4.0 under Microsoft Visual Studio 2003). There were few 
options that i didn't set before.

Code:
- General - Character Set - Use Multi-Byte Character Set
- C/C++ - Language - Enable Run-Time Type Info - Yes (/GR)


Well,i added this, but i didn't help anyway...same errors. Something with lib 
files i believe...because usually I get an unresolved external symbol error, 
if not added in the properties required lib files.

Any other ideas what should i do?

P.S. I will try to install on other PC, may be problem in my current system...

Thank you! 

Cheers, 
Kirill

--
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=44782#44782





___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] Installation Problems.VS10 - unresolved external symbol

2012-01-12 Thread Mourad Boufarguine
Hi,

Are you building your project in 64bit too ?

Mourad
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] Installation Problems.VS10 - unresolved external symbol

2012-01-12 Thread Kirill Serebtiakov

bouffa wrote:
 Hi, 
 Are you building your project in 64bit too ? 
 


No, i've triead to build it using x64 and x86 OSG. Similar mistakes. But I'll 
check just in case.

--
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=44786#44786





___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] Installation Problems.VS10 - unresolved external symbol

2012-01-12 Thread Chris 'Xenon' Hanson
On 1/12/2012 10:25 AM, Kirill Serebtiakov wrote:
 No, i've triead to build it using x64 and x86 OSG. Similar mistakes. But I'll 
 check just in case.

  You can turn on linker debgging in VC++ so it tells you exactly what it is 
searching
for, and where it is searching. Usually if you compare the mangled names of the 
symbol
it's searching for, and what it found, you'll see a mismatch. Decoding the name 
mangling:

http://en.wikipedia.org/wiki/Microsoft_Visual_C%2B%2B_Name_Mangling
http://msdn.microsoft.com/en-us/library/5x49w699.aspx

  will usually tell you what settings are different between the builds.

-- 
Chris 'Xenon' Hanson, omo sanza lettere. xe...@alphapixel.com 
http://www.alphapixel.com/
  Digital Imaging. OpenGL. Scene Graphs. GIS. GPS. Training. Consulting. 
Contracting.
There is no Truth. There is only Perception. To Perceive is to Exist. - 
Xen
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] Installation Problems.VS10 - unresolved external symbol

2012-01-12 Thread Kirill Serebtiakov

bouffa wrote:
 
 Are you building your project in 64bit too ? 
 


Yeah...my bad, you were rigth. That was a reason for x64 OSG. Just change 
project to x64 and it started work.
But still...i had the same errors with x86 OSG (im sure i cheked with both 
versions 3.0.12.8.5).
Well need some time to analyze all my actions and make some conclusion.

Thank you! 

Cheers, 
Kirill

--
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=44792#44792





___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org