13 Replies - 1703 Views - Last Post: 16 November 2010 - 10:19 AM Rate Topic: -----

#1 Ferguzz  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 19
  • Joined: 09-November 10

Using SVL with OpenGL and SDL Mac

Posted 15 November 2010 - 07:28 AM

Hi,

I'm writing simple C code to display various shapes using openGL and SDL on a Mac. I need to use the SVL library for some transformations. My code works absolutely fine without SVL. As soon as I attempt to #include "svl/svl.h" I get a ridiculous amount of errors in my C code. Things like 'Storage class specified for parameter...'
'Parameter 'video_flags' is initialized' syntax error before 'if'. I have no idea what's going on. There are also tonnes of errors in the svl headers themselves!

Has anyone else had any of these same problems??

Tom

Is This A Good Question/Topic? 0
  • +

Replies To: Using SVL with OpenGL and SDL Mac

#2 stayscrisp  Icon User is offline

  • フカユ
  • member icon

Reputation: 998
  • View blog
  • Posts: 4,173
  • Joined: 14-February 08

Re: Using SVL with OpenGL and SDL Mac

Posted 15 November 2010 - 08:58 AM

What steps did you take to link the library?
Was This Post Helpful? 0
  • +
  • -

#3 Ferguzz  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 19
  • Joined: 09-November 10

Re: Using SVL with OpenGL and SDL Mac

Posted 15 November 2010 - 09:01 AM

I pointed my header search paths to the svl include directory. What else do I need to do?

Thanks!
Was This Post Helpful? 0
  • +
  • -

#4 stayscrisp  Icon User is offline

  • フカユ
  • member icon

Reputation: 998
  • View blog
  • Posts: 4,173
  • Joined: 14-February 08

Re: Using SVL with OpenGL and SDL Mac

Posted 15 November 2010 - 09:08 AM

Well you will most likely need to point the library search paths to the lib folder and if there is a dll copy it to your win32 folder. Inside additional dependencies in your properties->linker you will need to add the lib file.
Was This Post Helpful? 0
  • +
  • -

#5 Ferguzz  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 19
  • Joined: 09-November 10

Re: Using SVL with OpenGL and SDL Mac

Posted 15 November 2010 - 09:13 AM

I am using Xcode on OSX. I have had a look at the readme again but the instructions seem to rely on the .dsw and .dsp files which are only good if you're using visual studio?
Was This Post Helpful? 0
  • +
  • -

#6 Ferguzz  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 19
  • Joined: 09-November 10

Re: Using SVL with OpenGL and SDL Mac

Posted 15 November 2010 - 09:26 AM

managed to find a unix version at http://www.cs.cmu.ed...jw/public/dist/ so hopefully will have more luck now...
Was This Post Helpful? 0
  • +
  • -

#7 Ferguzz  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 19
  • Joined: 09-November 10

Re: Using SVL with OpenGL and SDL Mac

Posted 15 November 2010 - 10:24 AM

unfortunately not. Still having the same problems as previously. the download includes makefiles to run but upon running 'make install' I get the following:

installing into /usr/local/include/svl /usr/local/doc
done.
installing into /usr/local/lib /usr/local/include
chmod: lib/*: No such file or directory
make: [install-libs] Error 1 (ignored)
cp: lib/*: No such file or directory
make: [install-libs] Error 1 (ignored)
done.

Could this pose a problem?

Thanks
Was This Post Helpful? 0
  • +
  • -

#8 stayscrisp  Icon User is offline

  • フカユ
  • member icon

Reputation: 998
  • View blog
  • Posts: 4,173
  • Joined: 14-February 08

Re: Using SVL with OpenGL and SDL Mac

Posted 15 November 2010 - 10:48 AM

Do you have to use SVL? As it seems like there may be easier libraries to link with Xcode.

I used this library when starting out graphics programming on Xcode.

This post has been edited by stayscrisp: 15 November 2010 - 10:49 AM

Was This Post Helpful? 0
  • +
  • -

#9 Oler1s  Icon User is offline

  • D.I.C Lover
  • member icon

Reputation: 1395
  • View blog
  • Posts: 3,884
  • Joined: 04-June 09

Re: Using SVL with OpenGL and SDL Mac

Posted 15 November 2010 - 12:33 PM

Before typing 'make install', did you type in 'make' by itself first? There's nothing to install if you haven't built the library yet...
Was This Post Helpful? 0
  • +
  • -

#10 Tom9729  Icon User is offline

  • Segmentation fault
  • member icon

Reputation: 180
  • View blog
  • Posts: 2,641
  • Joined: 30-December 07

Re: Using SVL with OpenGL and SDL Mac

Posted 15 November 2010 - 02:47 PM

  • Simply including a header file shouldn't cause link errors.
  • SVL looks to be a C++ library, but you sound like you are using C. If you are trying to use a C compiler (GCC) to compile C++ code (eg. the SVL header) then that may be your problem right there...

Was This Post Helpful? 0
  • +
  • -

#11 Tom9729  Icon User is offline

  • Segmentation fault
  • member icon

Reputation: 180
  • View blog
  • Posts: 2,641
  • Joined: 30-December 07

Re: Using SVL with OpenGL and SDL Mac

Posted 15 November 2010 - 02:55 PM

I'm trying to build the SVL 1.5 tarball from http://www.cs.cmu.ed...jw/public/dist/ on x86_64 Snow Leopard.

tom@katana% tar xvf ~/Desktop/svl-1.5.tar.gz                    (~/src) 04:47 P

x svl-1.5/Makefile
x svl-1.5/README
x svl-1.5/LICENSE
x svl-1.5/include/
x svl-1.5/include/svl/
x svl-1.5/include/svl/Vec.h
x svl-1.5/include/svl/Vec2.h
x svl-1.5/include/svl/Vec3.h
x svl-1.5/include/svl/Vec4.h
x svl-1.5/include/svl/Mat.h
x svl-1.5/include/svl/Mat2.h
x svl-1.5/include/svl/Mat3.h
x svl-1.5/include/svl/Mat4.h
x svl-1.5/include/svl/Transform.h
x svl-1.5/include/svl/Constants.h
x svl-1.5/include/svl/Utils.h
x svl-1.5/include/svl/Basics.h
x svl-1.5/include/svl/SVL.h
x svl-1.5/include/svl/SVLgl.h
x svl-1.5/src/
x svl-1.5/src/LibSVL.cpp
x svl-1.5/src/Makefile
x svl-1.5/src/Basics.cpp
x svl-1.5/src/Vec.cpp
x svl-1.5/src/Vec2.cpp
x svl-1.5/src/Vec3.cpp
x svl-1.5/src/Vec4.cpp
x svl-1.5/src/Mat.cpp
x svl-1.5/src/Mat2.cpp
x svl-1.5/src/Mat3.cpp
x svl-1.5/src/Mat4.cpp
x svl-1.5/src/SVLConfigBase.h
x svl-1.5/doc/
x svl-1.5/doc/svl.html
x svl-1.5/makefiles/
x svl-1.5/makefiles/lib.mf
x svl-1.5/makefiles/prog.mf
x svl-1.5/makefiles/svl.mf
x svl-1.5/makefiles/config-OSX.mf
x svl-1.5/makefiles/config-alpha.mf
x svl-1.5/makefiles/config-linux_RH.mf
x svl-1.5/makefiles/config-sgi-n32.mf
x svl-1.5/makefiles/config-sgi-n64.mf
x svl-1.5/makefiles/config-sgi-o32.mf
x svl-1.5/makefiles/config-solaris-gcc.mf
x svl-1.5/makefiles/config-sunos-gcc.mf
x svl-1.5/packages/
x svl-1.5/packages/svl.spec
x svl-1.5/test/Makefile
x svl-1.5/test/out.ref
x svl-1.5/test/SVLTest.cpp
x svl-1.5/lib/
tom@katana% ls                                                  (~/src) 04:48 P

confuse-2.7     jpeg-8b         libvorbis-1.3.1 untitled.h
emacs-23.2      libogg-1.2.0    otp_src_R14A    untitled.m
freetype-2.3.12 libpng-1.4.3    svl-1.5
tom@katana% cd svl-1.5                                          (~/src) 04:48 P

tom@katana% ls                                          (~/src/svl-1.5) 04:48 P

LICENSE   README    include   makefiles src
Makefile  doc       lib       packages  test
tom@katana% make                                        (~/src/svl-1.5) 04:48 P

=== System Configuration ===
Select one of the following systems, and then run 'make <system>'.

	OSX
	alpha
	linux_RH
	sgi-n32
	sgi-n64
	sgi-o32
	solaris-gcc
	sunos-gcc

After this is done, you can edit makefiles/config.mf to change
compiler settings and paths. If you change the build flags, you
must run 'make config' to update the headers.
make: *** [makefiles/config.mf] Error 1
tom@katana% make OSX                                    (~/src/svl-1.5) 04:48 P

cp ./makefiles/config-OSX.mf ./makefiles/config.mf
make config
make config -f makefiles/svl.mf
Generating config file
configured for Mac OSX
tom@katana% make                                        (~/src/svl-1.5) 04:48 P

cd src && make REACTOR=..
c++  -O2   \
			-c LibSVL.cpp -I../include -I/sw/include
c++  -O2   \
			-c Basics.cpp -I../include -I/sw/include
ar rcu libsvl.a LibSVL.o Basics.o
mkdir -p ../lib
mv libsvl.a ../lib
c++ -DDEBUG  -g  \
			-DVL_DEBUG \
			-c LibSVL.cpp -o LibSVL.do -I../include -I/sw/include
In file included from LibSVL.cpp:32:
Mat.cpp: In function ‘Mat inv(const Mat&, Real*, Real)’:
Mat.cpp:623: error: call of overloaded ‘abs(Real&)’ is ambiguous
/usr/include/stdlib.h:146: note: candidates are: int abs(int)
../include/svl/Utils.h:44: note:                 Float abs(Float)
../include/svl/Utils.h:47: note:                 Double abs(Double)
/usr/include/c++/4.2.1/cmath:97: note:                 long double std::abs(long double)
/usr/include/c++/4.2.1/cmath:93: note:                 float std::abs(float)
/usr/include/c++/4.2.1/cmath:89: note:                 double std::abs(double)
/usr/include/c++/4.2.1/cstdlib:174: note:                 long long int __gnu_cxx::abs(long long int)
/usr/include/c++/4.2.1/cstdlib:143: note:                 long int std::abs(long int)
make[1]: *** [LibSVL.do] Error 1
make: *** [all] Error 2




Commenting out line 623 in Mat.cpp (the source of the error), I can get it to build...

om@katana% make                                        (~/src/svl-1.5) 04:48 P

cd src && make REACTOR=..
ar rcu libsvl.a LibSVL.o Basics.o
mkdir -p ../lib
mv libsvl.a ../lib
c++ -DDEBUG  -g  \
			-DVL_DEBUG \
			-c LibSVL.cpp -o LibSVL.do -I../include -I/sw/include
c++ -DDEBUG  -g  \
			-DVL_DEBUG \
			-c Basics.cpp -o Basics.do -I../include -I/sw/include
ar rcu libsvl.dbg.a LibSVL.do Basics.do
mkdir -p ../lib
mv libsvl.dbg.a ../lib



The test appears to work. I don't want to actually install it on my system, but make install should probably work if you get this far. :)
Was This Post Helpful? 0
  • +
  • -

#12 Ferguzz  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 19
  • Joined: 09-November 10

Re: Using SVL with OpenGL and SDL Mac

Posted 16 November 2010 - 05:24 AM

View PostOler1s, on 15 November 2010 - 11:33 AM, said:

Before typing 'make install', did you type in 'make' by itself first? There's nothing to install if you haven't built the library yet...



Yes I ran 'make OSX' before running 'make install' and got this output:

Tom-Myers-MacBook-Pro:svl-1.5 2 Tom$ make OSX
cp ./makefiles/config-OSX.mf ./makefiles/config.mf
make config
make config -f makefiles/svl.mf
Generating config file
configured for Mac OSX


no problems there.
Was This Post Helpful? 0
  • +
  • -

#13 Ferguzz  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 19
  • Joined: 09-November 10

Re: Using SVL with OpenGL and SDL Mac

Posted 16 November 2010 - 05:45 AM

I'm pretty sure I've installed svl correctly now. There are two .a files in the install directory along with the headers and a config file. When I include the linker flags, i get the following warnings:

Ld build/COMP3004.build/Debug/COMP3004.build/Objects-normal/ppc/COMP3004 normal ppc
cd /Developer/Projects/COMP3004
/Developer/usr/bin/gcc-4.0 -arch ppc -L/Developer/Projects/COMP3004/build/Debug -L/usr/local/include -F/Developer/Projects/COMP3004/build/Debug -F/Library/Frameworks -filelist /Developer/Projects/COMP3004/build/COMP3004.build/Debug/COMP3004.build/Objects-normal/ppc/COMP3004.LinkFileList -lsvl.dbg -lsvl -framework SDL -framework Cocoa -framework OpenGL -o /Developer/Projects/COMP3004/build/COMP3004.build/Debug/COMP3004.build/Objects-normal/ppc/COMP3004

ld: warning: in /usr/local/lib/libsvl.dbg.a, file was built for unsupported file format which is not the architecture being linked (ppc)
ld: warning: in /usr/local/lib/libsvl.a, file was built for unsupported file format which is not the architecture being linked (ppc)


Ld build/COMP3004.build/Debug/COMP3004.build/Objects-normal/i386/COMP3004 normal i386
cd /Developer/Projects/COMP3004
/Developer/usr/bin/gcc-4.0 -arch i386 -L/Developer/Projects/COMP3004/build/Debug -L/usr/local/include -F/Developer/Projects/COMP3004/build/Debug -F/Library/Frameworks -filelist /Developer/Projects/COMP3004/build/COMP3004.build/Debug/COMP3004.build/Objects-normal/i386/COMP3004.LinkFileList -lsvl.dbg -lsvl -framework SDL -framework Cocoa -framework OpenGL -o /Developer/Projects/COMP3004/build/COMP3004.build/Debug/COMP3004.build/Objects-normal/i386/COMP3004

ld: warning: in /usr/local/lib/libsvl.dbg.a, file was built for unsupported file format which is not the architecture being linked (i386)
ld: warning: in /usr/local/lib/libsvl.a, file was built for unsupported file format which is not the architecture being linked (i386)

And as soon as I #include svl/SVL.h I get all the errors.


Quote

SVL looks to be a C++ library, but you sound like you are using C. If you are trying to use a C compiler (GCC) to compile C++ code (eg. the SVL header) then that may be your problem right there...


If this is the problem how can I resolve it?

Thanks
Was This Post Helpful? 0
  • +
  • -

#14 Tom9729  Icon User is offline

  • Segmentation fault
  • member icon

Reputation: 180
  • View blog
  • Posts: 2,641
  • Joined: 30-December 07

Re: Using SVL with OpenGL and SDL Mac

Posted 16 November 2010 - 10:19 AM

View PostFerguzz, on 16 November 2010 - 07:45 AM, said:

Quote

SVL looks to be a C++ library, but you sound like you are using C. If you are trying to use a C compiler (GCC) to compile C++ code (eg. the SVL header) then that may be your problem right there...


If this is the problem how can I resolve it?

Thanks

I'm not too familiar with Xcode but try including the header file inside a C++ file instead of a C file.
Was This Post Helpful? 1
  • +
  • -

Page 1 of 1