project-navigation
Personal tools

Author Topic: Compiling ufo2map.cbp with Code::Blocks, trunk 112079  (Read 9282 times)

Offline smalul

  • Rookie
  • ***
  • Posts: 35
    • View Profile
Compiling ufo2map.cbp with Code::Blocks, trunk 112079
« on: September 28, 2007, 12:34:58 pm »
Based on the answers given in this bug report, it seems like you are planning to abandon the Dev-C++'s file format (.dev), and you're going to focus mainly on Code::Blocks.
I've tried using Code::Blocks, but I'm having a problem compiling ufo2map. The build messages I get:
Code: [Select]
:: === ufo2map, windows ===
C:\development\MinGW\bin\..\lib\gcc\mingw32\3.4.2\..\..\..\crt2.o:crt1.c:(.text+0x16a):: undefined reference to `__cpu_features_init'
:: === Build finished: 1 errors, 0 warnings ===

The build log:
Code: [Select]
-------------- Build: windows in ufo2map ---------------
Compiling: ..\..\src\common\ioapi.c
Compiling: ..\..\src\common\unzip.c
Compiling: ..\..\src\shared\byte.c
Compiling: ..\..\src\shared\shared.c
Compiling: ..\..\src\tools\ufo2map\brushbsp.c
Compiling: ..\..\src\tools\ufo2map\common\bspfile.c
Compiling: ..\..\src\tools\ufo2map\common\cmdlib.c
Compiling: ..\..\src\tools\ufo2map\common\imagelib.c
Compiling: ..\..\src\tools\ufo2map\common\mathlib.c
Compiling: ..\..\src\tools\ufo2map\common\polylib.c
Compiling: ..\..\src\tools\ufo2map\common\scriplib.c
Compiling: ..\..\src\tools\ufo2map\common\trace.c
Compiling: ..\..\src\tools\ufo2map\csg.c
Compiling: ..\..\src\tools\ufo2map\faces.c
Compiling: ..\..\src\tools\ufo2map\levels.c
Compiling: ..\..\src\tools\ufo2map\lightmap.c
Compiling: ..\..\src\tools\ufo2map\map.c
Compiling: ..\..\src\tools\ufo2map\patches.c
Compiling: ..\..\src\tools\ufo2map\portals.c
Compiling: ..\..\src\tools\ufo2map\qbsp3.c
Compiling: ..\..\src\tools\ufo2map\qrad3.c
Compiling: ..\..\src\tools\ufo2map\routing.c
Compiling: ..\..\src\tools\ufo2map\textures.c
Compiling: ..\..\src\tools\ufo2map\tree.c
Compiling: ..\..\src\tools\ufo2map\ufo2map.c
Compiling: ..\..\src\tools\ufo2map\writebsp.c
Linking console executable: ..\..\ufo2map.exe
C:/development/MinGW/bin/../lib/gcc/mingw32/3.4.2/../../../crt2.o:crt1.c:(.text+0x16a): undefined reference to `__cpu_features_init'
collect2: ld returned 1 exit status
Process terminated with status 1 (0 minutes, 8 seconds)
1 errors, 0 warnings

Now, I've done everything posted here in the wiki, and the only thing I had a problem with was installing the SDL Library - the Dev-C++ DevPaks updater/installer under Code:Blocks can't download and install either libsdl version 1.2.11 or SDL version 1.2.11. For Dev-C++ itself, the only working SDL library version 1.2.11 I was able to download is in a ZIP file, and while Dev-C++'s package manager does allow me to manually install this library using the ZIP format, the  Dev-C++ DevPaks updater/installer under Code:Blocks doesn't allow such a manual installation. In that wiki page, you did write this:
Quote
Extract them to some directory on your harddisk and add these paths to the Code::Blocks linker and include directories.
I did just that - I've extracted the SDL-1.2.11.zip file and added the \SDL-1.2.11 directory and the \SDL-1.2.11\include directory to the Search directories under Compiler, Linker and Resource compiler (I added them to all tabs, just in case). I don't think this is related to the problem, but I thought I should mention it anyway.

At least for now, I can still use Dev-C++ to compile ufo2map.dev to get the ufo2map.exe file.

Win XP SP2
UFO: AI 2.2 trunk 12079

Offline Mattn

  • Administrator
  • PHALANX Commander
  • *****
  • Posts: 4831
  • https://github.com/mgerhardy/vengi
    • View Profile
    • Vengi Voxel Tools
Re: Compiling ufo2map.cbp with Code::Blocks, trunk 112079
« Reply #1 on: September 28, 2007, 01:16:11 pm »

Offline smalul

  • Rookie
  • ***
  • Posts: 35
    • View Profile
Re: Compiling ufo2map.cbp with Code::Blocks, trunk 112079
« Reply #2 on: September 28, 2007, 01:52:13 pm »
This is the version I'm using (I've downloaded it again today before posting, just to make sure you haven't updated anything since the last time I downloaded that package).

Offline Mattn

  • Administrator
  • PHALANX Commander
  • *****
  • Posts: 4831
  • https://github.com/mgerhardy/vengi
    • View Profile
    • Vengi Voxel Tools
Re: Compiling ufo2map.cbp with Code::Blocks, trunk 112079
« Reply #3 on: September 28, 2007, 03:21:55 pm »
but with that package you don't have to download any sdl package - it's included, just set the search paths as descibed in the wiki article

Offline smalul

  • Rookie
  • ***
  • Posts: 35
    • View Profile
Re: Compiling ufo2map.cbp with Code::Blocks, trunk 112079
« Reply #4 on: September 28, 2007, 05:33:23 pm »
I did everything your wrote in the wiki (both setting the paths and installing the packages)- it doesn't help. It must be a problem with the ufo2map.cbp file, as the rest of the files compile just fine.

Offline BTAxis

  • Administrator
  • PHALANX Commander
  • *******
  • Posts: 2607
    • View Profile
Re: Compiling ufo2map.cbp with Code::Blocks, trunk 112079
« Reply #5 on: September 28, 2007, 06:00:20 pm »
I did as described on the wiki, and I have no problems compiling. It must be something on your end.

Offline Mattn

  • Administrator
  • PHALANX Commander
  • *****
  • Posts: 4831
  • https://github.com/mgerhardy/vengi
    • View Profile
    • Vengi Voxel Tools
Re: Compiling ufo2map.cbp with Code::Blocks, trunk 112079
« Reply #6 on: September 28, 2007, 06:02:02 pm »
you don't have to install any packages when you are using the prePACKAGED version of codeblocks ;)

Offline smalul

  • Rookie
  • ***
  • Posts: 35
    • View Profile
Re: Compiling ufo2map.cbp with Code::Blocks, trunk 112079
« Reply #7 on: September 28, 2007, 06:46:13 pm »
Just to be clear - I've downloaded the prePackaged version again today, deleted the development directory, deleted the configuration directory c:\Documents and Settings\****\Application Data\codeblocks, unzipped the file, placed the files in c:\development, configured Code::Blocks based on what you wrote in the wiki, and did the manual configuration just in case, but it just didn't work - ufo2map.cbp is just not compiling, and nor does the ufo2map part in the ufo.workspace file. I deleted the *.cbp files from the \build\projects directory and updated the project to the latest trunk, but again - ufo2map is just not compiling.

Again, this is the error I get:
Code: [Select]
Linking console executable: ..\..\ufo2map.exe
C:/development/MinGW/bin/../lib/gcc/mingw32/3.4.2/../../../crt2.o:crt1.c:(.text+0x16a): undefined reference to `__cpu_features_init'
collect2: ld returned 1 exit status
The ufo2map.dev file is compiling just fine in Dev-C++, and the rest of the .cbp compile in Code::Block, so it seems to me like the problem is with the ufo2map.cbp file. However, based on what you wrote, it does seems like there is something wrong at my end, but I just can't find the problem.

If you are indeed going to removed the Dev-C++ support, I must find and fix this problem now, so any ideas would be welcomed.

Offline Mattn

  • Administrator
  • PHALANX Commander
  • *****
  • Posts: 4831
  • https://github.com/mgerhardy/vengi
    • View Profile
    • Vengi Voxel Tools
Re: Compiling ufo2map.cbp with Code::Blocks, trunk 112079
« Reply #8 on: September 29, 2007, 12:37:12 am »
are you compiling release mode (windows) or debug mode (windows_debug)?

Offline smalul

  • Rookie
  • ***
  • Posts: 35
    • View Profile
Re: Compiling ufo2map.cbp with Code::Blocks, trunk 112079
« Reply #9 on: September 29, 2007, 10:33:17 am »
I checked the project's build options and properties, and it seems to me they are set to make a windows file, and not a windows_debug file (I'm not 100% sure, but it seems to me the windows option is the one selected). In any case, I've never touched any of the options there before.

Offline BTAxis

  • Administrator
  • PHALANX Commander
  • *******
  • Posts: 2607
    • View Profile
Re: Compiling ufo2map.cbp with Code::Blocks, trunk 112079
« Reply #10 on: September 29, 2007, 01:36:06 pm »
I've compiled both the windows and the windows_debug targets without problems, though. So that setting SHOULD not matter. But hey, you shouldn't be having this problem in the first place, so who knows.

Punkiee

  • Guest
Re: Compiling ufo2map.cbp with Code::Blocks, trunk 112079
« Reply #11 on: October 02, 2007, 01:49:59 pm »
This looks like a conflict in libraries.
Do you have any other MinGW libraries on your pc? Most probably because you have different dev environments. Also please check your PATH and strip it down to just what code::blocks needs.