Crystal Space
Welcome, Guest. Please login or register.
October 23, 2014, 05:55:42 pm

Login with username, password and session length
Search:     Advanced search
9010 Posts in 2044 Topics by 8800 Members
Latest Member: Xxbobo
* Home Help Search Login Register
+  Crystal Space
|-+  Crystal Space Development
| |-+  Support
| | |-+  Linker-error on win32
« previous next »
Pages: [1] Print
Author Topic: Linker-error on win32  (Read 2026 times)
mark
Full Member
***
Posts: 101


View Profile
« on: August 12, 2005, 11:37:19 am »

I can compile, link and run my cs-application on linux but when I try to compile it on windows 2k sp4 MinGW+MSYS, I get the following error:

Code:
g++ -Wl,-rpath=lib -o out\Spheretraveller.exe src\starter\starter2.o src\starter\Runner.o -Lout\lib -Lout\lib\crystalspace -lpython -lcrystalspace -lcrystalspace_opengl -lceltool -lptypes -lsqlite3
out\lib/libcrystalspace.a(win32.o)(.text+0x140b):win32.cpp: undefined reference to `GetStockObject@4'
out\lib/libcrystalspace.a(win32.o)(.text+0x1cc1):win32.cpp: undefined reference to `GetStockObject@4'
collect2: ld returned 1 exit status

I see that CS has additional libs for windows: crystalspace_directx and crystalspace_windows.
Do I really need those libs? I wonder because I only need crystalspace and crystalspace_opengl on linux and when I add "-lcrystalspace_windows -lcrystalspace_directx" to g++, the errormessage stays the same.

What's wrong here?
Logged

Gentoo Linux ~x86, kernel 2.6.11-cko9 smp, gcc 3.4.4-r1, binutils 2.16.1, glibc 2.3.5 NPTL
CS+CEL Pseudo Stable 2005.09.03
jorrit
Administrator
Hero Member
*****
Posts: 1706


View Profile
« Reply #1 on: August 12, 2005, 11:41:01 am »

I can compile, link and run my cs-application on linux but when I try to compile it on windows 2k sp4 MinGW+MSYS, I get the following error:

Code:
g++ -Wl,-rpath=lib -o out\Spheretraveller.exe src\starter\starter2.o src\starter\Runner.o -Lout\lib -Lout\lib\crystalspace -lpython -lcrystalspace -lcrystalspace_opengl -lceltool -lptypes -lsqlite3
out\lib/libcrystalspace.a(win32.o)(.text+0x140b):win32.cpp: undefined reference to `GetStockObject@4'
out\lib/libcrystalspace.a(win32.o)(.text+0x1cc1):win32.cpp: undefined reference to `GetStockObject@4'
collect2: ld returned 1 exit status

I see that CS has additional libs for windows: crystalspace_directx and crystalspace_windows.
Do I really need those libs? I wonder because I only need crystalspace and crystalspace_opengl on linux and when I add "-lcrystalspace_windows -lcrystalspace_directx" to g++, the errormessage stays the same.

What's wrong here?

You need to add -lw32 or -lwin32 or something. i.e. the windows libraries.

Greetings,
Logged
mark
Full Member
***
Posts: 101


View Profile
« Reply #2 on: August 12, 2005, 12:17:00 pm »

ok, I will try that. But I don't need the crystalspace_directx and _windows, right?
Logged

Gentoo Linux ~x86, kernel 2.6.11-cko9 smp, gcc 3.4.4-r1, binutils 2.16.1, glibc 2.3.5 NPTL
CS+CEL Pseudo Stable 2005.09.03
jorrit
Administrator
Hero Member
*****
Posts: 1706


View Profile
« Reply #3 on: August 12, 2005, 12:20:35 pm »

ok, I will try that. But I don't need the crystalspace_directx and _windows, right?

Don't think so.

Greetings,
Logged
mark
Full Member
***
Posts: 101


View Profile
« Reply #4 on: August 12, 2005, 02:17:48 pm »

w32 etc didn't work, but I have found this page:
http://mirrors.zoreil.com/webclub.kcom.ne.jp/ma/colinp/win32/fn2lib/index.html

I have to link against gdi32
Logged

Gentoo Linux ~x86, kernel 2.6.11-cko9 smp, gcc 3.4.4-r1, binutils 2.16.1, glibc 2.3.5 NPTL
CS+CEL Pseudo Stable 2005.09.03
Pages: [1] Print 
« previous next »
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.2 | SMF © 2006-2007, Simple Machines LLC Valid XHTML 1.0! Valid CSS!
Page created in 5.299 seconds with 15 queries.