| SFML Dynamic link, and possible header bug | |
|
|
Author | Message |
---|
BMCha Guest
| Subject: SFML Dynamic link, and possible header bug Mon Jul 27, 2009 4:09 am | |
| My main question is about the sfml module. I noticed that it is using the dynamic SFML libraries, and as I am using the static libraries, I get an error when I run my program that tells me that it needs the sfml dlls. Could you possibly add a version with static sfml libs? Although with the probable switch to the zlib license I'll be able to link spark statically. Also of note, I have tried including the static libraries, but upon compile I get these errors: - Code:
-
C:\SPARK\lib\mingw\static\libSPARK_SFML.a(SPK_SFMLLineRenderer.o):SPK_SFMLLineRenderer.cpp|| undefined reference to `glLineWidth@4' C:\SPARK\lib\mingw\static\libSPARK_SFML.a(SPK_SFMLLineRenderer.o):SPK_SFMLLineRenderer.cpp|| undefined reference to `glEnableClientState@4' C:\SPARK\lib\mingw\static\libSPARK_SFML.a(SPK_SFMLLineRenderer.o):SPK_SFMLLineRenderer.cpp|| undefined reference to `glEnableClientState@4' C:\SPARK\lib\mingw\static\libSPARK_SFML.a(SPK_SFMLLineRenderer.o):SPK_SFMLLineRenderer.cpp|| undefined reference to `glVertexPointer@16' C:\SPARK\lib\mingw\static\libSPARK_SFML.a(SPK_SFMLLineRenderer.o):SPK_SFMLLineRenderer.cpp|| undefined reference to `glColorPointer@16' C:\SPARK\lib\mingw\static\libSPARK_SFML.a(SPK_SFMLLineRenderer.o):SPK_SFMLLineRenderer.cpp|| undefined reference to `glDrawArrays@12' C:\SPARK\lib\mingw\static\libSPARK_SFML.a(SPK_SFMLLineRenderer.o):SPK_SFMLLineRenderer.cpp|| undefined reference to `glDisableClientState@4' C:\SPARK\lib\mingw\static\libSPARK_SFML.a(SPK_SFMLLineRenderer.o):SPK_SFMLLineRenderer.cpp|| undefined reference to `glDisableClientState@4'
Is there something special I have to do in my project settings (using code::blocks) to be able to use Spark in my project? Now a second problem: When I first tried to compile, there was an error about Particle not being defined in SPK_Buffer.h is it possible that that file is missing includes? I've added an include of SPK_Particle.h and the error is gone. |
|
| |
Darktib Committer
Messages : 389 Date d'inscription : 2009-07-20 Localisation : A coté de Paris
| Subject: Re: SFML Dynamic link, and possible header bug Mon Jul 27, 2009 4:43 am | |
| there is static lib for each project (gl,core and sfml), so i think you could link to these libs. | |
|
| |
BMCha Guest
| Subject: Re: SFML Dynamic link, and possible header bug Mon Jul 27, 2009 5:33 am | |
| Yes, but as I said in the first post, when I compile with those I get "undefined reference" errors. How could this be fixed? |
|
| |
Juff Developer
Messages : 539 Date d'inscription : 2009-07-14 Age : 42
| Subject: Re: SFML Dynamic link, and possible header bug Mon Jul 27, 2009 8:50 am | |
| Hi bMCha, seems like you didnt link to openGL. Those functions that are not defined are openGL functions. you must have those 2 libs in your linker : Regarding the problem of Particle not being defined in SPK_Buffer.h it is my fault. I have uploaded a wrong version of the 1.03.03. Either you redownload it or you only add this line in SPK_Buffer.h : - Code:
-
class Particle; just here : - Code:
-
#ifndef H_SPK_BUFFER #define H_SPK_BUFFER
namespace SPK { class Particle;
//...
Corcening the link static vs dynamic with SFML, I ll check that Hope this helps [EDIT] By the way, if you still got problem tell me. I m not using code blocks it is therefore possible that some projects are not well set up. I will check that this evening. | |
|
| |
BMCha Guest
| Subject: Re: SFML Dynamic link, and possible header bug Mon Jul 27, 2009 2:47 pm | |
| After adding opengl and glut libraries, I only get one error If adding the libraries through the files: - Code:
-
||warning: C:\SFML\SFML-1.5\lib\mingw/libsfml-window-s.a(dspfs00071.o): local symbol `' has no section
But if adding them through text in "other linker options", as sfml is added - Code:
-
C:\MinGW\bin\..\lib\gcc\mingw32\3.4.5\..\..\..\..\mingw32\bin\ld.exe: C:\MinGW\lib/libopengl32.a(Window.o): illegal symbol index 909127729 in relocs collect2: ld returned 1 exit status
|
|
| |
Juff Developer
Messages : 539 Date d'inscription : 2009-07-14 Age : 42
| Subject: Re: SFML Dynamic link, and possible header bug Mon Jul 27, 2009 2:56 pm | |
| What do you mean by "added through the files" ?
BTW, glu32 is not glut. glut is a windowing library for openGL while glu is an official utility library for openGL. You dont need glut here (and I guess glu neither in your case).
Your errors dont seem to have something to do with SPARK here. If you remove all links and include relative to SPARK (but keep the opengl libs), does it compile and link correctly ?
I ll try to get a codeblocks SPARK + SFML example to compile this evening. I ll tell your more about this | |
|
| |
BMCha Guest
| Subject: Re: SFML Dynamic link, and possible header bug Mon Jul 27, 2009 3:26 pm | |
| If I remove all references to SPARK, and keep opengl and glu, my program correctly compiles and links. Also, by "through the files" I meant adding them in the "link libraries" of linker settings, adding the actual .a files. |
|
| |
Juff Developer
Messages : 539 Date d'inscription : 2009-07-14 Age : 42
| Subject: Re: SFML Dynamic link, and possible header bug Mon Jul 27, 2009 3:54 pm | |
| Ok. Ive though of a stuff : Using minGW, the link order is important, so you must link that way (dependent libs first) : - Code:
-
-lSPARK_SFML -lSPARK_GL -lSPARK -lsfml-graphics ...
I have checked and the opengl libs are included within the SFML libs so you dont have to link them normally. Anyway, I ll check when I get home and give you more info about that. We ll get through it | |
|
| |
BMCha Guest
| Subject: Re: SFML Dynamic link, and possible header bug Mon Jul 27, 2009 4:21 pm | |
| I had thought about the order, but I hadn't put sfml's libs into consideration. I've added the spark libs at the top of the linker options in my separate configurations, as in your post, and the compile works. Now to make sure spark is working, thanks for your help with this. |
|
| |
Juff Developer
Messages : 539 Date d'inscription : 2009-07-14 Age : 42
| Subject: Re: SFML Dynamic link, and possible header bug Mon Jul 27, 2009 4:39 pm | |
| Glad to hear that !
If you have other questions, any requests or things to show, dont hesitate to post. Moreover, dont hesitate to register instead of posting as a guest. | |
|
| |
Sponsored content
| Subject: Re: SFML Dynamic link, and possible header bug | |
| |
|
| |
| SFML Dynamic link, and possible header bug | |
|