Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » Community » Newbie corner » Appearance errors in HelloWorld app build with MSVC++ 10
icon4.gif  Appearance errors in HelloWorld app build with MSVC++ 10 [message #32267] Thu, 05 May 2011 09:16 Go to next message
Dolphin is currently offline  Dolphin
Messages: 3
Registered: May 2011
Junior Member
Hello there,

currently I'm trying to build up a development environment on Windows for building apps that base on U++.

I want to use Visual C++ 2010 Express as development IDE. Since there are no VC++ project files to build U++ from source, I currently setting up a CMake build environment to build the VC++ project and solution files automatically.

So far I have managed to build the HelloWorld example and the necessary dependencies in U++. But when I run the HelloWorld app, I have strange graphical errors, especially in the menu, menu bar and status bar. The background is black and I can only read the menu item texts, when I hover over them with the mouse cursor. The background color of the Window is different too (light gray vs. dark gray).

If I build the HelloWorld app with TheIDE I don't have this error.

index.php?t=getfile&id=3220&private=0

What I'm doing wrong here (beside on not using TheIDE Rolling Eyes)? Currently I have no clue how to fix it.

Re: Appearance errors in HelloWorld app build with MSVC++ 10 [message #32268 is a reply to message #32267] Thu, 05 May 2011 11:01 Go to previous messageGo to next message
dolik.rce is currently offline  dolik.rce
Messages: 1789
Registered: August 2008
Location: Czech Republic
Ultimate Contributor

Dolphin wrote on Thu, 05 May 2011 09:16


Hi Dolhin,

Welcome to the forum! You have chosen quite a hard task Smile

index.php?t=getfile&id=3220&private=0

What I'm doing wrong here (beside on not using TheIDE Rolling Eyes)? Currently I have no clue how to fix it.

I've already seen this few times Wink Typically this happens when you link the object files in incorrect order. Have a look at the order used in theide (Setup>Be verbose & recompile). The most important thing is to list first the objects created from *.icpp files, before anything else. IIRC, the reason is that icpp files initialize some static variables (e.g. some GUI colors), so if they are listed in wrong order, some variables might have weird, uninitialized values (e.g. showing up as black background Smile ).

Best regards,
Honza
Re: Appearance errors in HelloWorld app build with MSVC++ 10 [message #32269 is a reply to message #32267] Thu, 05 May 2011 11:02 Go to previous messageGo to next message
mr_ped is currently offline  mr_ped
Messages: 825
Registered: November 2005
Location: Czech Republic - Praha
Experienced Contributor
Do a clean build in TheIDE with verbose ON, and save the log...
Do the same with MSVC++ .. check for differences.

Or wait, maybe somebody will give you some clue where the problem may be. I have no idea, sorry.

edit: and what Honza said.. Smile (didn't see his post when I was writing my answer)

[Updated on: Thu, 05 May 2011 11:03]

Report message to a moderator

Re: Appearance errors in HelloWorld app build with MSVC++ 10 [message #32270 is a reply to message #32267] Thu, 05 May 2011 12:06 Go to previous messageGo to next message
Dolphin is currently offline  Dolphin
Messages: 3
Registered: May 2011
Junior Member
Thanks for the fast replies. I'll try what you proposed.

So I'm back to hell for a while... Very Happy
Re: Appearance errors in HelloWorld app build with MSVC++ 10 [message #32271 is a reply to message #32267] Thu, 05 May 2011 13:13 Go to previous messageGo to next message
mr_ped is currently offline  mr_ped
Messages: 825
Registered: November 2005
Location: Czech Republic - Praha
Experienced Contributor
You know, that's sort of the reason why to replicate TheIDE's build system is not trivial. Once you will understand it fully, it's pretty straightforward and logical, but it's not just basic "cc hello.c", it handles much more, just search for "icpp" in forums to learn more about this feature.
Re: Appearance errors in HelloWorld app build with MSVC++ 10 [message #32272 is a reply to message #32267] Thu, 05 May 2011 14:29 Go to previous messageGo to next message
Dolphin is currently offline  Dolphin
Messages: 3
Registered: May 2011
Junior Member
Ok, I fixed the problem. Smile The cause was, that the object files that are created by ICPP files cannot be linked into a LIB.

My current solution simply adds the ICCP files of U++ to the source files of the application in the CMake build step. Then the ICPPs get compiled to object files and are directly linked with the rest of the application. Surely not the best method, but for now it works.

For reference: This thread describes the same problem.

P.S. I was searching the forum for nearly an hour, but I couldn't find a thread similar to my problem. Should have searched for "LNK4221". But at the time of searching I wasn't really aware of that being the cause of the problems ...
Re: Appearance errors in HelloWorld app build with MSVC++ 10 [message #32273 is a reply to message #32272] Thu, 05 May 2011 15:13 Go to previous message
dolik.rce is currently offline  dolik.rce
Messages: 1789
Registered: August 2008
Location: Czech Republic
Ultimate Contributor

Dolphin wrote on Thu, 05 May 2011 14:29

My current solution simply adds the ICCP files of U++ to the source files of the application in the CMake build step. Then the ICPPs get compiled to object files and are directly linked with the rest of the application. Surely not the best method, but for now it works.

This is in fact the same approach as is used by theide and all other build systems. Also it is probably the only possible solution Smile The code in icpp files is often not referenced from anywhere else, so linker can mistakenly throw it away, if linked in any other way.

Honza
Previous Topic: Invalid build method
Next Topic: Eigen and UPP? (STL question?)
Goto Forum:
  


Current Time: Fri Apr 19 01:21:49 CEST 2024

Total time taken to generate the page: 0.04351 seconds