|
This thread is locked; no one can reply to it. |
1
2
|
compiling FLAC |
Matthew Leverton
Supreme Loser
January 1999
|
Don't hijack other people's threads with your own questions. Don't try to compile Allegro if you already have a binary. William Labbett said: I changed libFLAC.a to libFLAC.dll.a (ie changed the name of the file) and CMake doesn't give that warning so maybe it'll be ok now. I'm recompiling and we'll see if it works. You shouldn't rename it. Anyway, I don't think that warning really matters. I believe it's telling you that Allegro will not enable dynamic linking for FLAC, which means it will be compiled directly into the module and not be an optional DLL. But why are you even trying to compile Allegro? What's wrong with the binaries? Compiling everything on Windows is a pain in the butt. |
William Labbett
Member #4,486
March 2004
|
I guess I'm doing it because I want to learn a bit about compiling libraries, but I think from here on, I'll take your sensible suggestion.
|
AMCerasoli
Member #11,955
May 2010
|
I have the same reason that Willima have... I want to learn... and I already mange to compile Allegro on Windows. I thought that was some error there because the ex_acodec_multi, ex_audio_props, ex_audio_simple examples didn't work... But neither does with the Binaries... Compiling on Windows isn't difficult, the problem is there is not enough information, and that is what I'm trying to do... I already know how to create the Dynamic libraries, but to complete my manual I have to be able to Link statically Allegro... I am almost there... The problem is that I can't understand where to put all those Switches for source files and Switches for linker... I don't know if Michał Cichoń did it on purpose, but wrote twice: Switches for source files ..... Switches for linker: ..... Switches for executable: nothing was here. Switches for source files: ..... Switches for linker: ..... The new manual from wiseguy is very cool... He talks about how to do the static linking but using Visual Studio 2008...
|
Michał Cichoń
Member #11,736
March 2010
|
There you go. Nice and fresh build of libFLAC. This is exactly same library which I use to build Allegro. Note about compiling foreign libraries: I hope this will help. "God starts from scratch too" |
William Labbett
Member #4,486
March 2004
|
AMCERASOLI said: I thought that was some error there because the ex_acodec_multi, ex_audio_props, ex_audio_simple examples didn't work... But neither does with the Binaries... I had a feeling that would be the case. What are we going to do ?
|
Michał Cichoń
Member #11,736
March 2010
|
AMCERASOLI said: I am almost there... The problem is that I can't understand where to put all those Switches for source files and Switches for linker... I don't know if Michał Cichoń did it on purpose, but wrote twice: Switches for source files nothing was here. Switches for source files: First set of switches are for compiling library. Switches after "Switches for executable:" are for executables which you want to link the library. "God starts from scratch too" |
AMCerasoli
Member #11,955
May 2010
|
William Labbett said: I had a feeling that would be the case. What are we going to do ? Well... So far I have learned how to use allegro with the binaries, compiling it, and what is left is learn how to do the static linking... What are we going to do, is not so clear now... But what you want to do is to compile Allegro statically right? Let me ask Cichón this... Michal Cichon: said: First set of switches are for compiling library. Switches after "Switches for executable:" are for executables which you want to link the library. First of all, I apologize for my extreme ignorance... But where do I have to put those switches? What I could found was this, in CodeBlock. {"name":"find.gif","src":"\/\/djungxnpq2nug.cloudfront.net\/image\/cache\/0\/4\/040ff25555a87ef2be9d6cb6dde7acf3.gif","w":782,"h":963,"tn":"\/\/djungxnpq2nug.cloudfront.net\/image\/cache\/0\/4\/040ff25555a87ef2be9d6cb6dde7acf3"} I put it there, but I got this error... ||=== Trivium, Debug ===| ld.exe||cannot find -libstdc++| ||=== Build finished: 1 errors, 0 warnings ===| But... if I remove "-libstdc++" I get this... {"name":"find3.gif","src":"\/\/djungxnpq2nug.cloudfront.net\/image\/cache\/7\/b\/7b4e2d27516101597ffbc2c635021545.gif","w":987,"h":463,"tn":"\/\/djungxnpq2nug.cloudfront.net\/image\/cache\/7\/b\/7b4e2d27516101597ffbc2c635021545"} I'm doing this... 1#define ALLEGRO_STATICLINK //WOOOOW
2#include "allegro5/allegro.h"
3#include "allegro5/allegro_font.h"
4#include "allegro5/allegro_ttf.h"
5#include "allegro5/allegro_image.h"
6#include <allegro5/allegro_primitives.h>
I also found this... But I don't know how to use it... {"name":"find2.gif","src":"\/\/djungxnpq2nug.cloudfront.net\/image\/cache\/1\/0\/101c74ad55d2e9230fa3c12a16e67443.gif","w":780,"h":407,"tn":"\/\/djungxnpq2nug.cloudfront.net\/image\/cache\/1\/0\/101c74ad55d2e9230fa3c12a16e67443"}
|
Michał Cichoń
Member #11,736
March 2010
|
'-static-libstdc++' is the parameter, you have split after '-static'. Also link those libraries too: gdiplus uuid kernel32 winmm psapi opengl32 glu32 user32 comdlg32 gdi32 shell32 ole32 advapi32 ws2_32 Please keep in mind. Order of libraries does have matter. "God starts from scratch too" |
AMCerasoli
Member #11,955
May 2010
|
Do I have to link them manually???? They are almost all in the System32 Folder... But I couldn't find "uuid.dll" I just could find uuid.h inside the include folder of MinGW.... I'm getting this... {"name":"find4.gif","src":"\/\/djungxnpq2nug.cloudfront.net\/image\/cache\/3\/b\/3b69ff698f8df309aac1fa40b41e861e.gif","w":1414,"h":789,"tn":"\/\/djungxnpq2nug.cloudfront.net\/image\/cache\/3\/b\/3b69ff698f8df309aac1fa40b41e861e"} I link all the libraries manually.... Like I did with the Allegro Static MT libraries... and fix the problem you told me ('-static-libstdc++' )
|
Thomas Fjellstrom
Member #476
June 2000
|
AMCERASOLI said: Do I have to link them manually???? You do if you link everything statically. -- |
AMCerasoli
Member #11,955
May 2010
|
Thomas Fjellstrom said: You do if you link everything statically. Hmmm... Interesting I'm collecting quite good info with this ... But I still getting that error... C:\allegro\addons\image\gdiplus.cpp|444|multiple definition of `_al_shutdown_gdiplus'| What does that mean? C:\MinGW\addons\image\CMakeFiles\allegro_image.dir\gdiplus.cpp.obj||In function `al_shutdown_gdiplus':| C:\allegro\addons\image\gdiplus.cpp|444|multiple definition of `_al_shutdown_gdiplus'| C:\allegro5\lib\liballegro_image-5.0.0-RC4-static-mt.a(gdiplus.o):gdiplus.cpp|| first defined here| C:\MinGW\addons\image\CMakeFiles\allegro_image.dir\gdiplus.cpp.obj||In function `al_load_gdiplus_bitmap_f':| C:\allegro\addons\image\gdiplus.cpp|220|multiple definition of `_al_load_gdiplus_bitmap_f'| C:\allegro5\lib\liballegro_image-5.0.0-RC4-static-mt.a(gdiplus.o):gdiplus.cpp|| first defined here| C:\MinGW\addons\image\CMakeFiles\allegro_image.dir\gdiplus.cpp.obj||In function `al_load_gdiplus_bitmap':| C:\allegro\addons\image\gdiplus.cpp|300|multiple definition of `_al_load_gdiplus_bitmap'| C:\allegro5\lib\liballegro_image-5.0.0-RC4-static-mt.a(gdiplus.o):gdiplus.cpp|| first defined here| C:\MinGW\addons\image\CMakeFiles\allegro_image.dir\gdiplus.cpp.obj||In function `Z25_al_save_gdiplus_bitmap_fP12ALLEGRO_FILEPKcP14ALLEGRO_BITMAP':| C:\allegro\addons\image\gdiplus.cpp|315|multiple definition of `_al_save_gdiplus_bitmap_f(ALLEGRO_FILE*, char const*, ALLEGRO_BITMAP*)'| C:\allegro5\lib\liballegro_image-5.0.0-RC4-static-mt.a(gdiplus.o):gdiplus.cpp|| first defined here| C:\MinGW\addons\image\CMakeFiles\allegro_image.dir\gdiplus.cpp.obj||In function `al_save_gdiplus_bitmap':| C:\allegro\addons\image\gdiplus.cpp|392|multiple definition of `_al_save_gdiplus_bitmap'| C:\allegro5\lib\liballegro_image-5.0.0-RC4-static-mt.a(gdiplus.o):gdiplus.cpp|| first defined here| C:\MinGW\addons\image\CMakeFiles\allegro_image.dir\gdiplus.cpp.obj||In function `al_save_gdiplus_png_f':| C:\allegro\addons\image\gdiplus.cpp|410|multiple definition of `_al_save_gdiplus_png_f'| C:\allegro5\lib\liballegro_image-5.0.0-RC4-static-mt.a(gdiplus.o):gdiplus.cpp|| first defined here| C:\MinGW\addons\image\CMakeFiles\allegro_image.dir\gdiplus.cpp.obj||In function `al_save_gdiplus_jpg_f':| C:\allegro\addons\image\gdiplus.cpp|415|multiple definition of `_al_save_gdiplus_jpg_f'| C:\allegro5\lib\liballegro_image-5.0.0-RC4-static-mt.a(gdiplus.o):gdiplus.cpp|| first defined here| C:\MinGW\addons\image\CMakeFiles\allegro_image.dir\gdiplus.cpp.obj||In function `al_save_gdiplus_tif_f':| C:\allegro\addons\image\gdiplus.cpp|420|multiple definition of `_al_save_gdiplus_tif_f'| C:\allegro5\lib\liballegro_image-5.0.0-RC4-static-mt.a(gdiplus.o):gdiplus.cpp|| first defined here| C:\MinGW\addons\image\CMakeFiles\allegro_image.dir\gdiplus.cpp.obj||In function `al_save_gdiplus_gif_f':| C:\allegro\addons\image\gdiplus.cpp|425|multiple definition of `_al_save_gdiplus_gif_f'| C:\allegro5\lib\liballegro_image-5.0.0-RC4-static-mt.a(gdiplus.o):gdiplus.cpp|| first defined here| C:\MinGW\addons\image\CMakeFiles\allegro_image.dir\gdiplus.cpp.obj||In function `al_init_gdiplus':| C:\allegro\addons\image\gdiplus.cpp|430|multiple definition of `_al_init_gdiplus'| C:\allegro5\lib\liballegro_image-5.0.0-RC4-static-mt.a(gdiplus.o):gdiplus.cpp|| first defined here| ||Warning: resolving _GetModuleFileNameExA@16 by linking to _GetModuleFileNameExA| ||Warning: resolving _timeEndPeriod@4 by linking to _timeEndPeriod| ||Warning: resolving _timeBeginPeriod@4 by linking to _timeBeginPeriod| ||Warning: resolving _timeGetTime@0 by linking to _timeGetTime| ||Warning: resolving _SwapBuffers@4 by linking to _SwapBuffers| ||Warning: resolving _glFlush@0 by linking to _glFlush| ||Warning: resolving _wglMakeCurrent@8 by linking to _wglMakeCurrent| ||Warning: resolving _wglGetCurrentContext@0 by linking to _wglGetCurrentContext| ||Warning: resolving _glViewport@16 by linking to _glViewport| ||Warning: resolving _glMatrixMode@4 by linking to _glMatrixMode| ||Warning: resolving _glLoadIdentity@0 by linking to _glLoadIdentity| ||Warning: resolving _glOrtho@48 by linking to _glOrtho| ||Warning: resolving _wglDeleteContext@4 by linking to _wglDeleteContext| ||Warning: resolving _wglGetCurrentDC@0 by linking to _wglGetCurrentDC| ||Warning: resolving _ChoosePixelFormat@8 by linking to _ChoosePixelFormat| ||Warning: resolving _DescribePixelFormat@16 by linking to _DescribePixelFormat| ||Warning: resolving _SetPixelFormat@12 by linking to _SetPixelFormat| ||Warning: resolving _wglCreateContext@4 by linking to _wglCreateContext| ||Warning: resolving _glGetString@4 by linking to _glGetString| ||Warning: resolving _wglGetProcAddress@4 by linking to _wglGetProcAddress| ||Warning: resolving _CreateRectRgn@16 by linking to _CreateRectRgn| ||Warning: resolving _GetRegionData@12 by linking to _GetRegionData| ||Warning: resolving _DeleteObject@4 by linking to _DeleteObject| ||Warning: resolving _StretchDIBits@52 by linking to _StretchDIBits| ||Warning: resolving _CreateCompatibleDC@4 by linking to _CreateCompatibleDC| ||Warning: resolving _CreateBitmap@20 by linking to _CreateBitmap| ||Warning: resolving _CreateCompatibleBitmap@12 by linking to _CreateCompatibleBitmap| ||Warning: resolving _SelectObject@8 by linking to _SelectObject| ||Warning: resolving _SetPixel@16 by linking to _SetPixel| ||Warning: resolving _DeleteDC@4 by linking to _DeleteDC| ||Warning: resolving _glGetIntegerv@8 by linking to _glGetIntegerv| ||Warning: resolving _glEnable@4 by linking to _glEnable| ||Warning: resolving _glScissor@16 by linking to _glScissor| ||Warning: resolving _glDisable@4 by linking to _glDisable| ||Warning: resolving _glPushClientAttrib@4 by linking to _glPushClientAttrib| ||Warning: resolving _glPixelStorei@8 by linking to _glPixelStorei| ||Warning: resolving _glGetError@0 by linking to _glGetError| ||Warning: resolving _glBindTexture@8 by linking to _glBindTexture| ||Warning: resolving _glTexSubImage2D@36 by linking to _glTexSubImage2D| ||Warning: resolving _glPopClientAttrib@0 by linking to _glPopClientAttrib| ||Warning: resolving _glDrawPixels@20 by linking to _glDrawPixels| ||Warning: resolving _glPixelTransferi@8 by linking to _glPixelTransferi| ||Warning: resolving _glPushMatrix@0 by linking to _glPushMatrix| ||Warning: resolving _glRasterPos2f@8 by linking to _glRasterPos2f| ||Warning: resolving _glPopMatrix@0 by linking to _glPopMatrix| ||Warning: resolving _glGetTexImage@20 by linking to _glGetTexImage| ||Warning: resolving _glReadPixels@28 by linking to _glReadPixels| ||Warning: resolving _glDeleteTextures@8 by linking to _glDeleteTextures| ||Warning: resolving _glTexImage2D@36 by linking to _glTexImage2D| ||Warning: resolving _glTexParameteri@12 by linking to _glTexParameteri| ||Warning: resolving _glGenTextures@8 by linking to _glGenTextures| ||Warning: resolving _glCopyTexSubImage2D@32 by linking to _glCopyTexSubImage2D| ||Warning: resolving _glBlendFunc@8 by linking to _glBlendFunc| ||Warning: resolving _glTranslatef@12 by linking to _glTranslatef| ||Warning: resolving _glMultMatrixf@4 by linking to _glMultMatrixf| ||Warning: resolving _glLoadMatrixf@4 by linking to _glLoadMatrixf| ||Warning: resolving _glGetBooleanv@8 by linking to _glGetBooleanv| ||Warning: resolving _glEnableClientState@4 by linking to _glEnableClientState| ||Warning: resolving _glVertexPointer@16 by linking to _glVertexPointer| ||Warning: resolving _glTexCoordPointer@16 by linking to _glTexCoordPointer| ||Warning: resolving _glColorPointer@16 by linking to _glColorPointer| ||Warning: resolving _glDrawArrays@12 by linking to _glDrawArrays| ||Warning: resolving _glDisableClientState@4 by linking to _glDisableClientState| ||Warning: resolving _glClearColor@16 by linking to _glClearColor| ||Warning: resolving _glClear@4 by linking to _glClear| ||Warning: resolving _CoInitialize@4 by linking to _CoInitialize| ||Warning: resolving _CoUninitialize@0 by linking to _CoUninitialize| ||Warning: resolving _GdipFree@4 by linking to _GdipFree| ||Warning: resolving _GdipDeleteCustomLineCap@4 by linking to _GdipDeleteCustomLineCap| ||Warning: resolving _GdipDeleteCachedBitmap@4 by linking to _GdipDeleteCachedBitmap| ||Warning: resolving _GdipDeletePrivateFontCollection@4 by linking to _GdipDeletePrivateFontCollection| ||Warning: resolving _GdipCloneImage@8 by linking to _GdipCloneImage| ||Warning: resolving _GdipAlloc@4 by linking to _GdipAlloc| ||Warning: resolving _GdipDisposeImage@4 by linking to _GdipDisposeImage| ||Warning: resolving _GdiplusShutdown@4 by linking to _GdiplusShutdown| ||Warning: resolving _GdipGetImageEncodersSize@8 by linking to _GdipGetImageEncodersSize| ||Warning: resolving _GdipGetImageEncoders@12 by linking to _GdipGetImageEncoders| ||Warning: resolving _GdipCreateBitmapFromStream@8 by linking to _GdipCreateBitmapFromStream| ||Warning: resolving _GdipGetImageWidth@8 by linking to _GdipGetImageWidth| ||Warning: resolving _GdipGetImageHeight@8 by linking to _GdipGetImageHeight| ||Warning: resolving _GdipBitmapLockBits@20 by linking to _GdipBitmapLockBits| ||Warning: resolving _GdipBitmapUnlockBits@8 by linking to _GdipBitmapUnlockBits| ||Warning: resolving _GdipCreateBitmapFromScan0@24 by linking to _GdipCreateBitmapFromScan0| ||Warning: resolving _GdipSaveImageToStream@16 by linking to _GdipSaveImageToStream| ||Warning: resolving _GdiplusStartup@12 by linking to _GdiplusStartup| ||Warning: resolving _waveInStop@4 by linking to _waveInStop| ||Warning: resolving _waveInStart@4 by linking to _waveInStart| ||Warning: resolving _waveInReset@4 by linking to _waveInReset| ||Warning: resolving _waveInUnprepareHeader@12 by linking to _waveInUnprepareHeader| ||Warning: resolving _waveInClose@4 by linking to _waveInClose| ||Warning: resolving _waveInGetNumDevs@0 by linking to _waveInGetNumDevs| ||Warning: resolving _waveInGetDevCapsA@12 by linking to _waveInGetDevCapsA| ||Warning: resolving _waveInOpen@24 by linking to _waveInOpen| ||Warning: resolving _waveInPrepareHeader@12 by linking to _waveInPrepareHeader| ||Warning: resolving _waveInAddBuffer@12 by linking to _waveInAddBuffer| C:\allegro5\lib\liballegro_image-5.0.0-RC4-static-mt.a(gdiplus.o):gdiplus.cpp:(.text$_ZN20AllegroWindowsStream14QueryInterfaceERK5_GUIDPPv+0x10)||undefined reference to `IID_IUnknown'| C:\allegro5\lib\liballegro_image-5.0.0-RC4-static-mt.a(gdiplus.o):gdiplus.cpp:(.text$_ZN20AllegroWindowsStream14QueryInterfaceERK5_GUIDPPv+0x3d)||undefined reference to `IID_ISequentialStream'| C:\allegro5\lib\liballegro_image-5.0.0-RC4-static-mt.a(gdiplus.o):gdiplus.cpp:(.text$_ZN20AllegroWindowsStream14QueryInterfaceERK5_GUIDPPv+0x4d)||undefined reference to `IID_IStream'| C:\MinGW\CMakeFiles\OpenAL32.dir\Alc\winmm.obj||In function `WinMMOpenCapture':| C:\openal\Alc\winmm.c|243|undefined reference to `alcSetError'| C:\MinGW\CMakeFiles\OpenAL32.dir\Alc\winmm.obj||In function `CaptureThreadProc@4':| C:\openal\Alc\winmm.c|136|undefined reference to `SuspendContext'| C:\openal\Alc\winmm.c|175|undefined reference to `ProcessContext'| C:\MinGW\CMakeFiles\OpenAL32.dir\Alc\winmm.obj||In function `alcWinMMProbe':| C:\openal\Alc\winmm.c|493|undefined reference to `AppendCaptureDeviceList'| C:\MinGW\CMakeFiles\OpenAL32.dir\Alc\winmm.obj||In function `WinMMCaptureSamples':| C:\openal\Alc\winmm.c|414|undefined reference to `alcSetError'| ||=== Build finished: 28 errors, 95 warnings ===|
|
Michał Cichoń
Member #11,736
March 2010
|
liballegro_image-5.0.0-RC4-static-mt.a is a library from pre-build binaries. Remove it from linking. Why? Because you build you own version, right? You will probably have to do same thing with rest of 5.0.0-RC4 libs. "God starts from scratch too" |
AMCerasoli
Member #11,955
May 2010
|
Yes but I'm using the pre-build binaries to stay away from errors... My plan is to learn how to statically link Allegro with the pre-build one and then try with my own static libraries.... Since actually I am not completely sure if my compilation of allegro works 100%, I'm using the pre-build ones that I know that works 100%... I used the binaries of my compilation and works fine... But to stay away from errors I'm doing that... There is no problem right?
|
William Labbett
Member #4,486
March 2004
|
AMCERASOLI said: But what you want to do is to compile Allegro statically right? What I think I want is to have a set of examples that work as intended by any means possible. With the statically linked version, can't you just set an option in CMake ?
|
Michał Cichoń
Member #11,736
March 2010
|
You cannot link your executable both with your version and pre-build binaries at once. Use one version at the time and switch between. "God starts from scratch too" |
Thomas Fjellstrom
Member #476
June 2000
|
Indeed, why would you not expect to get a multiple definition error if you link to the same libs twice? -- |
AMCerasoli
Member #11,955
May 2010
|
William Labbett said: What I think I want is to have a set of examples that work as intended by any means possible. Well, all my examples works except those of audio... even the demo works (with audio)... I don't know what is happening with those examples... maybe it's a problem of those examples I don't know... But the rest of examples works right??? Michał Cichoń said: You cannot link your executable both with your version and pre-build binaries at once. Use one version at the time and switch between. I'm doing that???? I didn't know.... Lets see, I'm going to reinstall everything... I'm going to use just the Pre-build binaries at first time...
|
Thomas Fjellstrom
Member #476
June 2000
|
AMCERASOLI said: I'm doing that???? I didn't know.... The monolith lib contains ALL of the allegro addon libs, and many of its dependencies, all balled up into one single library. If you also link to other allegro addon libs, you'll get duplication errors, since you're linking to some of the same code more than once. -- |
AMCerasoli
Member #11,955
May 2010
|
I DID IT!!!! I DID IT!!! I STATICALLY LINK ALLEGRO ON WINDOWS!!! YHEAAAAAAAA!!!! WOOOOW FINALLY.. About two days on this... Anyway, since I couldn't find the uuid.dll in my PC (Windows Vista) , I searched for it on my Windows XP machine, and found a "libuuid.a" file inside "C:\Program Files\CodeBlocks\MinGW\lib". Which I link to... AND WORKS!!!!! YHEA!!!!! I don't remember why I did install CodeBlock with Mingw if I always use the Mingw installer, but anyway was.... "The destiny" But why couldn't find the uuid.dll file on windows vista???? Isn't a system file???
|
|
1
2
|