Dear Ismail and Michael,
I'm able to add jpeg plugin to OpenSceneGraph project and successfully
compile it. Thank you very much for your help. You guys are awesome.
Best regards,
Dat

On Thu, Apr 9, 2009 at 6:34 PM, Ismail Pazarbasi <pazarb...@gmail.com>wrote:

> Hi Dat,
>
> There is no stupidity, I assure you. I think you are using Microsoft
> Visual C++ or Visual Studio. You have two choices, as far as I can
> tell:
> 1. Run cmake again and set folders (recommended)
> 2. Create a new project
>
> I recommend first method, because it will save you from dealing with
> problems that *may* arrise if project configuration somehow isn't
> correct. Because CMake will generate a correct project file for you
> (for all available build configurations), this seems like the best
> chance. I didn't recommend this previously, because I thought building
> OpenSceneGraph again takes longer than doing it manually.
>
> For this option, run CMake GUI. Choose "Advanced view", next to Search
> box. Type "jpeg" into search box. You will be shown two (or 4)
> variables:
> JPEG_INCLUDE_DIR and JPEG_LIBRARY
> Depending on where you have installed aforementioned jpeg library, you
> need to set these values, something similar to following:
> JPEG_INCLUDE_DIR = C:/Program Files/GnuWin32/include
> JPEG_LIBRARY = C:/Program Files/GnuWin32/lib/jpeg.lib
>
> Library settings in CMake usually ask for the file name, including
> full path, to the import library. I have used (presumably) default
> path for JPEG library installation. I think GnuWin32 installs there by
> default. Unless you didn't modify it during installation, this should
> be correct.
>
> After setting these values, click Configure. Then click Generate, if
> all goes fine. If something goes wrong, CMake will print errors in red
> color (IIRC). This should generate a solution file that, hopefully,
> contains a projcet named "Plugins jpeg". The rest is just building the
> solution.
>
> 2nd choice:
> Go to your OpenSceneGraph source directory. open src\osgPlugins
> directory. Ensure that you have "jpeg" folder. If you have one, then
> open your OpenSceneGraph solution file. Right click on solution and
> choose Add->New Project. This will be a Win32 project. Choose DLL for
> project type, then set tick on "Empty project". For project name, use
> "jpeg" and for Location, enter your osgPlugins directory. For example,
> C:\source\osg\src\osgPlugins. This should create a project inside jpeg
> folder. Locate jpeg project in your solution and rename it to "Plugins
> jpeg". Then, right click on that project and choose Add->Existing
> Files. If Visual Studio didn't do so, open src\osgPlugins folder and
> add ReaderWriterJPEG.cpp (and may be CMakeLists.txt). The rest could
> be a bit complicated. Right click on an existing plugin project and
> start copying its settings one by one into Plugins jpeg project by
> modifying each setting to match with the new project. For example, if
> you copy "Program Database File Name" (under C/C++ settings, under
> Output Files) from "Plugins geo":
> OpenSceneGraph/bin/Debug/../osgPlugins-2.8.0/osgdb_geod.pdb
> should become:
> OpenSceneGraph/bin/Debug/../osgPlugins-2.8.0/osgdb_jpegd.pdb
> notice the "d" prefix. That's for debug configuration. For release
> configurations, remove d prefix.
>
> Also, this project must link with jpeg.lib. You must add this into
> additional libraries list in Linker settings of the project.
>
> Alternatively, you can copy another plugin's project file into jpeg's
> folder and make name modifications on it (also, adding jpeg.lib into
> additional libraries value in linker settings). This too requires
> project file hacking.
>
> I think latter method is a bit error prone and may not be suitable for
> you, if you haven't dealt with Visual Studio projects before. Finally,
> may be examples depend on JPEG library settings and if you don't do
> it, you may miss examples as well.
>
> Ismail
>
> On Fri, Apr 10, 2009 at 12:43 AM, tien dat <tienda...@gmail.com> wrote:
> > Hi Ismail and Michael,
> > I compile OpenSceneGraph from sourse and I don't see osgdb_jpeg.dll in
> bin
> > folder, so I think that I have to build one by myself. But when I start,
> I
> > don't know how to do it (sorry for my stupidity, but I've never worked
> with
> > dll project before).
> > Could you please guide me through the process of making the plug-in for
> > OpenSceneGraph, or creating a new project to make osgdb_jpeg.dll.
> > (I did try to open CMake for OpenSceneGraph project, but didn't know how
> to
> > set JPEG lib)
> > Thanks a bunch,
> > Dat
> >
> > On Wed, Apr 8, 2009 at 7:35 PM, Ismail Pazarbasi <pazarb...@gmail.com>
> > wrote:
> >>
> >> Hi Dat,
> >>
> >> check whether osgdb_jpeg library is present in osg's bin or plugins
> >> directory. If it is present, then ensure that it's accessible by your
> >> application (as a matter of fact, by your operating system's dynamic
> >> linker; good starting point could be copying osgdb_jpeg library into
> >> your application's directory).
> >>
> >> If osgdb_jpeg does not exist, you need to build it. What you have
> >> installed could be GnuWin32 port of jpeg library, which is a
> >> dependency of osgdb_jpeg, which is exactly what you need. As Michael
> >> suggested; if you have built OpenSceneGraph from sources, you may need
> >> to rerun CMake by setting JPEG library settings or you may try to
> >> build (and even create) osgdb_jpeg project individually.
> >>
> >> I haven't tried with jpeg module but I have built freetype myself on a
> >> Windows. Due to include directory confusion, I left freetype settings
> >> blank when I ran CMake first time. I have added (or may be I have
> >> created) osgdb_freetype project manually, added source and adjusted
> >> settings. You may try to build this library separately, if you want to
> >> save some (!) time, instead of building whole osg. Follow guidelines
> >> about paths on osg web site.
> >>
> >> See path settings on top of this page:
> >>
> >>
> http://www.openscenegraph.org/projects/osg/wiki/Support/UserGuides/Examples
> >>
> >> Ismail
> >>
> >> On Thu, Apr 9, 2009 at 1:04 AM, tien dat <tienda...@gmail.com> wrote:
> >> > Hi Gordon,
> >> > Thank you for your answer. I follow your link to download the setup
> >> > program
> >> > and install it. But there is no further instruction how to do next. I
> >> > try to
> >> > re-run my program but the error doesn't go away.
> >> > Could you please tell me what to do next.
> >> > Thanks a bunch,
> >> > Dat
> >> >
> >> > On Wed, Apr 8, 2009 at 3:20 PM, Tomlinson, Gordon
> >> > <gtomlin...@overwatch.textron.com> wrote:
> >> >>
> >> >> see
> >> >>
> >> >>
> http://www.openscenegraph.org/projects/osg/wiki/Downloads/Dependencies
> >> >>
> >> >>
> >> >>
> >> >> Gordon
> >> >> Product Manager 3d
> >> >> __________________________________________________________
> >> >> Gordon Tomlinson
> >> >> Email  : gtomlinson  @ overwatch.textron.com
> >> >> __________________________________________________________
> >> >>
> >> >>
> >> >> ________________________________
> >> >> From: osg-users-boun...@lists.openscenegraph.org
> >> >> [mailto:osg-users-boun...@lists.openscenegraph.org] On Behalf Of
> tien
> >> >> dat
> >> >> Sent: Wednesday, April 08, 2009 3:50 PM
> >> >> To: Robert Osfield; OpenSceneGraph Users
> >> >> Subject: [osg-users] plugin to read .jpg files
> >> >>
> >> >> Dear all,
> >> >> I have a problem with reading .jpg files with OpenSceneGraph
> (warning:
> >> >> "Could not find plugin to read objects from file X.jpg"). I see a
> >> >> source
> >> >> file in osgPlugin/jpeg but don't know how to use it. Could you tell
> me
> >> >> how
> >> >> to compile these files.
> >> >> Thanks,
> >> >> Dat
> >> >>
> >> >>
> >> >>
> >> >> _______________________________________________
> >> >> osg-users mailing list
> >> >> osg-users@lists.openscenegraph.org
> >> >>
> >> >>
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
> >> >>
> >> >
> >> >
> >> >
> >> > --
> >> > -------------
> >> > Dat Tien Nguyen
> >> > PhD student, Computer Science Department
> >> > The University of Iowa, IA 52242
> >> > http://cs.uiowa.edu/~tinguyen <http://cs.uiowa.edu/%7Etinguyen>
> >> >
> >> >
> >> > _______________________________________________
> >> > osg-users mailing list
> >> > osg-users@lists.openscenegraph.org
> >> >
> >> >
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
> >> >
> >> >
> >> _______________________________________________
> >> osg-users mailing list
> >> osg-users@lists.openscenegraph.org
> >>
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
> >
> >
> >
> > --
> > -------------
> > Dat Tien Nguyen
> > PhD student, Computer Science Department
> > The University of Iowa, IA 52242
> > http://cs.uiowa.edu/~tinguyen <http://cs.uiowa.edu/%7Etinguyen>
> >
> >
> > _______________________________________________
> > osg-users mailing list
> > osg-users@lists.openscenegraph.org
> >
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
> >
> >
> _______________________________________________
> osg-users mailing list
> osg-users@lists.openscenegraph.org
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>



-- 
-------------
Dat Tien Nguyen
PhD student, Computer Science Department
The University of Iowa, IA 52242
http://cs.uiowa.edu/~tinguyen
_______________________________________________
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to