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 » Errors during compiling the examples  () 1 Vote
Errors during compiling the examples [message #42086] Tue, 18 February 2014 16:25 Go to next message
Yeti86 is currently offline  Yeti86
Messages: 10
Registered: February 2014
Promising Member
Hello everybody,

I'm new to GUI programming and Ultimate++.

#include <CtrlLib/CtrlLib.h>
//#define _WIN32_WINNT 0x501
 
using namespace std;
using namespace Upp;

 

GUI_APP_MAIN {

    PromptOK("Hello world");

}



I tried at first to compile the examples. Unfortunately I get errors in the example above:

D:\upp\uppsrc\Core\Socket.cpp: In function 'int Upp::sGetAddrInfo(const char*, const char*, addrinfo**)':
D:\upp\uppsrc\Core\Socket.cpp:44:47: error: 'getaddrinfo' was not declared in this scope
return getaddrinfo(host, port, &hints, result);
^
D:\upp\uppsrc\Core\Socket.cpp: In static member function 'static DWORD Upp::IpAddrInfo::Thread(void*)':
D:\upp\uppsrc\Core\Socket.cpp:65:24: error: 'freeaddrinfo' was not declared in this scope
freeaddrinfo(result);

I'm compiling with MinGW. What do I have to do?

Regards

Marco
Re: Errors during compiling the examples [message #42087 is a reply to message #42086] Tue, 18 February 2014 17:35 Go to previous messageGo to next message
BioBytes is currently offline  BioBytes
Messages: 307
Registered: October 2008
Location: France
Senior Member
Hi Yeti,

Welcome to U++ programming world Razz . This is not necessary to add "using namespace std". Which version of UPP do you use ? what is your OS ?

Could you show your build configuration ? (Menu-> Setup-> Build methods)?

Regards

Biobytes
Re: Errors during compiling the examples [message #42089 is a reply to message #42086] Tue, 18 February 2014 18:18 Go to previous messageGo to next message
Yeti86 is currently offline  Yeti86
Messages: 10
Registered: February 2014
Promising Member
I'm using windows 7, I downloaded the win32 installer yesterday Smile.


Build methods attached.

Thanks in advance!
Re: Errors during compiling the examples [message #42090 is a reply to message #42089] Tue, 18 February 2014 18:44 Go to previous messageGo to next message
Oblivion is currently offline  Oblivion
Messages: 1091
Registered: August 2007
Senior Contributor
Hello Yeti86, and welcome to U++ forums.

Since you're on Windows platform, please check that if "ws2_32.lib" is in the "lib" section of build methods page or that a path in "lib" section is pointing to the folder where ws2_32.lib reside. Check the same thing for "include" section too. they might be missing required headers.

Regards.


[Updated on: Tue, 18 February 2014 18:47]

Report message to a moderator

Re: Errors during compiling the examples [message #42091 is a reply to message #42090] Tue, 18 February 2014 20:06 Go to previous messageGo to next message
Yeti86 is currently offline  Yeti86
Messages: 10
Registered: February 2014
Promising Member
Hello Oblivion,

thanks for the tip. So this library is part of the windows sdk and not of MinGW, right? So need to download it? Is there anything else which I should download as well?

Thanks!
Re: Errors during compiling the examples [message #42092 is a reply to message #42091] Tue, 18 February 2014 20:28 Go to previous messageGo to next message
Oblivion is currently offline  Oblivion
Messages: 1091
Registered: August 2007
Senior Contributor
Hello Yeti86,

No, it is not part of mingw, it is part of windows sdk. Winsock2 and its libraries should be present on your hard drive. Did you install windows sdk? Whether or not you have mingw, first you need to install Windows SDK in order to compile windows specific applications.

http://www.microsoft.com/en-us/download/details.aspx?id=8279

After installing library, choose automatic configuration in TheIDE again and see if the libs and includes are in place.

Also, you don't need std namespace.

Regards.


[Updated on: Tue, 18 February 2014 20:52]

Report message to a moderator

Re: Errors during compiling the examples [message #42096 is a reply to message #42092] Wed, 19 February 2014 01:36 Go to previous messageGo to next message
Yeti86 is currently offline  Yeti86
Messages: 10
Registered: February 2014
Promising Member
Thank you for the explanation Oblivion!

Update:
After installing the windows sdk and set up the directories like it was suggested I get a new error:

C:\Program Files\Microsoft SDKs\Windows\v7.1\Include/specstrings.h:11:17: fatal error: sal.h: No such file or directory
#include <sal.h>

Google says me that this is a lib of Visual Studio and everybody recommend to use the Visual c++ compiler for windows applications, instead of mingw. So at this time I'm downloading Visual Studio Express, which leads me to the next question related to this topic:

Where is the advantage to use Ultimate++ when I have to use a Visual C++ compiler? Is my Code really platform independed?

Thanks again!
Re: Errors during compiling the examples [message #42097 is a reply to message #42096] Wed, 19 February 2014 01:58 Go to previous messageGo to next message
Yeti86 is currently offline  Yeti86
Messages: 10
Registered: February 2014
Promising Member
After installing Visual Studio Express 2010 and Windows SDK:

Everything compiles properly, but still my questions about the platform independency remain:

Where is the advantage to use Ultimate++ when I have to use a Visual C++ compiler? Is my Code really platform independed?

Am I really forced to use the VC compiler?

I would be glad for a discussion about this topic!! Or is there already another one in the forum?

Good night!

Yeti
Re: Errors during compiling the examples [message #42098 is a reply to message #42097] Wed, 19 February 2014 06:50 Go to previous messageGo to next message
dolik.rce is currently offline  dolik.rce
Messages: 1789
Registered: August 2008
Location: Czech Republic
Ultimate Contributor

Yeti86 wrote on Wed, 19 February 2014 01:58

After installing Visual Studio Express 2010 and Windows SDK:

Everything compiles properly, but still my questions about the platform independency remain:

Where is the advantage to use Ultimate++ when I have to use a Visual C++ compiler? Is my Code really platform independed?

Am I really forced to use the VC compiler?

I would be glad for a discussion about this topic!! Or is there already another one in the forum?

Good night!

Yeti

Hi Yeti,

Don't worry, U++ is as platform independent as possible. There is many people using mingw. By the way, they say that it works much better with the TDM mingw. AFAIK mingw is not officially supported on windows, but it should work. Also, I think you can use Clang compiler on windows. Even the Open Watcom compiler should have some support in TheIDE.

But the real beauty of platform independence is that once you have a working U++ code on windows, you can simply compile it on Linux or BSD, or vice versa. There are even people who develop (and even compile Wink ) Windows applications on Linux Smile

Best regards,
Honza
Re: Errors during compiling the examples [message #42101 is a reply to message #42098] Wed, 19 February 2014 12:57 Go to previous messageGo to next message
Yeti86 is currently offline  Yeti86
Messages: 10
Registered: February 2014
Promising Member
Ok, thank you very much. I'm going to start to explore ultimate Smile

Regards
Re: Errors during compiling the examples [message #42102 is a reply to message #42097] Wed, 19 February 2014 13:22 Go to previous messageGo to next message
forlano is currently offline  forlano
Messages: 1182
Registered: March 2006
Location: Italy
Senior Contributor
Yeti86 wrote on Wed, 19 February 2014 01:58


Where is the advantage to use Ultimate++ when I have to use a Visual C++ compiler? Is my Code really platform independed?

Am I really forced to use the VC compiler?



Hello,

do not warry. Your code will be platform indipendent.
Under Linux use gcc. Under windows compile the same source code with VC. It is faster and produces a smaller executable. Unfortunately the mingw and its derivate have some problem. So it make no sense to use them having a free and better alternative.
I regret to have not known it since the first moment.

Luigi
Re: Errors during compiling the examples [message #44282 is a reply to message #42086] Thu, 19 February 2015 22:29 Go to previous messageGo to next message
Edward is currently offline  Edward
Messages: 34
Registered: February 2015
Location: United States
Member
On the topic of compiler errors, I'm experiencing many errors on a simple tutorial project.
When I comment out newly added code the caused the errors, recompiling gives the same error messages as when the problem code was present.

I have Cleaned, cleared, restarted, but the same messages keep reappearing. The only solution I found is starting over with a new project.

Any advice appreciated.



My mission is to find a powerful(Non MS) C++ IDE w/GUI to marry and spend the rest of my life with...
Re: Errors during compiling the examples [message #44309 is a reply to message #42086] Sat, 21 February 2015 18:39 Go to previous messageGo to next message
Edward is currently offline  Edward
Messages: 34
Registered: February 2015
Location: United States
Member
Yeti86

Quote:
Where is the advantage to use Ultimate++ when I have to use a Visual C++ compiler? Is my Code really platform independent?
Am I really forced to use the VC compiler?


I am setting up to convert multiple 13 year old healthcare VB6 apps to C++, and I'm determined to break away from Microsoft, the upgrade frenzy, and the .Net Framework overhead. So my updated apps will be running on Linux boxes, micro/nano ATX boards, small Windows free installs that we could make 1,000,000 of without being required to buy a windows license fee to be legal.

So the apps you develop on U++ can be built/compiled for/on Linux or Windows or OSX, either. So I send you a project folder and you choose which platform to build/compile, and deploy the app.

I believe our future is platform neutral, like Net Neutrality, able to run on any platform.

This is why I have fought so strongly to get a couple example projects debugged using MinGW while everyone is suggesting I get MS VS and my problems will be over.




My mission is to find a powerful(Non MS) C++ IDE w/GUI to marry and spend the rest of my life with...

[Updated on: Sat, 21 February 2015 18:43]

Report message to a moderator

Re: Errors during compiling the examples [message #44310 is a reply to message #42097] Sat, 21 February 2015 19:26 Go to previous message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
Yeti86 wrote on Wed, 19 February 2014 01:58
After installing Visual Studio Express 2010 and Windows SDK:

Everything compiles properly, but still my questions about the platform independency remain:

Where is the advantage to use Ultimate++ when I have to use a Visual C++ compiler? Is my Code really platform independed?

Am I really forced to use the VC compiler?


Depends whether you just want to get your job done...

The problem is that gcc/mingw is still about 2-3x times slower than C++ and also has the problem that library format is not compatible with standard windows SDK.

Unfortunately, if you are about to use some other open-source system, like PostgreSQL or OpenSSL, chances are they will support standard SDK directly - that means Visual C++. With mingw, you will likely have to invest some time to figure out alternative (e.g. compile the library). And all that trouble just because you want to be completely free from M$ - not worth a trouble IMO.

U++ is primary a library. For me, I just use the best toolchain available for free on target platform. That is VisualC++ on windows and CLANG on posix...
Previous Topic: [SOLVED]Build fails, "Warning: stabn: description field '10005' too big, try different debug format
Next Topic: [SOLVED]Control property syntax (ArrayCtrl, Button), IDE syntax guide unclear to me
Goto Forum:
  


Current Time: Fri Mar 29 14:30:08 CET 2024

Total time taken to generate the page: 0.01499 seconds