Welcome, Guest. Please login or register. Did you miss your activation email?

Show Posts

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.


Messages - joshua1984

Pages: [1]
1
General / Re: Static linking, getting undefined references
« on: July 20, 2013, 01:40:32 am »
gcc version 4.4.1 (TDM-2 mingw32)
There's your problem... 4.4.1 is not binary compatible with the nightly builds... either upgrade your MinGW or build SFML yourself.


Done. Now the circle is not drawing and the process is terminating with an error -(10737...ect)

2
General / Re: Static linking, getting undefined references
« on: July 19, 2013, 06:38:58 pm »
Microsoft Windows [Version 6.1.7601]
Copyright (c) 2009 Microsoft Corporation.  All rights reserved.

C:\Users\Owner>mingw32-gcc -v
Using built-in specs.
Target: mingw32
Configured with: ../../gcc-4.4.1/configure --prefix=/mingw --build=mingw32 --ena
ble-languages=c,ada,c++,fortran,objc,obj-c++ --disable-nls --disable-win32-regis
try --enable-libgomp --enable-cxx-flags='-fno-function-sections -fno-data-sectio
ns' --disable-werror --enable-threads --disable-symvers --enable-version-specifi
c-runtime-libs --enable-fully-dynamic-string --with-pkgversion='TDM-2 mingw32' -
-enable-sjlj-exceptions --with-bugurl=http://www.tdragon.net/recentgcc/bugs.php
Thread model: win32
gcc version 4.4.1 (TDM-2 mingw32)


3
Feature requests / Re: Virtual Destructors?
« on: July 19, 2013, 02:55:32 am »
Quote
It makes a lot more sense to inherit from a Texture than to "contain" it and then duplicate its entire API. Seriously, the destructors should just be virtual. How much of a performance hit could it possibly be? And this is not trying to anticipate every possible situation--it's trying to anticipate the most basic, common of requirements.
If you inherit from sf::Texture, then you have to keep the derived type in order to use the extra functions, which means that there's no polymorphism and no issue with the destructor.

But anyway, this is really not the right design. Look at some other popular C++ libraries, can you find one where all the destructors are virtual?

Theres a reason we use sfml over other libraries ;)

4
General / Re: Static linking, getting undefined references
« on: July 19, 2013, 02:42:23 am »
I know. I tried it once again. Still got those chkstk_ms errors

5
General / Re: Static linking, getting undefined references
« on: July 19, 2013, 02:27:37 am »
Posix 32 bit, TDM GCC 4.7.1 and GCC 4.7.2 And im using the compiler that came with C::B

6
General / Re: Static linking, getting undefined references
« on: July 19, 2013, 01:58:56 am »
Just tried the nightly build. Still got chkstk_ms undef

7
General / Re: Static linking, getting undefined references
« on: July 19, 2013, 01:38:06 am »
I switched them out. Now im getting like 100 undefined refs to __chkstk_ms :(

8
General / Re: Static linking, getting undefined references
« on: July 19, 2013, 01:14:26 am »
I got them from here: http://www.sfml-dev.org/download/sfml/2.0/ and I downloaded the one that said GCC 4.7 TDM (SJLJ) - 64 bits

9
General / Re: Static linking, getting undefined references
« on: July 19, 2013, 01:01:24 am »
It's not the order, it was correct. Have you defined SFML_STATIC?

Can you post the exact linker errors?

Yeah Sure. Ill also post the code im running just to be sure.

Here is the code:
#include <SFML/Graphics.hpp>
#include <SFML/Window.hpp>


int main()
{
    sf::RenderWindow window(sf::VideoMode(500,500),"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();
}
 

Errors:
obj\Debug\main.o||In function `main':|
C:\Users\Owner\Documents\New folder\SFML2Template\main.cpp|7|undefined reference to `sf::String::String(char const*, std::locale const&)'
|
C:\Users\Owner\Documents\New folder\SFML2Template\main.cpp|7|undefined reference to `sf::VideoMode::VideoMode(unsigned int, unsigned int, unsigned int)'|
C:\Users\Owner\Documents\New folder\SFML2Template\main.cpp|7|undefined reference to `sf::RenderWindow::RenderWindow(sf::VideoMode, sf::String const&, unsigned int, sf::ContextSettings const&)'
|
C:\Users\Owner\Documents\New folder\SFML2Template\main.cpp|8|undefined reference to `sf::CircleShape::CircleShape(float, unsigned int)'|
C:\Users\Owner\Documents\New folder\SFML2Template\main.cpp|7|undefined reference to `sf::RenderWindow::~RenderWindow()'
|
C:\Users\Owner\Documents\New folder\SFML2Template\main.cpp|9|undefined reference to `sf::Color::Green'|
C:\Users\Owner\Documents\New folder\SFML2Template\main.cpp|9|undefined reference to `sf::Shape::setFillColor(sf::Color const&)'
|
C:\Users\Owner\Documents\New folder\SFML2Template\main.cpp|19|undefined reference to `sf::Window::close()'|
C:\Users\Owner\Documents\New folder\SFML2Template\main.cpp|15|undefined reference to `sf::Window::pollEvent(sf::Event&)'
|
C:\Users\Owner\Documents\New folder\SFML2Template\main.cpp|11|undefined reference to `sf::Window::isOpen() const'|
C:\Users\Owner\Documents\New folder\SFML2Template\main.cpp|22|undefined reference to `sf::Color::Color(unsigned char, unsigned char, unsigned char, unsigned char)'
|
C:\Users\Owner\Documents\New folder\SFML2Template\main.cpp|22|undefined reference to `sf::RenderTarget::clear(sf::Color const&)'|
C:\Users\Owner\Documents\New folder\SFML2Template\main.cpp|23|undefined reference to `sf::RenderStates::Default'
|
C:\Users\Owner\Documents\New folder\SFML2Template\main.cpp|23|undefined reference to `sf::RenderTarget::draw(sf::Drawable const&, sf::RenderStates const&)'|
C:\Users\Owner\Documents\New folder\SFML2Template\main.cpp|24|undefined reference to `sf::Window::display()'
|
C:\Users\Owner\Documents\New folder\SFML2Template\main.cpp|24|undefined reference to `sf::RenderWindow::~RenderWindow()'|
C:\Users\Owner\Documents\New folder\SFML2Template\main.cpp|24|undefined reference to `sf::RenderWindow::~RenderWindow()'
|
obj\Debug\main.o||In function `~CircleShape':|
C:\Users\Owner\Documents\New folder\SFML2Template\..\..\..\Desktop\SFML-2.0\include\SFML\Graphics\CircleShape.hpp|42|undefined reference to `vtable for sf::CircleShape'
|
C:\Users\Owner\Documents\New folder\SFML2Template\..\..\..\Desktop\SFML-2.0\include\SFML\Graphics\CircleShape.hpp|42|undefined reference to `vtable for sf::CircleShape'|
C:\Users\Owner\Documents\New folder\SFML2Template\..\..\..\Desktop\SFML-2.0\include\SFML\Graphics\CircleShape.hpp|42|undefined reference to `sf::Shape::~Shape()'
|
||=== Build finished: 20 errors, 0 warnings ===|
 

I'm no beginner to C++, but I've just always had problems with libs for some reason and im almost positive that it's something fairly simple that I probably overlooked. And Yes I did define SFML_STATIC. I really appreciate you having the patience to help me :P

10
General / Re: Static linking, getting undefined references
« on: July 19, 2013, 12:27:47 am »
I reversed the order, still didn't solve my problem

11
General / Re: Writing Good Code
« on: July 18, 2013, 11:32:18 pm »


I love bucky! His videos got me started in programming after I quit c++ for a while(because I had spent days and days trying everything in my power to understand pointers, but alas at the time nothing would click) and decided to learn java. After I started joining some professional communities like stackoverflow and started talking to people who actually knew what they were doing I realized that thenewboston really didn't understand java, and a lot of things weren't clicking to me because he skipped the difficult pieces without telling me why he wrote certain methods, also some of his java is fairly outdated and outright incorrect for example: He often overrode paint in top level containers, which is a BIG nono in java. Also I hope you weren't trying to learn c++ from cplusplus.com, there are some fairly outdated and overcomplicated examples on that site, mostly when it comes to pointers and dynamic allocation.

I think you should pick up a good book on the Basics of C++, after you've got the basics down and have a good understanding of the basic things to do and not to do start using the internet. You can learn how to do pretty much anything coding related through google. Let me ask you a question though:
Why are you wanting to learn C++? From the context of your questions it doesn't sound like you are a CS or CE major(perhaps I am incorrect). I'm going to give you a common list of reasons people want to learn programming and some things you can do that will keep you interested in the language. I've always hated reading, but loved the knowledge gained from reading, I'm slightly ADHD so focusing long enough to read books has always been a struggle for me, but I am self disciplined so when it comes to school I force myself.


1)A lot of people just want to learn how computers work.
Try learning some general Windows API(If you're running on windows) and than after you've got some of that stuff down try learning assembly, through learning assembly you really gain a deep insight on how things work.

2)Game Development
You're pretty much in the right place for that. Look through the tutorials, come up with your own ideas, learn how to use this library, also still consider learning how SFML operates as it could be valuable if you ever decide to write your own game engine or work with other libraries/languages. Also if you want to learn how to hack online games(Hacking as in gaining an unfair advantage, not as in Cracking passwords and such) learning some assembly/disassembly and WinApi would definitely help(Consider Reading up on Dll injection).

Let me note: Learning Windows Application Programming Interface is not practical for leisure programming in most cases. It's rewarding to learn but with all the libraries like SFML  and such one could argue that its unnecessary for writing general purpose applications.

3) Artificial Intelligence
Consider watching some College lectures on youtube when it comes to this. These people know what theyre talking about 80% of the time and you can really learn a lot(I know its not the most exciting way to learn something so amazing)

MSDN is pretty much the documentation for winapi most questions you have can be answered by reading the documentation.

12
General / Re: Static linking, getting undefined references
« on: July 18, 2013, 10:21:57 pm »
The search directory is valid an a relative path for sfml lib. I'm trying to link SFML statically

Debug:
sfml-graphics-s-d
sfml-window-s-d
sfml-system-s-d

Release
sfml-graphics-s
sfml-window-s
sfml-system-s

13
General / Static linking, getting undefined references
« on: July 18, 2013, 09:58:49 pm »
I'm getting undefined references to practically everything I typed. Im using MinGW an im pretty sure it doesn't have to do with the linker because my IDE is making suggestions on functions. I've followed the tutorial to a tee and im still getting undefined references to sf::String, sf::VideoMode, RenderWindow, ect. What am I doing wrong??

Pages: [1]
anything