indigoscada编译记录之流水账

==================================================================================================

-------------------------------------------------------------2012.8.21-------------------------------------------------------------------------------------------------

单独编译modbus_master的时候,说找不到windows.h

尝试网上的一些方法,将vs2008安装光盘里的WCU\WinSDK\WinSDK_Build.exe用WinRAR解压,运行解压出的VistaClientHeadersLibs-x64.msi安装WinSDK,

安装在C:\Program Files\Microsoft SDKs\Windows\v6.0A,

再编译

又报新的问题了Project : error PRJ0003 : Error spawning ‘mt.exe’.

解决办法:

将安装光盘WinSDK目录里的程序都用rar解压出来安装一遍。

====================================================================================

------------------------------------------------------------2012.8.22-------------------------------------------------------------------------

随后,出现以下问题(debug模式下)

1>------ Rebuild All started: Project: modbus_master, Configuration: Debug Win32 ------
1>Deleting intermediate and output files for project 'modbus_master', configuration 'Debug|Win32'
1>Compiling...
1>cl : Command line error D8030 : INTERNAL COMPILER ERROR in ''

====================================================================================

clean后,rebuild整个解决方案:

--------------------------------------------------------------------------------------------------------------------------------

8>------ Rebuild All started: Project: scada, Configuration: Release Win32 ------
8>Deleting intermediate and output files for project 'scada', configuration 'Release|Win32'

......

8>c:\scada\src0820\common\smplhist.h(35) : error C2061: syntax error : identifier 'ostream'
8>..\common\smplhist.cpp(87) : error C2065: 'ostream' : undeclared identifier
8>..\common\smplhist.cpp(87) : error C2065: 's' : undeclared identifier
8>..\common\smplhist.cpp(88) : error C2448: 'SampleHistogram::printBuckets' : function-style initializer appears to be a function definition
....

--------------------------------------------------------------------------------------------------------------------------------

解决方法:

将smplhist.h中#include改为#include

=====================================================================================

--------------------------发现很多atlcom.h造成的错误--------------------------------------------------------------------------------------

---------------------------故准备采用atlport库------------------------------------------------------------------------------------------------

1.从 www.stlport.com 下载最新5.2.1版
2.解压到一个目录,用菜单下的 vs 提示符进入该目录
3.运行 configure msvc9
4.进入\build\lib里面 
nmake -f msvc.mak clean install

完毕.


5.测试 cd ../test/unit
    nmake install
    cd ../../../bin
    stl_unit_test
    stl_unit_testd
    stl_unit_teststld

================================================================================================

================================================================================================

用vs2008编译,又出现了各种蛋疼的问题,转而有投向vc6,毕竟作者的原项目是在vc6下的,modbus_master很顺利的就通过了。

然而,dnp3master的问题又来了,经过各种蛋疼的折腾,发现问题还是出在STLport上。

根据网上搜到的各种信息,总结如下:

1.必须将stlport放到vc环境的include中,而且要放在最上面

2.另外stlport底下的stl也要放到include里面

3.若项目有使用MFC,则需要把mfc的include放到include的最上面(即从上到下依次为:mfc\include、stlport、stlport\stl)

然后dnp3master编译通过!oh—yeah。。。(在进入七夕的夜晚,想着妹子,整着代码,真有意义啊。。。x)

===============================================================================================

 vc6下的release和debug版本都已编译通过,且测试可运行。

 

===============================================================================================

------------------------------------------------------转入VS2008版编译中------------------------------------------------------------------------------------

===============================================================================================

release版本已经全部通过,遇到的问题总结如下:

#1.qwtplugin无法找到‘qwt.lib’

  ###  处理办法:这个是build order错位导致的,调整顺序,即将qwt设为qwtplugin的依赖即可;

#2. vs2008必须抛开stlport,因为vs2008的stl已经很完善了 这其中就包括:

 ###a. 要换成+using namespace std

 ###b. 要换成

#3.vc6中默认变量为int,而vs2008必须指定变量类型

 ###将未指定变量类型的加上“int”;

#4.for(int i=0,,)的问题

 ###vc6默认for中的i可以在for结束后继续使用,而vs2008中必须对每个for都指定类型,或者将int i变量声明放到for的外面;

#5.ATL问题

 ###我的解决办法是安装KB971092补丁,网上的另一种解决方法是:项目-设置-配置设置-常规-使用动态ATL(这个没有测试);

#6.无法找到“dbase.lib”的问题

 ###原因在与从vc6转换到vs2008的过程中,貌似gigabase的outputfile信息丢失了

#################====---详细设置方法-----===##################

a. 项目gigabase点右键,linker-General-Output File:c:\scada\bin\dbased.dll

b.linker-Advanced-Import Library:C:\scada\lib\dbased.lib

#########################################################

#7.重定义问题,modbus-tcp.c有两处与windows的SDK的ws2tcpip.h中的内容重定义

 ###个人分析原因是vc6时代的SDK还没有自带重定义的那部分代码

 #########=====----此类问题的通用解决办法是“代码+配置”---====#####

 a.重定义的代码前必须要有一个“ifnde xxx”

 b.与6中一样,C/C++—Preprocesser—Preprocesser Definitions:XXX

 #############################################################

 

 

 

你可能感兴趣的:(Qt,vc)