Microsoft 2010可视化c,安装FLTK [英] Microsoft 2010 visual c , installing FLTK

查看:578
本文介绍了Microsoft 2010可视化c,安装FLTK的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

MST2010C ++的FLTK问题



我正在关注编程 - 使用C ++的原理与实践。



有一个不好的时间试图让FLTK正常运行。我为我工作,一次,然后再也不会。
我详细说明了下面采取的步骤,如果任何人都能注意到任何奇怪的事情,我会非常感激。



我的主要问题如下:
1)链接器>输入>附加依赖项中的步骤有点混乱
2)我已经构建了1.1.9和1.3.0的解决方案。这些冲突可以吗?
3)我对这个过程的理解至少是基本的。



建筑实际上是什么?它将创建什么对象?



系统
Windows 7(64位)(Microsoft 2010 Visual C ++)



为fltt 1.1.9尝试的步骤



1下载fltk-1.1.9-source



2 vlC2005解决方案为我提供以下结果:

  ========== Build:66成功,3次失败,0次更新,1次跳过========== 

3将源文件中的lib文件复制到
x:\Program文件(x86)\Microsoft Visual Studio 10.0 \VC\lib



4将FL FOLDER复制到(所以文件夹被添加/替换)
x:\Program文件(x86)\Microsoft Visual Studio 10.0 \VC\include\



5如果我尝试运行解决方案,它会失败 -

  ======= === Build:6成功,3失败,0最新,0跳过========== 

6创建一个名为graphics6的项目作为win32项目



7应用程序设置 - Windows应用程序&空项目



8在源文件中创建graphics6.cpp,添加了以下代码

  #include< FL / Fl.h> 
#include< FL / Fl_Box.h>
#include< FL / Fl_Window.h>

int main()
{
Fl_Window窗口(200,200,窗口标题);
Fl_Box框(0,0,200,200,Hey);
window.show();
return Fl :: run();
}

9当我运行它时,我得到以下



1> MSVCRTD.lib(crtexew.obj):错误LNK2019:未解析的外部符号_WinMain @ 16
在函数___tmainCRTStartup中引用

10更改项目设置 - 链接器>输入>其他依赖关系:

 kernel32.lib; user32.lib; gdi32.lib; winspool.lib; comdlg32.lib; advapi32.lib; 
shell32.lib; ole32.lib; oleaut32 .lib; uuid.lib; odbc32.lib; odbccp32.lib;%(fltkd.lib
wsock32.lib comctl32.lib fltkjpegd.lib fltkimagesd.lib)

11当我运行时,我得到这个 -

  1> MSVCRTD.lib(crtexew.obj):error LNK2019:未解析的外部符号
_WinMain @ 16在函数___tmainCRTStartup中引用

结论
1.1.9不能在MS2010VC ++下构建



让我们尝试1.3代替-------



1下载1.3并运行解决方案\fltk-1.3.0-source\fltk-1.3.0\ide\VisualC2010\fltk.sln



2建立它(我做了几次,所以它给出以下结果:

  ========== Build:0 succeeded,0 failed,79 up-to-date,0 skipped ========== 

3如果我运行它,我得到屏幕上的图形。到目前为止这么好!



4将源文件中的lib文件复制到
x:\Program Files(x86)\Microsoft Visual Studio 10.0 \VC \ lib



5将FL FOLDER复制到(所以文件夹被添加/替换)
x:\Program Files(x86)\Microsoft Visual Studio 10.0 \VC\include\



6步骤6 - 8与上面相同,所以刚刚加载了上一个项目。



7当我运行

  1> MSVCRTD.lib(crtexew.obj):error LNK2019:unresolved外部符号_WinMain @ 16 
在函数___tmainCRTStartup中引用
1> C:我的信息\visual studio 2010\Projects\graphics6\Debug\graphics6.exe:致命
错误LNK1120 :1 unresolved externals
========== Build:0成功,1失败,0最新,0跳过==========

8添加忽略默认库> libcd.lib



9 Ran它再次有相同的结果



很抱歉这个长度,但我觉得唯一的方法来澄清问题是包括所有的细节。



据我所见,我尽可能地遵循指示。主要的问题是我不能运行1.1.9。



我在许多网站上搜索过这个问题的解决方案,但尚未找到详细的步骤通过逐步记录过程。

解决方案

FLTK 1.3.0



得到解决方案(约12小时后) -



第1部分 - 构建FLTK


  1. 下载fltk-1.3.0并解压缩。

  2. 将包含的fltk-1.3.0文件夹复制到C:\(您可以使用其他位置,但必须更改某些命令)。

  3. 进入C:\fltk-1.3.0\ide\VisualC2010并运行fltk.sln

  4. 右键单击它并单击构建

  5. 应该完成,没有错误。如果有错误,我非常怀疑这本指南会帮助你。

  6. 一旦完成,你应该能够运行它(将打开窗口)。

第2部分 - 运行您自己的项目
假设构建正确,您现在可以按照以下步骤操作:


  1. 启动MSVC ++ 2010

  2. 文件>新建>项目 - 选择Win32项目和名称

      FLTK-Test3 


  3. 点击下一步向导然后
    应用程序类型:保持为Windows应用程序
    附加选项:空项目
    点击完成


  4. 右键单击解决方案资源管理器中的源文件,添加

      FLTK-Test3.cpp 


  5. 右键单击FLTK-Test3并进入属性



    > C / C ++>命令行>其他选项 - 添加

      /Ic:\\\\\\\\\\\\  

    b)配置属性>链接器>输入>附加依赖关系>
    这是最难的部分,添加

      c:\fltk-1.3.0\lib\fltkd.lib; wsock32.lib; comctl32.lib ; c:\fltk-1.3.0\lib\fltkjpegd.lib; c:\fltk-1.3.0\lib\fltkimagesd.lib; 

    到行末(替换#可能不同 -

      kernel32.lib; user32.lib; gdi32.lib; winspool.lib; comdlg32.lib; advapi32。 lib; shell32.lib; ole32.lib; oleaut32.lib; uuid.lib; odbc32.lib; odbccp32.lib; c:\fltk-1.3.0\lib\fltkd.lib; wsock32.lib; comctl32。 lib; c:\fltk-1.3.0\lib\fltkjpegd.lib; c:\fltk-1.3.0\lib\fltkimagesd.lib; 


.lib文件末尾的'd'表示调试,你应该包括没有'd'的那些。所以..fltkjpeg.lib不是..jpegd.lib。



如果这个部分工作正常,当你添加



c)你可能还需要这样做(如果是的话)它不运行)



配置属性>链接器>输入>忽略特定的默认库>

 code> libcd.lib 




  1. 已完成,您应该可以添加以下完整代码 -

      #include< FL / 
    #include< FL / Fl_Window.h>

    int main()
    {
    Fl_Window win(320,200);
    win.show();
    return Fl :: run();
    }


输入上述代码,并运行。



我还有很多错误 -

 FLTK-Test3.exe:已加载C:\Users\USER\Documents\Visual工作室2010\Projects\FLTK-Test3\Debug\FLTK-Test3.exe,加载符号。 
'FLTK-Test3.exe':加载'C:\Windows \SysWOW64\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\ C:\Windows\SysWOW64\kernel32.dll,无法找到或打开PDB文件
'FLTK-Test3.exe:已加载C:\Windows\SysWOW64\KernelBase.dll ,无法找到或打开PDB文件
'FLTK-Test3.exe:已加载C:\Windows\winsxs\x86_microsoft.windows.common- controls_6595b64144ccf1df_5.82.7601.17514_none_ec83dffa859149af\comctl32.dll',找不到或打开PDB文件
'FLTK-Test3.exe':加载'C:\Windows \\ Test3.exe':加载'C:\Windows\SysWOW64\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\ SysWOW64\sechost.dll,无法找到或打开PDB文件
'FLTK-Test3.exe:已加载C:\Windows\SysWOW64\rpcrt4.dll,无法找到或打开PDB文件
'FLTK-Test3.exe':加载'C:\Windows\SysWOW64\\\\\\\\\\\\\sspicli.dll',找不到或打开PDB文件
'FLTK-Test3.exe':Loaded 'C:\Windows \SysWOW64\cryptbase.dll',找不到或打开PDB文件
'FLTK-Test3.exe':Loaded'C:\Windows \SysWOW64\gdi32.dll ',找不到或打开PDB文件
'FLTK-Test3.exe':加载'C:\Windows \SysWOW64\user32.dll',找不到或打开PDB文件
' FLTK-Test3.exe':加载'C:\Windows \SysWOW64\lpk.dll',找不到或打开PDB文件
'FLTK-Test3.exe':Loaded'C:\Windows \SysWOW64\usp10.dll,无法找到或打开PDB文件
'FLTK-Test3.exe:已加载C:\Windows\SysWOW64\msvcr100d.dll',加载的符号。
'FLTK-Test3.exe':加载'C:\Windows \SysWOW64\comdlg32.dll',找不到或打开PDB文件
'FLTK-Test3.exe':Loaded' C:\Windows\SysWOW64\shlwapi.dll,无法找到或打开PDB文件
'FLTK-Test3.exe:已加载C:\Windows\SysWOW64\shell32.dll ,无法找到或打开PDB文件
'FLTK-Test3.exe':加载'C:\Windows\SysWOW64\ole32.dll',找不到或打开PDB文件
'FLTK -Test3.exe':加载'C:\Windows \SysWOW64\imm32.dll',找不到或打开PDB文件
'FLTK-Test3.exe':Loaded'C:\Windows\\ \\SysWOW64\msctf.dll,无法找到或打开PDB文件
'FLTK-Test3.exe:已加载C:\Windows\SysWOW64\uxtheme.dll,无法找到或打开PDB文件
'FLTK-Test3.exe':加载'C:\Windows \SysWOW64\dwmapi.dll',找不到或打开PDB文件
'FLTK-Test3.exe':加载C:\Windows\SysWOW64\clbcatq.dll,无法找到或打开PDB文件
'FLTK-Test3.exe:已加载C:\Windows\SysWOW64\oleaut32。 dll',无法找到或打开PDB文件
'FLTK-Test3.exe':加载'C:\Windows \SysWOW64\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\ 'FLTK-Test3.exe':加载'C:\Windows \SysWOW64\version.dll',找不到或打开PDB文件
'FLTK-Test3.exe':Unloaded'C:\ Windows \SysWOW64\msimtf.dll'
'FLTK-Test3.exe':卸载'C:\Windows \SysWOW64\version.dll'

..但它跑了!



希望有帮助。


FLTK problems with MSV2010C++

I'm following "Programming - Principles and Practice Using C++".

Having a bad time trying to get FLTK running correctly. I worked for me, once, then never again. I have detailed the steps taken below, and would really appreciate it if anyone can notice anything strange.

My main concerns are the following: 1) The steps in the Linker > Input > Additional dependencies are a little confusing 2) I have built both solutions for 1.1.9 and 1.3.0. Could these conflict? 3) My understanding of the process is basic to say the least.

What does building actually achieve? What objects will it create? How can I check these have been made correctly?

System Windows 7(64 bit) (Microsoft 2010 Visual C++)

Steps tried for fltt 1.1.9

1 Download fltk-1.1.9-source

2 The vlC2005 solution gives me the following results:

========== Build: 66 succeeded, 3 failed, 0 up-to-date, 1 skipped ==========

3 Copied the lib files from the source to x:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\lib

4 Copied the FL FOLDER into (so the folder is added / replaced) x:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\

5 If I try to run the solution, it fails -

========== Build: 6 succeeded, 3 failed, 0 up-to-date, 0 skipped ==========

6 Create a new project named graphics6, as a win32 project

7 Application settings - Windows application & empty project

8 In the source files, created graphics6.cpp, added the following code

    #include <FL/Fl.h>
    #include <FL/Fl_Box.h>
    #include <FL/Fl_Window.h>

    int main()
    {
    Fl_Window window(200,200,"Window Title");
    Fl_Box box(0,0,200,200,"Hey");
    window.show();
    return Fl::run();
    }

9 When I run it, I get the following

  1>MSVCRTD.lib(crtexew.obj) : error LNK2019: unresolved external symbol _WinMain@16  
  referenced in function ___tmainCRTStartup

10 Alter the project settings - Linker > Input > Additional dependencies:

 "kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;
 shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(fltkd.lib
 wsock32.lib comctl32.lib fltkjpegd.lib fltkimagesd.lib)"

11 When I run, I get this -

 1>MSVCRTD.lib(crtexew.obj) : error LNK2019: unresolved external symbol 
_WinMain@16 referenced in function ___tmainCRTStartup

Conclusion 1.1.9 cannot be built under MS2010VC++

Let's try 1.3 instead -------

1 Download 1.3 and run the solution \fltk-1.3.0-source\fltk-1.3.0\ide\VisualC2010\fltk.sln

2 Built it (I've done this a few times, so it gives the following result :

========== Build: 0 succeeded, 0 failed, 79 up-to-date, 0 skipped ==========

3 If I run it, I get the graphics on the screen. So far so good!

4 Copied the lib files from the source to x:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\lib

5 Copied the FL FOLDER into (so the folder is added / replaced) x:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\

6 Steps 6 - 8 are the same as above, so just loaded the previous project.

7 When I run

 1>MSVCRTD.lib(crtexew.obj) : error LNK2019: unresolved external symbol _WinMain@16
 referenced in function ___tmainCRTStartup
 1>C:my information \visual studio 2010\Projects\graphics6\Debug\graphics6.exe : fatal 
 error LNK1120: 1 unresolved externals 
 ========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========

8 added Ignore Default Libraries> libcd.lib

9 Ran it again with the same results

Sorry about the length of this, but I feel the only way to clarify the problem is to include all the details.

As far as I can see, I'm following the instructions as closely as I can. The major problem being that I cant run 1.1.9.

I've searched for solutions to this problem on a number of sites, but have yet to find a detailed step by step write up of the process.

解决方案

FLTK 1.3.0

Ok, I've finally gotten a solution to this (after about 12 hours) -

Part 1 - Building FLTK

  1. Download fltk-1.3.0 and extract it.
  2. Copy the contained fltk-1.3.0 folder to C:\ (you can use another location, but you'll have to change some of the commands).
  3. Go into C:\fltk-1.3.0\ide\VisualC2010 and run fltk.sln
  4. Right click it and click build
  5. It should complete with no errors. If there are errors, I very much doubt this guide will help you.
  6. Once it's finished, you should be able to run it (will open windows).

Part 2 - Running your own project Assuming the build went correctly, you can now follow these steps:

  1. Launch MSVC++2010
  2. File>New>Project - Select Win32 Project and name

       FLTK-Test3
    

  3. Click next on the wizard then Application type: Keep as Windows application Additional Options: Empty project Click finish

  4. Right click source files on the solution explorer, add

       FLTK-Test3.cpp
    

  5. Right click FLTK-Test3 and go into properties

    a) Configuration Properties>C/C++>Command Line>Additional Options - add

        /Ic:\fltk-1.3.0
    

    b) Configuration Properties>Linker>Input>Additional Dependencies> This is the hardest part, you need to add

        c:\fltk-1.3.0\lib\fltkd.lib;wsock32.lib;comctl32.lib;c:\fltk-1.3.0\lib\fltkjpegd.lib;c:\fltk-1.3.0\lib\fltkimagesd.lib;
    

    to the end of the line (replacing the #() information. My change resulted in this, yours might be different -

      kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;c:\fltk-1.3.0\lib\fltkd.lib;wsock32.lib;comctl32.lib;c:\fltk-1.3.0\lib\fltkjpegd.lib;c:\fltk-1.3.0\lib\fltkimagesd.lib;
    

the 'd' at the end of the .lib file indicates debug, so for final build I think you are supposed to include the ones without the 'd'. So ..fltkjpeg.lib not ..jpegd.lib.

If this section works properly, when you add the first #include line of the code, it shouldn't be underlined. If it is, theres a problem.

c) You may also have to do this (if it doesnt run)

Configuration Properties>Linker>Input>Ignore Specific Default Libraries>

    libcd.lib

  1. Once all this has been completed, you should be able to add the full code below -

    #include <FL/Fl.h>
    #include <FL/Fl_Window.h>
    
    int main()
    {
     Fl_Window win(320,200);
     win.show();
     return Fl::run();
    }
    

Enter the code above, and run.

I still got a ton of errrors, -

  'FLTK-Test3.exe': Loaded 'C:\Users\USER\Documents\Visual Studio 2010\Projects\FLTK-Test3\Debug\FLTK-Test3.exe', Symbols loaded.
  'FLTK-Test3.exe': Loaded 'C:\Windows\SysWOW64\ntdll.dll', Cannot find or open the PDB file
  'FLTK-Test3.exe': Loaded 'C:\Windows\SysWOW64\kernel32.dll', Cannot find or open the PDB file
  'FLTK-Test3.exe': Loaded 'C:\Windows\SysWOW64\KernelBase.dll', Cannot find or open the PDB file
  'FLTK-Test3.exe': Loaded 'C:\Windows\winsxs\x86_microsoft.windows.common- controls_6595b64144ccf1df_5.82.7601.17514_none_ec83dffa859149af\comctl32.dll', Cannot find or open the PDB file
  'FLTK-Test3.exe': Loaded 'C:\Windows\SysWOW64\advapi32.dll', Cannot find or open the PDB file
  'FLTK-Test3.exe': Loaded 'C:\Windows\SysWOW64\msvcrt.dll', Cannot find or open the PDB file
  'FLTK-Test3.exe': Loaded 'C:\Windows\SysWOW64\sechost.dll', Cannot find or open the PDB file
  'FLTK-Test3.exe': Loaded 'C:\Windows\SysWOW64\rpcrt4.dll', Cannot find or open the PDB file
  'FLTK-Test3.exe': Loaded 'C:\Windows\SysWOW64\sspicli.dll', Cannot find or open the PDB file
  'FLTK-Test3.exe': Loaded 'C:\Windows\SysWOW64\cryptbase.dll', Cannot find or open the PDB file
  'FLTK-Test3.exe': Loaded 'C:\Windows\SysWOW64\gdi32.dll', Cannot find or open the PDB file
  'FLTK-Test3.exe': Loaded 'C:\Windows\SysWOW64\user32.dll', Cannot find or open the PDB file
  'FLTK-Test3.exe': Loaded 'C:\Windows\SysWOW64\lpk.dll', Cannot find or open the PDB file
  'FLTK-Test3.exe': Loaded 'C:\Windows\SysWOW64\usp10.dll', Cannot find or open the PDB file
  'FLTK-Test3.exe': Loaded 'C:\Windows\SysWOW64\msvcr100d.dll', Symbols loaded.
  'FLTK-Test3.exe': Loaded 'C:\Windows\SysWOW64\comdlg32.dll', Cannot find or open the PDB file
  'FLTK-Test3.exe': Loaded 'C:\Windows\SysWOW64\shlwapi.dll', Cannot find or open the PDB file
  'FLTK-Test3.exe': Loaded 'C:\Windows\SysWOW64\shell32.dll', Cannot find or open the PDB file
  'FLTK-Test3.exe': Loaded 'C:\Windows\SysWOW64\ole32.dll', Cannot find or open the PDB file
  'FLTK-Test3.exe': Loaded 'C:\Windows\SysWOW64\imm32.dll', Cannot find or open the PDB file
  'FLTK-Test3.exe': Loaded 'C:\Windows\SysWOW64\msctf.dll', Cannot find or open the PDB file
  'FLTK-Test3.exe': Loaded 'C:\Windows\SysWOW64\uxtheme.dll', Cannot find or open the PDB file
  'FLTK-Test3.exe': Loaded 'C:\Windows\SysWOW64\dwmapi.dll', Cannot find or open the PDB file
  'FLTK-Test3.exe': Loaded 'C:\Windows\SysWOW64\clbcatq.dll', Cannot find or open the PDB file
  'FLTK-Test3.exe': Loaded 'C:\Windows\SysWOW64\oleaut32.dll', Cannot find or open the PDB file
  'FLTK-Test3.exe': Loaded 'C:\Windows\SysWOW64\msimtf.dll', Cannot find or open the PDB file
  'FLTK-Test3.exe': Loaded 'C:\Windows\SysWOW64\version.dll', Cannot find or open the PDB file
  'FLTK-Test3.exe': Unloaded 'C:\Windows\SysWOW64\msimtf.dll'
  'FLTK-Test3.exe': Unloaded 'C:\Windows\SysWOW64\version.dll'

.. but it ran!

Hope that helps.

这篇关于Microsoft 2010可视化c,安装FLTK的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆