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

Author Topic: Cmake Probelms SFML 2 MinGW  (Read 12948 times)

0 Members and 1 Guest are viewing this topic.

Fierce_Dutch

  • Full Member
  • ***
  • Posts: 138
    • View Profile
Cmake Probelms SFML 2 MinGW
« on: January 22, 2011, 08:08:28 pm »
Update: I got the makefile thing fixed but now I am having trouble with compiling.
Here are some of my errors.
Code: [Select]
Linking console executable: bin\Debug\GL_TestArea.exe
C:\Program Files (x86)\CodeBlocks\MinGW\lib/libsfml-graphics-s-d.a(RenderWindow.cpp.obj):RenderWindow.cpp:(.text+0x51): undefined reference to `_Unwind_Resume'
C:\Program Files (x86)\CodeBlocks\MinGW\lib/libsfml-graphics-s-d.a(RenderWindow.cpp.obj):RenderWindow.cpp:(.text+0xf3): undefined reference to `_Unwind_Resume'
C:\Program Files (x86)\CodeBlocks\MinGW\lib/libsfml-graphics-s-d.a(RenderWindow.cpp.obj):RenderWindow.cpp:(.text+0x17a): undefined reference to `_Unwind_Resume'
C:\Program Files (x86)\CodeBlocks\MinGW\lib/libsfml-graphics-s-d.a(RenderWindow.cpp.obj):RenderWindow.cpp:(.text+0x1e8): undefined reference to `_Unwind_Resume'
C:\Program Files (x86)\CodeBlocks\MinGW\lib/libsfml-graphics-s-d.a(RenderWindow.cpp.obj):RenderWindow.cpp:(.eh_frame+0x12): undefined reference to `__gxx_personality_v0'
c:/program files (x86)/codeblocks/mingw/bin/../lib/gcc/mingw32/4.4.1/../../../../mingw32/bin/ld.exe: Dwarf Error: Offset (11020) greater than or equal to (null) size (4954657).
C:\Program Files (x86)\CodeBlocks\MinGW\lib/libsfml-graphics-s-d.a(Image.cpp.obj):Image.cpp:(.text+0x87): undefined reference to `_Unwind_Resume'
c:/program files (x86)/codeblocks/mingw/bin/../lib/gcc/mingw32/4.4.1/../../../../mingw32/bin/ld.exe: Dwarf Error: found dwarf version '0', this reader only handles version 2 and 3 information.
C:\Program Files (x86)\CodeBlocks\MinGW\lib/libsfml-graphics-s-d.a(Image.cpp.obj):Image.cpp:(.text+0x170): undefined reference to `_Unwind_Resume'
c:/program files (x86)/codeblocks/mingw/bin/../lib/gcc/mingw32/4.4.1/../../../../mingw32/bin/ld.exe: Dwarf Error: found dwarf version '20039', this reader only handles version 2 and 3 information.
C:\Program Files (x86)\CodeBlocks\MinGW\lib/libsfml-graphics-s-d.a(Image.cpp.obj):Image.cpp:(.text+0x259): undefined reference to `_Unwind_Resume'
c:/program files (x86)/codeblocks/mingw/bin/../lib/gcc/mingw32/4.4.1/../../../../mingw32/bin/ld.exe: Dwarf Error: found dwarf version '11075', this reader only handles version 2 and 3 information.
C:\Program Files (x86)\CodeBlocks\MinGW\lib/libsfml-graphics-s-d.a(Image.cpp.obj):Image.cpp:(.text+0x2fb): undefined reference to `_Unwind_Resume'
c:/program files (x86)/codeblocks/mingw/bin/../lib/gcc/mingw32/4.4.1/../../../../mingw32/bin/ld.exe: Dwarf Error: found dwarf version '11828', this reader only handles version 2 and 3 information.
C:\Program Files (x86)\CodeBlocks\MinGW\lib/libsfml-graphics-s-d.a(Image.cpp.obj):Image.cpp:(.text+0x3a4): undefined reference to `_Unwind_Resume'
 






















Previous stuff to help others that i figured out down here...

UPDATE:
Tried using vc++ libs but only got errors like this.
undefined reference to `sf::RenderWindow::~RenderWindow()'
So how do I use a makefile?


Update:
I made makefiles but I can't figure out how to compile them..
I tried a codeblocks makefile and when opened in CB nothing happened either. It said
 'make.exe -s -f Makefile all' in 'C:\SFML\Build\CodeBlocks' failed.

Update:
I installed mingw.
I went into cmd and typed this: set PATH=%PATH%;C:\MinGW\bin cmake
Then I went back to cmake and it said. Missing libgmp-10.dll.




Original Post:

Ok well I have the latest source from the svn and I tried opening it up in cmake and setting the files the mingw make files. And then it gave me this:






Here are my errors:
Code: [Select]

CMake Error: CMake was unable to find a build program corresponding to "MinGW Makefiles".  CMAKE_MAKE_PROGRAM is not set.  You probably need to select a different build tool.
CMake Error: CMake was unable to find a build program corresponding to "MinGW Makefiles".  CMAKE_MAKE_PROGRAM is not set.  You probably need to select a different build tool.
CMake Error: Error required internal CMake variable not set, cmake may be not be built correctly.
Missing variable is:
CMAKE_C_COMPILER_ENV_VAR
CMake Error: Error required internal CMake variable not set, cmake may be not be built correctly.
Missing variable is:
CMAKE_C_COMPILER
CMake Error: Could not find cmake module file:C:/SFML/Build/CodeBlocks/CMakeFiles/CMakeCCompiler.cmake
CMake Error: Error required internal CMake variable not set, cmake may be not be built correctly.
Missing variable is:
CMAKE_CXX_COMPILER_ENV_VAR
CMake Error: Error required internal CMake variable not set, cmake may be not be built correctly.
Missing variable is:
CMAKE_CXX_COMPILER
CMake Error: Could not find cmake module file:C:/SFML/Build/CodeBlocks/CMakeFiles/CMakeCXXCompiler.cmake
CMake Error: CMAKE_C_COMPILER not set, after EnableLanguage
CMake Error: CMAKE_CXX_COMPILER not set, after EnableLanguage
Configuring incomplete, errors occurred!



Also that shell script thing i dont understand! IDK what to do about it. I think that is my problem.

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
Cmake Probelms SFML 2 MinGW
« Reply #1 on: January 23, 2011, 11:02:25 am »
Your post is hard to follow and very confusing. Can you please make it clearer according to what you updated and fixed?
Laurent Gomila - SFML developer

Fierce_Dutch

  • Full Member
  • ***
  • Posts: 138
    • View Profile
Cmake Probelms SFML 2 MinGW
« Reply #2 on: January 23, 2011, 04:31:07 pm »
Quote from: "Laurent"
Your post is hard to follow and very confusing. Can you please make it clearer according to what you updated and fixed?


Just read from the top to the errors. That is my current problem and the other stuff I thought I would leave their to help other people with my problem figure it out.

I compiled the libraries for codeblocks, chose the directory for them, they are static, i included the include directory, defined SFML_STATIC, and then defined stuff like this in other linker optoins:

-lsfml-graphics-s-d
etc.

But then i try to compile and it doesnt work, and it worked in vc++

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
Cmake Probelms SFML 2 MinGW
« Reply #3 on: January 23, 2011, 06:49:21 pm »
This is weird, it looks like you're compiling your application and SFML with two different versions of gcc. Do you have several versions installed?
Laurent Gomila - SFML developer

Fierce_Dutch

  • Full Member
  • ***
  • Posts: 138
    • View Profile
Cmake Probelms SFML 2 MinGW
« Reply #4 on: January 23, 2011, 07:40:19 pm »
Quote from: "Laurent"
This is weird, it looks like you're compiling your application and SFML with two different versions of gcc. Do you have several versions installed?


Well I have a dual boot of linux and I have cygwin and mingw..
But i kinda have to keep both.. I use cygwin for hacking and mingw for codeblocks..

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
Cmake Probelms SFML 2 MinGW
« Reply #5 on: January 23, 2011, 09:32:32 pm »
Ok so just make sure that you use the same for both your application and SFML.

The safest way is to put none of them in the global PATH, and add one locally before compiling something. So that there's no compiler available by default, and you're sure that you use the one that you explicitely put in the PATH.
Laurent Gomila - SFML developer

Fierce_Dutch

  • Full Member
  • ***
  • Posts: 138
    • View Profile
Cmake Probelms SFML 2 MinGW
« Reply #6 on: January 23, 2011, 11:35:25 pm »
Quote from: "Laurent"
Ok so just make sure that you use the same for both your application and SFML.

The safest way is to put none of them in the global PATH, and add one locally before compiling something. So that there's no compiler available by default, and you're sure that you use the one that you explicitely put in the PATH.


How do I chose which one to use with sfml? I made a mingw makefile.. Then compiled ti in cmd with mingw32-make and then put it in my cb folder.

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
Cmake Probelms SFML 2 MinGW
« Reply #7 on: January 24, 2011, 07:41:19 am »
Code: [Select]
set PATH=%PATH%;my\chosen\mingw\bin
mingw32-make blah blah...

If you have no MinGW path in your PATH environment variable, you make sure that direct calls like this
Code: [Select]
mingw32-make blah blah...
will produce an error ("mingw32-make is not a program"), and thus you're sure that the first command above will use the version of MinGW located under my\chosen\mingw.
Laurent Gomila - SFML developer

Fierce_Dutch

  • Full Member
  • ***
  • Posts: 138
    • View Profile
Cmake Probelms SFML 2 MinGW
« Reply #8 on: January 24, 2011, 08:18:55 am »
Quote from: "Laurent"
Code: [Select]
set PATH=%PATH%;my\chosen\mingw\bin
mingw32-make blah blah...

If you have no MinGW path in your PATH environment variable, you make sure that direct calls like this
Code: [Select]
mingw32-make blah blah...
will produce an error ("mingw32-make is not a program"), and thus you're sure that the first command above will use the version of MinGW located under my\chosen\mingw.


Ok I have MinGW installed with CodeBlocks and I have it seperate.
I made sfml like this.
set PATH=%PATH%;C:\MinGW\bin (enter)
mingw32-make (my make files folder)

Everything build fine. But when I go into codeblocks I don't see mingw compiler. I know it uses gcc but which one? there are like 4.. SO I just use gnu-gcc.

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
Cmake Probelms SFML 2 MinGW
« Reply #9 on: January 24, 2011, 08:25:37 am »
In Code::Blocks you can go to the compiler options and see the path of the gcc it's using.
Laurent Gomila - SFML developer

Fierce_Dutch

  • Full Member
  • ***
  • Posts: 138
    • View Profile
Cmake Probelms SFML 2 MinGW
« Reply #10 on: January 24, 2011, 08:33:06 am »
Quote from: "Laurent"
In Code::Blocks you can go to the compiler options and see the path of the gcc it's using.


Ok So I think I got the compiler somewhat working because it build half my project then get's here and freaks out...

Errors:
Code: [Select]
C:\Users\Owner\Documents\CodeBlocks\GL_TestArea\src\/TextureManager.h: In member function 'GLuint Texture::GetTexture(std::string)':
C:\Users\Owner\Documents\CodeBlocks\GL_TestArea\src\/TextureManager.h:48:1: warning: control reaches end of non-void function
Linking console executable: bin\Debug\GL_TestArea.exe
c:/mingw/bin/../lib/gcc/mingw32/4.5.2/../../../crt2.o:crt1.c:(.text+0x28): undefined reference to `__dyn_tls_init_callback'
obj\Debug\src\Rect3D.o: In function `Rect3D':
C:/Users/Owner/Documents/CodeBlocks/GL_TestArea/src/Rect3D.cpp:3: undefined reference to `__gxx_personality_sj0'
C:/Users/Owner/Documents/CodeBlocks/GL_TestArea/src/Rect3D.cpp:3: undefined reference to `_Unwind_SjLj_Register'
C:/Users/Owner/Documents/CodeBlocks/GL_TestArea/src/Rect3D.cpp:25: undefined reference to `_Unwind_SjLj_Unregister'
C:/Users/Owner/Documents/CodeBlocks/GL_TestArea/src/Rect3D.cpp:26: undefined reference to `_Unwind_SjLj_Resume'
C:/Users/Owner/Documents/CodeBlocks/GL_TestArea/src/Rect3D.cpp:3: undefined reference to `__gxx_personality_sj0'
C:/Users/Owner/Documents/CodeBlocks/GL_TestArea/src/Rect3D.cpp:3: undefined reference to `_Unwind_SjLj_Register'
C:/Users/Owner/Documents/CodeBlocks/GL_TestArea/src/Rect3D.cpp:25: undefined reference to `_Unwind_SjLj_Unregister'
C:/Users/Owner/Documents/CodeBlocks/GL_TestArea/src/Rect3D.cpp:26: undefined reference to `_Unwind_SjLj_Resume'
C:/Users/Owner/Documents/CodeBlocks/GL_TestArea/src/Rect3D.cpp:31: undefined reference to `__gxx_personality_sj0'
C:/Users/Owner/Documents/CodeBlocks/GL_TestArea/src/Rect3D.cpp:31: undefined reference to `_Unwind_SjLj_Register'
C:/Users/Owner/Documents/CodeBlocks/GL_TestArea/src/Rect3D.cpp:54: undefined reference to `_Unwind_SjLj_Unregister'
C:/Users/Owner/Documents/CodeBlocks/GL_TestArea/src/Rect3D.cpp:55: undefined reference to `_Unwind_SjLj_Resume'
C:/Users/Owner/Documents/CodeBlocks/GL_TestArea/src/Rect3D.cpp:31: undefined reference to `__gxx_personality_sj0'
C:/Users/Owner/Documents/CodeBlocks/GL_TestArea/src/Rect3D.cpp:31: undefined reference to `_Unwind_SjLj_Register'
C:/Users/Owner/Documents/CodeBlocks/GL_TestArea/src/Rect3D.cpp:54: undefined reference to `_Unwind_SjLj_Unregister'
C:/Users/Owner/Documents/CodeBlocks/GL_TestArea/src/Rect3D.cpp:55: undefined reference to `_Unwind_SjLj_Resume'
C:/Users/Owner/Documents/CodeBlocks/GL_TestArea/src/Rect3D.cpp:64: undefined reference to `__gxx_personality_sj0'
C:/Users/Owner/Documents/CodeBlocks/GL_TestArea/src/Rect3D.cpp:64: undefined reference to `_Unwind_SjLj_Register'
C:/Users/Owner/Documents/CodeBlocks/GL_TestArea/src/Rect3D.cpp:88: undefined reference to `_Unwind_SjLj_Unregister'
C:/Users/Owner/Documents/CodeBlocks/GL_TestArea/src/Rect3D.cpp:89: undefined reference to `_Unwind_SjLj_Resume'
C:/Users/Owner/Documents/CodeBlocks/GL_TestArea/src/Rect3D.cpp:64: undefined reference to `__gxx_personality_sj0'
C:/Users/Owner/Documents/CodeBlocks/GL_TestArea/src/Rect3D.cpp:64: undefined reference to `_Unwind_SjLj_Register'
C:/Users/Owner/Documents/CodeBlocks/GL_TestArea/src/Rect3D.cpp:88: undefined reference to `_Unwind_SjLj_Unregister'
C:/Users/Owner/Documents/CodeBlocks/GL_TestArea/src/Rect3D.cpp:89: undefined reference to `_Unwind_SjLj_Resume'
obj\Debug\src\Rect3D.o:C:/Users/Owner/Documents/CodeBlocks/GL_TestArea/src/Rect3D.cpp:223: undefined reference to `__gxx_personality_sj0'
obj\Debug\src\Rect3D.o:C:/Users/Owner/Documents/CodeBlocks/GL_TestArea/src/Rect3D.cpp:223: undefined reference to `_Unwind_SjLj_Register'
obj\Debug\src\Rect3D.o:C:/Users/Owner/Documents/CodeBlocks/GL_TestArea/src/Rect3D.cpp:243: undefined reference to `_Unwind_SjLj_Resume'
obj\Debug\src\Rect3D.o:C:/Users/Owner/Documents/CodeBlocks/GL_TestArea/src/Rect3D.cpp:256: undefined reference to `_Unwind_SjLj_Resume'
obj\Debug\src\Rect3D.o:C:/Users/Owner/Documents/CodeBlocks/GL_TestArea/src/Rect3D.cpp:269: undefined reference to `_Unwind_SjLj_Resume'
obj\Debug\src\Rect3D.o:C:/Users/Owner/Documents/CodeBlocks/GL_TestArea/src/Rect3D.cpp:282: undefined reference to `_Unwind_SjLj_Resume'
obj\Debug\src\Rect3D.o:C:/Users/Owner/Documents/CodeBlocks/GL_TestArea/src/Rect3D.cpp:295: undefined reference to `_Unwind_SjLj_Resume'
obj\Debug\src\Rect3D.o:C:/Users/Owner/Documents/CodeBlocks/GL_TestArea/src/Rect3D.cpp:308: undefined reference to `_Unwind_SjLj_Unregister'
obj\Debug\src\Rect3D.o:C:/Users/Owner/Documents/CodeBlocks/GL_TestArea/src/Rect3D.cpp:308: undefined reference to `_Unwind_SjLj_Resume'
obj\Debug\src\Rect3D.o: In function `~Rect3D':
C:/Users/Owner/Documents/CodeBlocks/GL_TestArea/src/Rect3D.cpp:377: undefined reference to `__gxx_personality_sj0'
C:/Users/Owner/Documents/CodeBlocks/GL_TestArea/src/Rect3D.cpp:377: undefined reference to `_Unwind_SjLj_Register'
C:/Users/Owner/Documents/CodeBlocks/GL_TestArea/src/Rect3D.cpp:386: undefined reference to `_Unwind_SjLj_Unregister'
C:/Users/Owner/Documents/CodeBlocks/GL_TestArea/src/Rect3D.cpp:386: undefined reference to `_Unwind_SjLj_Resume'
C:/Users/Owner/Documents/CodeBlocks/GL_TestArea/src/Rect3D.cpp:377: undefined reference to `__gxx_personality_sj0'
C:/Users/Owner/Documents/CodeBlocks/GL_TestArea/src/Rect3D.cpp:377: undefined reference to `_Unwind_SjLj_Register'
C:/Users/Owner/Documents/CodeBlocks/GL_TestArea/src/Rect3D.cpp:386: undefined reference to `_Unwind_SjLj_Unregister'
C:/Users/Owner/Documents/CodeBlocks/GL_TestArea/src/Rect3D.cpp:386: undefined reference to `_Unwind_SjLj_Resume'
collect2: ld returned 1 exit status
Process terminated with status 1 (0 minutes, 5 seconds)
42 errors, 1 warnings
 

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
Cmake Probelms SFML 2 MinGW
« Reply #11 on: January 24, 2011, 09:22:25 am »
This is still the same problem.
Laurent Gomila - SFML developer

Fierce_Dutch

  • Full Member
  • ***
  • Posts: 138
    • View Profile
Cmake Probelms SFML 2 MinGW
« Reply #12 on: January 24, 2011, 03:11:51 pm »
Quote from: "Laurent"
This is still the same problem.


What? But like half of it compiled...

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
Cmake Probelms SFML 2 MinGW
« Reply #13 on: January 24, 2011, 03:33:25 pm »
In fact everything compiled, but nothing linked (these are two separate steps).
Laurent Gomila - SFML developer

Fierce_Dutch

  • Full Member
  • ***
  • Posts: 138
    • View Profile
Cmake Probelms SFML 2 MinGW
« Reply #14 on: January 24, 2011, 03:45:35 pm »
Quote from: "Laurent"
In fact everything compiled, but nothing linked (these are two separate steps).


Oh ok!! So what do I need to do? Sorry I thought I fixed it..