Problem when compiling using CodeBlocks

Get help with compiling or installing the game, and discuss announcements of new official releases.

Moderator: Forum Moderators

Post Reply
macabeus_br
Code Contributor
Posts: 14
Joined: March 28th, 2013, 5:44 pm

Problem when compiling using CodeBlocks

Post by macabeus_br »

Follow these instructions to build.

The only difference is that I had downloaded the version of CodeBlocks with MinGW, but follow the remaining instructions equally.

I'm using Windows 7, 32 bit. Already compiled other projects in CodeBlocks smoothly.

Results in compilation:
Liblua: I compile without error
Wesnoth:
swig -c++ -lua -I..\..\src -I..\..\src\sdl_ttf -I..\..\src\serialization -I..\..\src\widgets -IC:\Users\macabeus\Desktop\CodeBlocksWinSDK_13_04_2013\cb\include_tdm_gcc -o \\"C\Users\macabeus\Apenas Meu\Project Wesnoth\src/animated.cpp "C:\Users\macabeus\Apenas Meu\Project Wesnoth\src\animated.i"
Execution of 'swig -c++ -lua -I..\..\src -I..\..\src\sdl_ttf -I..\..\src\serialization -I..\..\src\widgets -IC:\Users\macabeus\Desktop\CodeBlocksWinSDK_13_04_2013\cb\include_tdm_gcc -o \\"C\Users\macabeus\Apenas Meu\Project Wesnoth\src/animated.cpp "C:\Users\macabeus\Apenas Meu\Project Wesnoth\src\animated.i"' in 'C:\Users\macabeus\Apenas Meu\Project Wesnoth\projectfiles\CodeBlocks' failed.
Wesnothd:
||=== Build: Debug in liblua (compiler: GNU GCC Compiler) ===|
||=== Build: Debug in wesnothd (compiler: GNU GCC Compiler) ===|
C:\Users\macabeus\Apenas Meu\Project Wesnoth\src\server\server.cpp|493|warning: #warning "No FIFODIR set"|
libgomp.spec||No such file or directory|
||=== Build failed: 1 error(s), 1 warning(s) (9 minute(s), 40 second(s)) ===|
Last edited by macabeus_br on May 1st, 2014, 12:41 am, edited 1 time in total.
User avatar
Iris
Site Administrator
Posts: 6798
Joined: November 14th, 2006, 5:54 pm
Location: Chile
Contact:

Re: Problem when compiling using CodeBlocks

Post by Iris »

Try removing src/animated.i from the “wesnoth” project in the CodeBlocks file list (but do not delete the actual on-disk file!). It’s not supposed to be compiled directly, and CB appears to believe it’s supposed to be handled with something other than a C++ compiler for some reason.
Author of the unofficial UtBS sequels Invasion from the Unknown and After the Storm.
User avatar
Pentarctagon
Project Manager
Posts: 5564
Joined: March 22nd, 2009, 10:50 pm
Location: Earth (occasionally)

Re: Problem when compiling using CodeBlocks

Post by Pentarctagon »

Are you using Codeblocks 12 or 13? Codeblocks 13 is the latest download, but I can compile fine using Codeblocks 12.
99 little bugs in the code, 99 little bugs
take one down, patch it around
-2,147,483,648 little bugs in the code
macabeus_br
Code Contributor
Posts: 14
Joined: March 28th, 2013, 5:44 pm

Re: Problem when compiling using CodeBlocks

Post by macabeus_br »

shadowm, I did what I suggested. Helped, compiled much of the code, but still returns error.
g++.exe: libgomp.spec: No such file or directory
Process terminated with status 1 (123 minute(s), 33 second(s))
1 error(s), 0 warning(s) (123 minute(s), 33 second(s))
Pentarctagon, not understand why the version of codeblocks would mess.
User avatar
Iris
Site Administrator
Posts: 6798
Joined: November 14th, 2006, 5:54 pm
Location: Chile
Contact:

Re: Problem when compiling using CodeBlocks

Post by Iris »

KeplerBR wrote:shadowm, I did what I suggested. Helped, compiled much of the code, but still returns error.
g++.exe: libgomp.spec: No such file or directory
That’s probably because you don’t have the OpenMP support files installed, and for some weird reason our CB project defaults to enabling OpenMP, which is both unnecessary and poorly supported.

In CB 12.11 this can be disabled by right-clicking each project, choosing Build options, choosing the topmost entry in the tree view on the left of the Project build options dialog, choosing Compiler settingsOther options, and removing -fopenmp from the textbox. I hope the procedure is not too different on newer versions.
Author of the unofficial UtBS sequels Invasion from the Unknown and After the Storm.
macabeus_br
Code Contributor
Posts: 14
Joined: March 28th, 2013, 5:44 pm

Re: Problem when compiling using CodeBlocks

Post by macabeus_br »

Not solve the problem, because then returns messages like undefined reference to `GOMP_critical_*'.
It says the reason is precisely the lack of flag you said to delete.



A few months ago I managed to compile the game without many problems, do not know why I'm now facing all this.
AI
Developer
Posts: 2396
Joined: January 31st, 2008, 8:38 pm

Re: Problem when compiling using CodeBlocks

Post by AI »

We build wesnoth on pretty much every platform with openmp disabled. This removes the -fopenmp flag. Have you tried fully rebuilding after that change?
If for some reason _OPENMP is still defined without that flag, that sounds like a bug in your compiler setup.
Anonymissimus
Inactive Developer
Posts: 2461
Joined: August 15th, 2008, 8:46 pm
Location: Germany

Re: Problem when compiling using CodeBlocks

Post by Anonymissimus »

I had enabled OpenMP in the past (opposite procedure as what's described by shadowm above), likely because at that point the windows releases were build with it. If that's no longer the case, it should be removed.
IIRC it did not require changing something in the build system, and removing the flag should do even less so. Thus I suggest deleting the output folder (projectfiles/CodeBlocks/(.)objs-release and/or -debug) in a file manager, to make sure everything is rebuilt.

It was neccessary to install the compiler with OpenMP support enabled though to compile with OpenMP, there is a flag for it during the installation procedure. This will no longer be the case.
projects (BfW 1.12):
A Simple Campaign: campaign draft for wml startersPlan Your Advancements: mp mod
The Earth's Gut: sp campaignSettlers of Wesnoth: mp scenarioWesnoth Lua Pack: lua tags and utils
updated to 1.8 and handed over: A Gryphon's Tale: sp campaign
User avatar
Iris
Site Administrator
Posts: 6798
Joined: November 14th, 2006, 5:54 pm
Location: Chile
Contact:

Re: Problem when compiling using CodeBlocks

Post by Iris »

KeplerBR wrote:Not solve the problem, because then returns messages like undefined reference to `GOMP_critical_*'.
It says the reason is precisely the lack of flag you said to delete.
You may have to clean the current build and start again using the Rebuild option in the menus (instead of Build), or following anonymissimus’ instructions above.
Author of the unofficial UtBS sequels Invasion from the Unknown and After the Storm.
User avatar
Pentarctagon
Project Manager
Posts: 5564
Joined: March 22nd, 2009, 10:50 pm
Location: Earth (occasionally)

Re: Problem when compiling using CodeBlocks

Post by Pentarctagon »

KeplerBR wrote:Pentarctagon, not understand why the version of codeblocks would mess.
I don't know, but I am able to compile with Codeblocks 12.11 and only get the animated.i error after upgrading to 13.12.

That said, removing that file from the project seems to have fixed the error for me.
99 little bugs in the code, 99 little bugs
take one down, patch it around
-2,147,483,648 little bugs in the code
macabeus_br
Code Contributor
Posts: 14
Joined: March 28th, 2013, 5:44 pm

Re: Problem when compiling using CodeBlocks

Post by macabeus_br »

Finally compiled successfully. Thank you for your cooperation

It might be good to add this information that you told me on the topic in the document I quoted in the first post.
shadowm wrote:In CB 12.11 this can be disabled by right-clicking each project, choosing Build options, choosing the topmost entry in the tree view on the left of the Project build options dialog, choosing Compiler settingsOther options, and removing -fopenmp from the textbox. I hope the procedure is not too different on newer versions.
In addition to the clear -fopenmp informed the tab you also, deleted in the tab Linker Settings


OFF: It took about 170 minutes to compile
User avatar
Pentarctagon
Project Manager
Posts: 5564
Joined: March 22nd, 2009, 10:50 pm
Location: Earth (occasionally)

Re: Problem when compiling using CodeBlocks

Post by Pentarctagon »

KeplerBR wrote:OFF: It took about 170 minutes to compile
If you PC has multiple cores, you can use them by changing the value in Settings > Compiler > Build options > Number of processes for parallel builds
99 little bugs in the code, 99 little bugs
take one down, patch it around
-2,147,483,648 little bugs in the code
User avatar
iceiceice
Posts: 1056
Joined: August 23rd, 2013, 2:10 am

Re: Problem when compiling using CodeBlocks

Post by iceiceice »

I think the animated.i error has to do with this maybe?

http://wiki.codeblocks.org/index.php?ti ... ild_system

I have renamed the file from animated.i to animated.tpp in master. That's usually what you name header files that contain only templates, and it is only referred to by animated_game.cpp so this wasn't a big change.

https://github.com/wesnoth/wesnoth/comm ... e7e92f510c
User avatar
Pentarctagon
Project Manager
Posts: 5564
Joined: March 22nd, 2009, 10:50 pm
Location: Earth (occasionally)

Re: Problem when compiling using CodeBlocks

Post by Pentarctagon »

Yes, that seems to have fixed the codeblocks issue :)
99 little bugs in the code, 99 little bugs
take one down, patch it around
-2,147,483,648 little bugs in the code
Post Reply