i have mistake
-
Saturday, September 15, 2012 5:02 PM
1>C:\Program Files (x86)\Microsoft Visual Studio 10.0\GUI\Graph.h(47): warning C4309: 'initializing' : truncation of constant value
wht is it ?
- Changed Type Elegentin XieMicrosoft Contingent Staff, Moderator Tuesday, October 02, 2012 7:55 AM
All Replies
-
Saturday, September 15, 2012 5:05 PM
1>C:\Program Files (x86)\Microsoft Visual Studio 10.0\GUI\Graph.h(47): warning C4309: 'initializing' : truncation of constant value
I have problem with it .
- Merged by Elegentin XieMicrosoft Contingent Staff, Moderator Monday, September 17, 2012 7:37 AM
-
Saturday, September 15, 2012 5:13 PM
You can look up C4309 in the help:
-
Saturday, September 15, 2012 5:16 PM
Thank You
what is it ?
larger type for the constant
-
Saturday, September 15, 2012 5:18 PMPost the source code corresponding to the warning message. (It's odd that you have a folder called GUI, whereas I don't. What edition of Visual Studio 2010 are you using?)
-
Saturday, September 15, 2012 5:19 PM
You may need to use a larger type for the constant.
When i put in property pages C:\Program Files %28x86%29\Microsoft Visual Studio 10.0\GUI;C:\Program Files %28x86%29\Microsoft Visual Studio 10.0\FLTK then i have access to path in this library ?
- Edited by rafal_bator Saturday, September 15, 2012 5:42 PM add
-
Saturday, September 15, 2012 5:20 PM
I note that this is a duplicate of http://social.msdn.microsoft.com/Forums/en/vclanguage/thread/0dcd387f-0c97-40db-a197-8e8724ec62bb
-
Saturday, September 15, 2012 7:13 PM
if You can , integrate it , please .
i used new thread because i finish last by new problem ,which is result from badly interpretation of make access path ? if You can , look on this maybe is it that problem ?
- Edited by rafal_bator Saturday, September 15, 2012 7:14 PM add explain
-
Saturday, September 15, 2012 7:16 PM
That warning means you're trying to assign a constant to a variable which is too small to hold that value, for example:
short i = 123456; // shorts can't contain numbers above 32767
- Proposed As Answer by Richie Hindle - Entrian Solutions Saturday, September 15, 2012 7:16 PM
-
Saturday, September 15, 2012 7:22 PMi use Express version .
-
Saturday, September 15, 2012 7:27 PM
can i change int main() to other variable ? do You think about int ?
-
Saturday, September 15, 2012 8:33 PM
can i change int main() to other variable ? do You think about int ?
No, the standard requires that int is returned by main. Why do you feel compelled to change it?
Note that this is a brand new question, unrelated to the original question you posted. Generally, you should post a new question in a new thread, and mark the old thread as answered if indeed you have found a solution. Moreover, you are discouraged from posting the same question in multiple forums. If you must, you should add a hyperlink so that readers can see if the question is answered in the other forum before wasting their time researching a question that no longer needs to be answered.
It's not clear to me whether your original question has been answered. If not, please post line 47 of your file Graph.h, as I asked you previously.
-
Saturday, September 15, 2012 10:18 PM
1>C:\Program Files (x86)\Microsoft Visual Studio 10.0\GUI\Graph.h(45): warning C4305: 'initializing' : truncation from 'Graph_lib::Color::Transparency' to 'char'
1>C:\Program Files (x86)\Microsoft Visual Studio 10.0\GUI\Graph.h(45): warning C4309: 'initializing' : truncation of constant value
1>C:\Program Files (x86)\Microsoft Visual Studio 10.0\GUI\Graph.h(47): warning C4305: 'initializing' : truncation from 'Graph_lib::Color::Transparency' to 'char'
1>C:\Program Files (x86)\Microsoft Visual Studio 10.0\GUI\Graph.h(47): warning C4309: 'initializing' : truncation of constant value
Color(Color_type cc) :c(Fl_Color(cc)), v(visible) { } (45)
Color(Color_type cc, Transparency vv) :c(Fl_Color(cc)), v(vv) { }
Color(intcc) :c(Fl_Color(cc)), v(visible) { } (47)
Color(Transparency vv) :c(Fl_Color()), v(vv) { }
Can You help me ? -
Sunday, September 16, 2012 12:05 AM
What is the definition of Fl_Color? What parameter is expected for the constructor? Similarly what type is visible and what type is v?1>C:\Program Files (x86)\Microsoft Visual Studio 10.0\GUI\Graph.h(45): warning C4305: 'initializing' : truncation from 'Graph_lib::Color::Transparency' to 'char'
1>C:\Program Files (x86)\Microsoft Visual Studio 10.0\GUI\Graph.h(45): warning C4309: 'initializing' : truncation of constant value
1>C:\Program Files (x86)\Microsoft Visual Studio 10.0\GUI\Graph.h(47): warning C4305: 'initializing' : truncation from 'Graph_lib::Color::Transparency' to 'char'
1>C:\Program Files (x86)\Microsoft Visual Studio 10.0\GUI\Graph.h(47): warning C4309: 'initializing' : truncation of constant value
Color(Color_type cc) :c(Fl_Color(cc)), v(visible) { } (45)
Color(Color_type cc, Transparency vv) :c(Fl_Color(cc)), v(vv) { }
Color(intcc) :c(Fl_Color(cc)), v(visible) { } (47)
Color(Transparency vv) :c(Fl_Color()), v(vv) { }
Can You help me ? -
Sunday, September 16, 2012 10:50 AM
struct
Color {
enumColor_type {
red=FL_RED,
blue=FL_BLUE,
green=FL_GREEN,
yellow=FL_YELLOW,
white=FL_WHITE,
black=FL_BLACK,
magenta=FL_MAGENTA,
cyan=FL_CYAN,
dark_red=FL_DARK_RED,
dark_green=FL_DARK_GREEN,
dark_yellow=FL_DARK_YELLOW,
dark_blue=FL_DARK_BLUE,
dark_magenta=FL_DARK_MAGENTA,
dark_cyan=FL_DARK_CYAN
};
v;
-
Sunday, September 16, 2012 4:21 PM
-
Sunday, September 16, 2012 5:22 PMwhat does trunctation means ?
what do i ought ?- Edited by rafal_bator Sunday, September 16, 2012 6:08 PM add
-
Sunday, September 16, 2012 7:01 PM
Truncation means loss of bits. It is not possible to assign 32 bits to an 8 bit variable. 24 of the bits will be truncated (== lost).
You must understand the range that can be stored in each data type. Use a data type that is suitable for the data you need to store.
- Edited by Scott McPhillipsMVP Sunday, September 16, 2012 7:02 PM
-
Sunday, September 16, 2012 8:55 PM
1>main.obj : error LNK2028: unresolved token (0A000408) "public: virtual __thiscall Fl_Window::~Fl_Window(void)" (??1Fl_Window@@$$FUAE@XZ) referenced in function "public: virtual __thiscall Graph_lib::Window::~Window(void)" (??1Window@Graph_lib@@$$FUAE@XZ)
1>main.obj : error LNK2028: unresolved token (0A000467) "public: __thiscall Simple_window::Simple_window(struct Point,int,int,class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &)" (??0Simple_window@@$$FQAE@UPoint@@HHABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@Z) referenced in function "int __cdecl main(void)" (?main@@$$HYAHXZ)
1>main.obj : error LNK2028: unresolved token (0A000468) "public: bool __thiscall Simple_window::wait_for_button(void)" (?wait_for_button@Simple_window@@$$FQAE_NXZ) referenced in function "int __cdecl main(void)" (?main@@$$HYAHXZ)
1>main.obj : error LNK2028: unresolved token (0A000559) "public: void __thiscall Fl_Widget::show(void)" (?show@Fl_Widget@@$$FQAEXXZ) referenced in function "public: virtual void __thiscall Graph_lib::Widget::show(void)" (?show@Widget@Graph_lib@@$$FUAEXXZ)
1>main.obj : error LNK2028: unresolved token (0A00055A) "public: void __thiscall Fl_Widget::hide(void)" (?hide@Fl_Widget@@$$FQAEXXZ) referenced in function "public: virtual void __thiscall Graph_lib::Widget::hide(void)" (?hide@Widget@Graph_lib@@$$FUAEXXZ)
1>main.obj : error LNK2019: unresolved external symbol "public: virtual __thiscall Fl_Window::~Fl_Window(void)" (??1Fl_Window@@$$FUAE@XZ) referenced in function "public: virtual __thiscall Graph_lib::Window::~Window(void)" (??1Window@Graph_lib@@$$FUAE@XZ)
1>main.obj : error LNK2001: unresolved external symbol "protected: virtual void __thiscall Graph_lib::Window::draw(void)" (?draw@Window@Graph_lib@@MAEXXZ)
1>main.obj : error LNK2001: unresolved external symbol "public: virtual int __thiscall Fl_Window::handle(int)" (?handle@Fl_Window@@UAEHH@Z)
1>main.obj : error LNK2001: unresolved external symbol "public: virtual void __thiscall Fl_Window::resize(int,int,int,int)" (?resize@Fl_Window@@UAEXHHHH@Z)
1>main.obj : error LNK2001: unresolved external symbol "protected: virtual void __thiscall Fl_Window::flush(void)" (?flush@Fl_Window@@MAEXXZ)
1>main.obj : error LNK2001: unresolved external symbol "public: virtual void __thiscall Fl_Window::show(void)" (?show@Fl_Window@@UAEXXZ)
1>main.obj : error LNK2001: unresolved external symbol "public: virtual void __thiscall Fl_Window::hide(void)" (?hide@Fl_Window@@UAEXXZ)
1>main.obj : error LNK2019: unresolved external symbol "public: void __thiscall Fl_Widget::hide(void)" (?hide@Fl_Widget@@$$FQAEXXZ) referenced in function "public: virtual void __thiscall Graph_lib::Widget::hide(void)" (?hide@Widget@Graph_lib@@$$FUAEXXZ)
1>main.obj : error LNK2019: unresolved external symbol "public: void __thiscall Fl_Widget::show(void)" (?show@Fl_Widget@@$$FQAEXXZ) referenced in function "public: virtual void __thiscall Graph_lib::Widget::show(void)" (?show@Widget@Graph_lib@@$$FUAEXXZ)
1>main.obj : error LNK2019: unresolved external symbol "public: bool __thiscall Simple_window::wait_for_button(void)" (?wait_for_button@Simple_window@@$$FQAE_NXZ) referenced in function "int __cdecl main(void)" (?main@@$$HYAHXZ)
1>main.obj : error LNK2019: unresolved external symbol "public: __thiscall Simple_window::Simple_window(struct Point,int,int,class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &)" (??0Simple_window@@$$FQAE@UPoint@@HHABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@Z) referenced in function "int __cdecl main(void)" (?main@@$$HYAHXZ)
-
Monday, September 17, 2012 12:45 AM
1>main.obj : error LNK2028: unresolved token (0A000408) "public: virtual __thiscall Fl_Window::~Fl_Window(void)" (??1Fl_Window@@$$FUAE@XZ) referenced in function "public: virtual __thiscall Graph_lib::Window::~Window(void)" (??1Window@Graph_lib@@$$FUAE@XZ)
Your previous errors were compiler errors (or warnings). This and the other errors in this post are linker errors. It would seem that you are using an external library that you have not linked correctly.
David Wilkinson | Visual C++ MVP -
Monday, September 17, 2012 7:36 AMModerator
Hi,
Welcome here.
Here you asked the same question:
http://social.msdn.microsoft.com/Forums/en-US/vcgeneral/thread/ca8dd1e4-dba6-451b-83a2-31a78c35a3b6
So I will merge this one to the original, thanks for your understanding.
Regards,
Elegentin Xie [MSFT]
MSDN Community Support | Feedback to us
-
Monday, September 17, 2012 9:20 AMi maked access path , where is my mistake ?
-
Monday, September 17, 2012 9:54 AM
i maked access path , where is my mistake ?
1. In Project Properties->Configuration Properties->Linker->General->Additional Library Directories, place the path to the directory where your library (.lib) is located.
2. In Project Properties->Configuration Properties->Linker->Input put the name of the library (xxx.lib).Clarification: Library name goes in Linker->Input->Additional Dependencies
David Wilkinson | Visual C++ MVP
- Edited by davewilkMVP Monday, September 17, 2012 10:36 AM clarification
-
Monday, September 17, 2012 10:16 AM2 . In Additional Dependencies ? have to i put all library , only directory is correct ?
-
Monday, September 17, 2012 10:39 AM
-
Monday, September 17, 2012 12:14 PM
1>C:\Program Files (x86)\Microsoft Visual Studio 10.0\GUI\GUI.h : fatal error LNK1107: invalid or corrupt file: cannot read at 0xF62
-
Monday, September 17, 2012 12:43 PM
1>C:\Program Files (x86)\Microsoft Visual Studio 10.0\GUI\GUI.h : fatal error LNK1107: invalid or corrupt file: cannot read at 0xF62
Are you trying to link this Gui.h file? It makes no sense to link a header file.
The only type of file you should try to link is .lib (static library or import library).
David Wilkinson | Visual C++ MVP -
Monday, September 17, 2012 2:37 PM
how is correct link ? what ought i do ?
- Edited by rafal_bator Monday, September 17, 2012 3:18 PM
-
Monday, September 17, 2012 3:25 PM
-
Thursday, September 27, 2012 7:55 AMModeratorHi,
I have been watching this issue for a while now. I do appreciate your time and effort on this issue.
According to your description, you issue has not a solid answer; I think it should be better if we change the thread type to General Discussion.
Thanks for your understanding and active participation in the MSDN Forum.
Regards,Elegentin Xie [MSFT]
MSDN Community Support | Feedback to us

