1
General / Re: undefined reference to `sf::CircleShape
« on: July 26, 2016, 03:19:36 am »
Did a complete removal and reinstalled and now everything is working just fine. Thanks. How do I mark solved?
This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.
sf::CircleShape is fine taking just a single parameter for its radius. Both parameters have default values so you can leave off both or just the second one (points).
I tested this code you provided and it executes perfectly.
The error you are receiving looks to me like a linker problem. One thing that can cause this error is if the actual libraries that are alongside the executable are not the exact same version as the libraries inluded and linked. This often happens if you get change versions but forget to change the libraries that accompany the executable or change those libraries but forget to update which version you're linking to.
garrett@mint-desktop include $ pwd
/usr/local/include
garrett@mint-desktop include $ ls -lR
.:
total 4
drwxr-xr-x 8 garrett garrett 4096 Jul 23 20:34 SFML
./SFML:
total 60
drwxr-xr-x 2 garrett garrett 4096 Oct 27 2015 Audio
-rwxr-xr-x 1 garrett garrett 2095 May 8 2015 Audio.hpp
-rwxr-xr-x 1 garrett garrett 5342 Sep 11 2015 Config.hpp
drwxr-xr-x 2 garrett garrett 4096 Oct 27 2015 Graphics
-rwxr-xr-x 1 garrett garrett 2530 May 8 2015 Graphics.hpp
-rwxr-xr-x 1 garrett garrett 1521 May 8 2015 Main.hpp
drwxr-xr-x 2 garrett garrett 4096 Oct 27 2015 Network
-rwxr-xr-x 1 garrett garrett 1982 May 8 2015 Network.hpp
-rwxr-xr-x 1 garrett garrett 2252 May 8 2015 OpenGL.hpp
drwxr-xr-x 2 garrett garrett 4096 Jul 23 20:02 SFML
drwxr-xr-x 2 garrett garrett 4096 Oct 27 2015 System
-rwxr-xr-x 1 garrett garrett 2287 May 8 2015 System.hpp
drwxr-xr-x 2 garrett garrett 4096 Oct 27 2015 Window
-rwxr-xr-x 1 garrett garrett 2046 May 8 2015 Window.hpp
./SFML/Audio:
total 160
-rw-r--r-- 1 garrett garrett 2327 May 8 2015 AlResource.hpp
-rw-r--r-- 1 garrett garrett 1662 May 8 2015 Export.hpp
-rw-r--r-- 1 garrett garrett 9318 May 8 2015 InputSoundFile.hpp
-rw-r--r-- 1 garrett garrett 8910 May 8 2015 Listener.hpp
-rw-r--r-- 1 garrett garrett 8232 Jul 6 2015 Music.hpp
-rw-r--r-- 1 garrett garrett 4523 May 8 2015 OutputSoundFile.hpp
-rw-r--r-- 1 garrett garrett 12929 May 8 2015 SoundBuffer.hpp
-rw-r--r-- 1 garrett garrett 4848 May 8 2015 SoundBufferRecorder.hpp
-rw-r--r-- 1 garrett garrett 7190 May 8 2015 SoundFileFactory.hpp
-rw-r--r-- 1 garrett garrett 3154 May 8 2015 SoundFileFactory.inl
-rw-r--r-- 1 garrett garrett 5889 May 8 2015 SoundFileReader.hpp
-rw-r--r-- 1 garrett garrett 4430 May 8 2015 SoundFileWriter.hpp
-rw-r--r-- 1 garrett garrett 9266 May 8 2015 Sound.hpp
-rw-r--r-- 1 garrett garrett 14059 Jul 6 2015 SoundRecorder.hpp
-rw-r--r-- 1 garrett garrett 10387 May 8 2015 SoundSource.hpp
-rw-r--r-- 1 garrett garrett 14785 May 8 2015 SoundStream.hpp
./SFML/Graphics:
total 332
-rw-r--r-- 1 garrett garrett 9700 May 8 2015 BlendMode.hpp
-rw-r--r-- 1 garrett garrett 5344 May 8 2015 CircleShape.hpp
-rw-r--r-- 1 garrett garrett 9789 May 8 2015 Color.hpp
-rw-r--r-- 1 garrett garrett 5391 May 8 2015 ConvexShape.hpp
-rw-r--r-- 1 garrett garrett 3822 May 8 2015 Drawable.hpp
-rw-r--r-- 1 garrett garrett 1680 May 8 2015 Export.hpp
-rw-r--r-- 1 garrett garrett 17082 Sep 11 2015 Font.hpp
-rw-r--r-- 1 garrett garrett 2753 May 8 2015 Glyph.hpp
-rw-r--r-- 1 garrett garrett 12310 May 8 2015 Image.hpp
-rw-r--r-- 1 garrett garrett 2194 May 8 2015 PrimitiveType.hpp
-rw-r--r-- 1 garrett garrett 4465 May 8 2015 RectangleShape.hpp
-rw-r--r-- 1 garrett garrett 8763 May 8 2015 Rect.hpp
-rw-r--r-- 1 garrett garrett 5100 May 8 2015 Rect.inl
-rw-r--r-- 1 garrett garrett 6538 Jul 6 2015 RenderStates.hpp
-rw-r--r-- 1 garrett garrett 17532 May 8 2015 RenderTarget.hpp
-rw-r--r-- 1 garrett garrett 10188 May 8 2015 RenderTexture.hpp
-rw-r--r-- 1 garrett garrett 9637 May 8 2015 RenderWindow.hpp
-rw-r--r-- 1 garrett garrett 26008 Jul 6 2015 Shader.hpp
-rw-r--r-- 1 garrett garrett 13668 May 8 2015 Shape.hpp
-rw-r--r-- 1 garrett garrett 10685 May 8 2015 Sprite.hpp
-rw-r--r-- 1 garrett garrett 13917 May 8 2015 Text.hpp
-rw-r--r-- 1 garrett garrett 24256 Sep 11 2015 Texture.hpp
-rw-r--r-- 1 garrett garrett 16396 May 8 2015 Transformable.hpp
-rw-r--r-- 1 garrett garrett 16047 May 8 2015 Transform.hpp
-rw-r--r-- 1 garrett garrett 7768 May 8 2015 VertexArray.hpp
-rw-r--r-- 1 garrett garrett 5615 May 8 2015 Vertex.hpp
-rw-r--r-- 1 garrett garrett 12285 May 8 2015 View.hpp
./SFML/Network:
total 140
-rw-r--r-- 1 garrett garrett 1674 May 8 2015 Export.hpp
-rw-r--r-- 1 garrett garrett 24912 May 8 2015 Ftp.hpp
-rw-r--r-- 1 garrett garrett 19862 May 8 2015 Http.hpp
-rw-r--r-- 1 garrett garrett 12663 May 8 2015 IpAddress.hpp
-rw-r--r-- 1 garrett garrett 13974 May 8 2015 Packet.hpp
-rw-r--r-- 1 garrett garrett 1773 May 8 2015 SocketHandle.hpp
-rw-r--r-- 1 garrett garrett 7701 May 8 2015 Socket.hpp
-rw-r--r-- 1 garrett garrett 9312 May 8 2015 SocketSelector.hpp
-rw-r--r-- 1 garrett garrett 5366 May 8 2015 TcpListener.hpp
-rw-r--r-- 1 garrett garrett 11300 May 8 2015 TcpSocket.hpp
-rw-r--r-- 1 garrett garrett 10735 May 8 2015 UdpSocket.hpp
./SFML/SFML:
total 0
./SFML/System:
total 244
-rw-r--r-- 1 garrett garrett 3713 May 8 2015 Clock.hpp
-rw-r--r-- 1 garrett garrett 2641 May 8 2015 Err.hpp
-rw-r--r-- 1 garrett garrett 1668 May 8 2015 Export.hpp
-rw-r--r-- 1 garrett garrett 5442 Jul 6 2015 FileInputStream.hpp
-rw-r--r-- 1 garrett garrett 4855 May 8 2015 InputStream.hpp
-rw-r--r-- 1 garrett garrett 4246 May 8 2015 Lock.hpp
-rw-r--r-- 1 garrett garrett 5193 May 8 2015 MemoryInputStream.hpp
-rw-r--r-- 1 garrett garrett 4972 May 8 2015 Mutex.hpp
-rw-r--r-- 1 garrett garrett 4302 May 8 2015 NonCopyable.hpp
-rw-r--r-- 1 garrett garrett 1821 May 8 2015 Sleep.hpp
-rw-r--r-- 1 garrett garrett 25366 May 8 2015 String.hpp
-rw-r--r-- 1 garrett garrett 1785 May 8 2015 String.inl
-rw-r--r-- 1 garrett garrett 9233 May 8 2015 Thread.hpp
-rw-r--r-- 1 garrett garrett 2776 May 8 2015 Thread.inl
-rw-r--r-- 1 garrett garrett 3415 May 8 2015 ThreadLocal.hpp
-rw-r--r-- 1 garrett garrett 5000 May 8 2015 ThreadLocalPtr.hpp
-rw-r--r-- 1 garrett garrett 2210 May 8 2015 ThreadLocalPtr.inl
-rw-r--r-- 1 garrett garrett 16061 May 8 2015 Time.hpp
-rw-r--r-- 1 garrett garrett 35528 May 8 2015 Utf.hpp
-rw-r--r-- 1 garrett garrett 21501 May 8 2015 Utf.inl
-rw-r--r-- 1 garrett garrett 9778 May 8 2015 Vector2.hpp
-rw-r--r-- 1 garrett garrett 4158 May 8 2015 Vector2.inl
-rw-r--r-- 1 garrett garrett 9785 May 8 2015 Vector3.hpp
-rw-r--r-- 1 garrett garrett 4428 May 8 2015 Vector3.inl
./SFML/Window:
total 132
-rw-r--r-- 1 garrett garrett 4982 May 8 2015 Context.hpp
-rw-r--r-- 1 garrett garrett 6293 May 8 2015 ContextSettings.hpp
-rw-r--r-- 1 garrett garrett 13214 May 8 2015 Event.hpp
-rw-r--r-- 1 garrett garrett 1668 May 8 2015 Export.hpp
-rw-r--r-- 1 garrett garrett 2586 May 8 2015 GlResource.hpp
-rw-r--r-- 1 garrett garrett 8608 Jul 6 2015 Joystick.hpp
-rw-r--r-- 1 garrett garrett 8219 May 8 2015 Keyboard.hpp
-rw-r--r-- 1 garrett garrett 6321 May 8 2015 Mouse.hpp
-rw-r--r-- 1 garrett garrett 5820 May 8 2015 Sensor.hpp
-rw-r--r-- 1 garrett garrett 5037 May 8 2015 Touch.hpp
-rw-r--r-- 1 garrett garrett 8690 May 8 2015 VideoMode.hpp
-rw-r--r-- 1 garrett garrett 2368 May 8 2015 WindowHandle.hpp
-rw-r--r-- 1 garrett garrett 23120 May 8 2015 Window.hpp
-rw-r--r-- 1 garrett garrett 1961 May 8 2015 WindowStyle.hpp
garrett@mint-desktop include $
Your switch statement has no brackets ("{...}"). They're not optional for switch().
It's not really odd. In the first code you use the name of the enum in the case statements, which is not how regular enums should be used. While in the seconde code you leave it out.
It should always be sf::Event::KeyPressed, sf::Event::Closed etc
See the tutorial on events.