[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Mingw-cross-env-list] Fwd: Re: Compiling OpenCSG

From: René Berber
Subject: [Mingw-cross-env-list] Fwd: Re: Compiling OpenCSG
Date: Wed, 25 May 2011 17:05:39 -0500
User-agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv: Gecko/20081209 Lightning/0.9 Thunderbird/ Mnenhy/

Sorry for using the wrong e-mail address... again.

-------- Original Message --------
Subject: Re: [Mingw-cross-env-list] Compiling OpenCSG
Date: Wed, 25 May 2011 17:03:22 -0500
From: René Berber <address@hidden>
To: address@hidden

On 5/25/2011 Brad Pitcher wrote:

> I had hoped I wouldn't have to resort to asking you all for help on this,
> but I have banged my head against the wall for a while and I am really
> stuck.
> Here are my steps:
> 1. downloaded and uncompressed the tarball
> 2. Enter OpenCSG-1.3.1/src
> 3. run i686-pc-mingw32-qmake
> 4. Edit Makefile.Release:
> - add -DGLEW_STATIC at the beginning of DEFINES definiton
> - add -lglew32s before -lglu32 in the LIBS definition
> 5. run make
> It took me quite a while to figure out what I needed to do to use glew
> statically, but it seems right. Now the build process fails on the last line
> though:
> i686-pc-mingw32-g++ -enable-stdcall-fixup -Wl,-enable-auto-import
> -Wl,-enable-runtime-pseudo-reloc -Wl,-s -mthreads -Wl -o ../lib/opencsg.lib
This ------------------------------------------------------^^^^^^^^^^^^^
is wrong.

g++ doesn't create .lib files, it creates either .a or .dll libraries.

The error you are seeing below just means g++ thinks its building an
executable, so it needs a main().

But the problem is really the .pro file, you don't show it in step 3,
but -qmake takes a .pro file and produces the Makefiles.  The main
problem I see is the .pro file doesn't seem to specify that the target
is a library, not an application (otherwise Qt would just build a
library)...  or you are using things wrong.

To make things clean I also suggest to not edit Makefile.release, all
your changes (those defines and libraries) should be made to the .pro
file, they can be Windows specific, you just have to add a guard.

> object_script.opencsg.Release
> -L'/home/brad/Downloads/mingw-cross-env-2.20/usr/i686-pc-mingw32/lib'
> -lglew32s -lglu32 -lopengl32 -lQtGui -lgdi32 -lcomdlg32 -loleaut32 -limm32
> -lwinmm -lwinspool -ljpeg -lmng -llcms -ltiff -lmsimg32 -lQtCore -lpng
> -lkernel32 -luser32 -lshell32 -luuid -lole32 -ladvapi32 -static-libgcc
> -lws2_32 -lz -Wl,--subsystem,windows
> /home/brad/Downloads/mingw-cross-env-2.20/usr/i686-pc-mingw32/lib/libmingw32.a(main.o):main.c:(.text+0xd2):
> undefined reference to address@hidden'
> Some googling suggested adding -Wl,--subsystem,windows to my args. I tried
> that but it didn't have any effect on the output so that's why you don't see
> it in my instructions. Any ideas what could be causing this? I don't see any
> references to main() or WinMain() anywhere in the opencsg code, so that has
> me pretty confused.

You can link it yourself (actually a static library doesn't even need to
be linked, a dynamic one does), but the best way is to correct the .pro
file (which you didn't make, so you may pass that task to the original

reply via email to

[Prev in Thread] Current Thread [Next in Thread]