Hey I'm trying to set up SFML but I get a couple errors:
Editor: Code::blocks
||=== Build: Release in SFML_test (compiler: GNU GCC Compiler) ===|
D:\SFML\lib\lib sfml-graphics-s.a(CircleShape .cpp.obj):Circl eShape.cpp|| undefined reference to `_Unwind_Resume '|
D:\SFML\lib\lib sfml-graphics-s.a(CircleShape .cpp.obj):Circl eShape.cpp:(.te xt$_ZN2sf11Circ leShapeD0Ev[__ZN2sf11Circle ShapeD0Ev]+0x24)||undefin ed reference to `operator delete(void*, unsigned int)'|
||error: ld returned 1 exit status|
||=== Build failed: 3 error(s), 0 warning(s) (0 minute(s), 0 second(s)) ===|
What is causing this?
Thanks in advance :-)
Compiler settings: http://imgur.com/2LFGKrt http://imgur.com/OHbg298 http://imgur.com/7y0oHt3 http://imgur.com/NWcl3Fm -
main.cpp:
-
-
#include <SFML/Graphics.hpp>
-
-
int main()
-
{
-
sf::RenderWindow window(sf::VideoMode(200, 200), "SFML works!");
-
sf::CircleShape shape(100.f);
-
shape.setFillColor(sf::Color::Green);
-
-
while (window.isOpen())
-
{
-
sf::Event event;
-
while (window.pollEvent(event))
-
{
-
if (event.type == sf::Event::Closed)
-
window.close();
-
}
-
-
window.clear();
-
window.draw(shape);
-
window.display();
-
}
-
-
return 0;
-
}
-
-
9 2201
It looks like you may be using a different version of MinGW gcc than SFML was built with. The "undefined reference to `_Unwind_Resume '" linker errors happen when mixing SJLJ and DW2 exception handling methods. Check this page to make sure you get the exact compiler and SFML versions: http://www.sfml-dev.org/download/sfml/2.4.0/
Right below the SFML downloads are links to the MinGW compilers that were used for the libraries. Or you can build SFML from source with your current compiler.
You also may need to add more libraries to the list for a static build. I don't have CodeBlocks, but in Visual Studio 2013 I needed to add opengl32, jpeg, and winmm to the list for your code to build. See this link for others that may be needed when static linking: http://www.sfml-dev.org/tutorials/2.4/start-cb.php
Look for the chart that shows "Modules" and "Dependenci es".
At: http://www.sfml-dev.org/tutorials/2.4/start-cb.php
Under "Installing SFML": it says this:
"If you are unsure, check which of the libgcc_s_sjlj-1.dll or libgcc_s_dw2-1.dll files is present in your MinGW/bin folder. If MinGW was installed along with Code::Blocks, you probably have an SJLJ version. "
This is what I have in MinGW/Bin: http://imgur.com/QV7fz62
If I only should have one version on installation with code::blocks, why do I have 2 versions now? and if I need to delete one, which one should I delete?
I don't know why you have both. I would suggest you download the appropriate version that matches the SFML version you downloaded, and either rename your old MinGW directory to MinGW.backup, or whatever you want, then install the version that matches SFML, or you can install the new MinGW to a directory with a different name, such as MinGW-SFML and configure CodeBlocks to use it instead of the original.
This is a fresh new install of 32-bit gcc minGW via "Install On Demand" via a link from SFML's download site. And guess what I found: http://imgur.com/a/DIYwF
It installed both, and again I got the same errors.
Ok, I confirmed that this version of SFML: SFML 2.4.0 GCC 4.9.2 TDM (SJLJ) - 32-bit
works with the gcc that is installed in CodeBlocks at this link: codeblocks-16.01mingw-setup.exe
When I installed CodeBlocks from that link, I also had both versions of the libraries in the MinGW directory, but as long as I built against the SFML version in the link I provided it worked. I only get the errors you get when trying to use the SFML library at this link: SFML 2.4.0 GCC 6.1.0 MinGW (DW2) - 32-bit
If you want to use this SFML version, you need to download this compiler: MinGW Builds 6.1.0 (32-bit)
You just need to extract it to a directory of your choosing. Then add the compiler to CodeBlocks. Probably the easiest way is to go to Settings->Compiler and copy the original gcc compiler profile, give the copy a new name, and adjust the path and names in the Toolchain Executables tab. For reference, "Make program" mingw32-make.exe doesn't change, but "C compiler" is just gcc.exe, "C++ compiler" is g++.exe and "Linker for dynamic libs" is g++.exe (no mingw- prefix)
You will also need to add opengl32, jpeg, winmm and gdi32 to the linker settings to build the example.
Ok, it ran but it crashes on start: http://imgur.com/a/JAD8T
I added: opengl32, jpeg, winmm and gdi32 at the end of the linker settigs and switchd back to the codeblocks MinGW compiler
Any Ideas?
It works now.
After debugging it said it quit on startup with debugger code 740
After searching the error code up I found it had to do with admin rights. I started Code Blocks with admin rights and it ran beautifully.
Thanks for all the help :-)
You're welcome. I'm not sure why you have to run CodeBlocks with administrator rights, though. Can you run the program by double clicking it from the file explorer in Windows? Just curious.
Yes, I can. No problem at all.
It might be because code blocks needs admin rights to write something to the executable or maybe it is the connection between my program and the debug program managers of code blocks...
I don't know but it works XD
Sign in to post your reply or Sign up for a free account.
Similar topics |
by: Joonas Paalasmaa |
last post by:
Hi,
When compiling Sketch's streamfilter C extension the errors below are
raised during linking. What could cause the errors?
(Python 2.3, MinGw 1.1 with GCC 2.95.3-6, Windows 98)
Here are the occurrences of FilterType that may be relevant:
-------
C:\sketch\sketch-0.7.12\Filter\filterobj.c: 949: PyTypeObject
FilterType = {
|
by: Tore Ferner |
last post by:
Hi,
On linux:
I'm a newbie and want to make build-versions of python 2.1.3 and
it's modules which link against different versions of a library
located in directories not mentioned in /etc/ld.so.conf, e.g.
versions of expat could be:
/opt/expatx
|
by: Mike Zupan |
last post by:
I had some problems with urllib and py2exe under pyton2.3. I works fine
until i try to use the exe file.
Here is the error
Error: 1
LookupError Exception in Tk callback
Function: <bound method MainWindow.selectDir of <__main__.MainWindow
instance
at 0x00DF4058>> (type: <type 'instancemethod'>)
|
by: matthew collins |
last post by:
hi all,
trying to install mysqldb 1.0 and receiving a LOT of errors during the
process.
following the directions of by
export mysqlversion="3.23.58"
export mysqlclient="mysqlclient"
export mysqloptlibs=""
python setup.py build
|
by: Angela |
last post by:
http://support.microsoft.com/default.aspx?scid=KB;EN-
US;Q324906&
>-----Original Message-----
>I'm trying to create a Web SetUp Project for a web
>application my team recently developed.
| |
by: Mike S. Nowostawsky |
last post by:
I am getting this error when I try to run a program in my cgi-bin directory
(don't know what I'm still missing to make it work):
***
Authentication required!
This server could not verify that you are authorized to access the URL
"/~group3/cgi-bin/ack.cgi". You either supplied the wrong credentials (e.g.,
bad password), or your browser doesn't understand how to supply the
credentials required.
|
by: ibm_97 |
last post by:
Hi,
Anyone can give me a link which shows how to setup DB2 (v8) replication
step by step? Thanks.
As a non-DB2 person, I find out IBM DB2 doc is not very helpful at all,
espeically compare with Oracle docs.
Regards,
|
by: n8agrin |
last post by:
I've been doing some level of PHP programming for many years now, and
have in the past few months started implementing lots of the core PHP5
features into a new project, when I noticed some interesting issues
with objects and classes.
I'm having some problems with Object Oriented PHP5, namely when a class
isn't defined correctly no errors are produced during object
instantiation. For example if a method which violates a global...
|
by: priyajohal |
last post by:
#include<fstream.h>
#include<process.h>
#include<stdlib.h>
#include<conio.h>
#include<string.h>
#include<dos.h>
#include<ctype.h>
#include<stdio.h>
void setup()
void help();
|
by: Xillez |
last post by:
Hey I'm trying to implement the SFML graphics library to my Visual Studio 2013. I do everything exactly acording to the SFML website and other youtube tutorials. But I get some symbol errors:
1>------ Build started: Project: MatterAMatter, Configuration: Debug Win32 ------
1>core.obj : error LNK2019: unresolved external symbol "public: __thiscall sf::String::String(char const *,class std::locale const &)"...
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look !
Part I. Meaning of...
| |
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it.
First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
|
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth.
The Art of Business Website Design
Your website is...
|
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own....
Now, this would greatly impact the work of software developers. The idea...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules.
He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms.
Adolph will...
|
by: TSSRALBI |
last post by:
Hello
I'm a network technician in training and I need your help.
I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs.
The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols.
I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
| |
by: 6302768590 |
last post by:
Hai team
i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
|
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
| |