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 - Mokka

Pages: [1]
1
General / Re: C++ Problem
« on: April 14, 2015, 06:00:25 pm »
Thanks :D

2
General / C++ Problem
« on: April 14, 2015, 05:37:55 pm »
After I fixed my linker problems, I stumbled upon another error.

I wrote a code for a small game and I created like a request if-loop to read out the keyboard inputs (Up, Down, Left, Right), and now, to clean up my code I want to put the loop in a seperate function, or even a seperate header file/class.

But I am not able to succeed :(

First of all: here is my code:

(click to show/hide)

The section //Move-Loop is the part I want to put in a seperate function.

So basically I just have to declare a function with a sf::Sprite as parameter which then represents the sprite that is supposed to get moved...

(click to show/hide)

But that does not work...
I am kinda new to C++ (as you can see :D) but was pretty stable with coding until this point.

So could anyone please help me.
Best with a working solution with outsourced classes (in a header file).


Thank you for your help in advance...

(I don't know if this is the right place to post this stuff. If not please tell me where to put it and I will copy it there and delete this post)

3
General / Re: Undefined reference [Static Linking]
« on: April 14, 2015, 03:10:36 pm »
Got it to work....

I had the dependencies setted wrong.

If anyone should have problems with it, here is a picture of the finished order.
Note: I used the "extlib" included on the github directory.....

Thank you all so much for helping. It is working perfectly for me now :D

CU
Mokka

4
General / Re: Undefined reference [Static Linking]
« on: April 14, 2015, 02:55:31 pm »
Ok....
I moved all the modules to the top...
So sfml-system-s and co. to the top of the list and then the dependencies...

This got rid of the
Quote
C:\SFML-2.2\lib\libsfml-system-s.a(SleepImpl.cpp.obj):SleepImpl.cpp   ||   undefined reference to `_imp__timeGetDevCaps@8'|
C:\SFML-2.2\lib\libsfml-system-s.a(SleepImpl.cpp.obj):SleepImpl.cpp   ||   undefined reference to `_imp__timeBeginPeriod@4'|
C:\SFML-2.2\lib\libsfml-system-s.a(SleepImpl.cpp.obj):SleepImpl.cpp   ||   undefined reference to `_imp__timeEndPeriod@4'|

error, but instead I now have an
Quote
||=== Build: Debug in MTG (compiler: GNU GCC Compiler) ===|
C:\SFML-2.2\lib\libglew.a(glew.c.o):glew.c      ||      undefined reference to `wglGetCurrentDC@0'|
C:\SFML-2.2\lib\libglew.a(glew.c.o):glew.c      ||      undefined reference to `wglGetCurrentDC@0'|
||=== Build failed: 2 error(s), 0 warning(s) (0 minute(s), 0 second(s)) ===|
error...
I'm completely stuck now :(

5
General / Re: AW: Undefined reference [Static Linking]
« on: April 14, 2015, 02:40:38 pm »
Look at the tutorial, the way it's listed there is an order that works.

It usually is if x depends on y then x comes before y.


I understood it. I now moved all the main module (sfml-system-s(-d) and so on) and let the dependencies stay at the top. It changed like nothing...

Quote
||=== Build: Debug in MTG (compiler: GNU GCC Compiler) ===|
)    ||    undefined reference to `wglGetCurrentDC@0'|
C:\SFML-2.2\lib\libglew.a(glew.c.o):glew.c     ||     undefined reference to `wglGetCurrentDC@0'|
C:\SFML-2.2\lib\libsfml-system-s-d.a(SleepImpl.cpp.obj)     ||     In function `ZN2sf4priv9sleepImplENS_4TimeE':|
D:\sfml-release\_Sources\SFML\src\SFML\System\Win32\SleepImpl.cpp|41|    undefined reference to `_imp__timeGetDevCaps@8'|
D:\sfml-release\_Sources\SFML\src\SFML\System\Win32\SleepImpl.cpp|44|    undefined reference to `_imp__timeBeginPeriod@4'|
D:\sfml-release\_Sources\SFML\src\SFML\System\Win32\SleepImpl.cpp|50|    undefined reference to `_imp__timeEndPeriod@4'|
||=== Build failed: 5 error(s), 0 warning(s) (0 minute(s), 0 second(s)) ===|

But I recognised that in the error log there is a file that is located on my D:\\ drive:
Quote
D:\sfml-release\_Sources\SFML\src\SFML\System\Win32\SleepImpl.cpp

But I didn't find the folder/directory. The dir "D:\sfml-release\" is not existent on my PC?!

Is that supposed to happen or am I missing some files?!


Also: Which order it's listed??
The table that lists the needed dependencies?! Because otherwise there is just the dynamic linking shown-

Thanks for the reply ^^

6
General / Re: Undefined reference [Static Linking]
« on: April 14, 2015, 01:59:25 pm »
To me it looks like he declared the libs in a wrong order.

So how is the right linking order. ^^

Thanks for your replies though :D

7
General / [Solved] Undefined reference [Static Linking]
« on: April 13, 2015, 06:57:08 pm »
I fixed it, look down below for my working linking order....


---------------
Hey there

I am using SFML for quite a while now, but just used dynamic linking.

Now I decided to set up static linking.

But every time I try to compile something, I get a few errors...

I think I did set up the project properly...

(click to show/hide)

(click to show/hide)

(click to show/hide)

I also added the "SFML_STATIC" to the #defines...

The code is:
(click to show/hide)

That's the error message:
 
(click to show/hide)

Quote
||=== Build: Debug in MTG (compiler: GNU GCC Compiler) ===|
C:\SFML-2.2\lib\libsfml-system-s-d.a(SleepImpl.cpp.obj)||In function `ZN2sf4priv9sleepImplENS_4TimeE':|
D:\sfml-release\_Sources\SFML\src\SFML\System\Win32\SleepImpl.cpp|41|   undefined reference to `_imp__timeGetDevCaps@8'|
D:\sfml-release\_Sources\SFML\src\SFML\System\Win32\SleepImpl.cpp|44|   undefined reference to `_imp__timeBeginPeriod@4'|
D:\sfml-release\_Sources\SFML\src\SFML\System\Win32\SleepImpl.cpp|50|   undefined reference to `_imp__timeEndPeriod@4'|
C:\SFML-2.2\lib\libglew.a(glew.c.o):glew.c   ||   undefined reference to `wglGetCurrentDC@0'|
C:\SFML-2.2\lib\libglew.a(glew.c.o):glew.c   ||   undefined reference to `wglGetCurrentDC@0'|
||=== Build failed: 5 error(s), 0 warning(s) (0 minute(s), 0 second(s)) ===|



I hope that somebody can help me.

Thanks in advance

Mokka

(Please excuse bad english ^^)

Pages: [1]
anything