Thread: Compiling and Screen Maximization Questions

  1. #1
    Registered User
    Join Date
    Jun 2008

    Compiling and Screen Maximization Questions

    I have two relatively simple problems to solve. I'm using Visual C++ as my compiler. I have my code written and it runs fine when I build, compile, and debug it. However, when I set the configuration manager to release, I receive errors that say the source file is not linked to the appropriate header files. I want to compile my program such that I can run it as a stand-alone .exe. The error is: error LNK2001: unresolved external symbol _cbDeclareRevision@4. The header files are in the headers folder and the program works in debug configuration, I'm a little confused why it does not work when in release configuration. Is there another way to create a stand-alone executable function of my program? In addition, my program calls GnuPlot using the system() command. GnuPlot then opens a .txt that plots my data from a .dat file. I would like the ensuing plot to be maximized on the screen. I was wondering if anybody knew a system() command to maximize the current window, or, although not related to this forum, a command for GnuPlot that would maximize or full screen the plot. My program reads data from an analog-digital converter and then plots the data and does a simple analysis. It is a basic program that I am working the kinks out on before I try to implement a real time system. Any help is appreciated, this will be my first real time program.

    #include <iostream>
    using std::cerr;
    using std::endl;
    #include <windows.h>
    #include "..\cbw.h"
    #include <stdio.h>
    #include <conio.h>
    #include <fstream>
    using std::ofstream;
    #include <cstdlib>
    using namespace std;
    int main ()
       int I, J;
       int peak;
       int trough;
       int L=0;
       int sum=0;
       int ave=0;
       int BoardNum = 0;
       int ULStat = 0;
       int LowChan = 0;
       int HighChan = 0;
       int Gain = BIP5VOLTS;
       long Count = 4001;
       long Rate = 500;
       WORD ADData[4001];
       unsigned Options=CONVERTDATA;
       float    RevLevel = (float)CURRENTREVNUM;
       ULStat = cbDeclareRevision(&RevLevel);
       cbErrHandling (PRINTALL, DONTSTOP);
       printf ("Demonstration of Scanning Data\n");
       ULStat = cbAInScan (BoardNum, LowChan, HighChan, Count, &Rate,Gain, ADData, Options);
    	   for (J = 0; J < 1; J++)
    			ofstream outdata;"Data.dat");
    			for (I = 0; I < 2000; I++)
    				outdata<<""<<I<<" "<<ADData[I*2+J]-2046<<""<<endl;
    					if (ADData[I*2+J]-2046>peak)
    			printf("\n\nThe number of collected data values is %d",L);
    			printf("\nThe sum of the data values is %d",sum);
    			printf ("\nThe average is %d",ave);
    			printf("\nThe peak value is %d",peak);
    			printf("\nThe trough value is %d",trough);
    			system("wgnuplot.exe activator.txt");

  2. #2
    Registered User
    Join Date
    Apr 2008
    You don't link to header files, you link to object files and libraries. I'm guessing your Debug configuration doesn't specify the same libraries as the Release configuration.

  3. #3
    Registered User
    Join Date
    Jun 2008
    Excellent, I added the same libraries to the release configuration and my program runs smoothly. Thanks medievalelks. In addition, I was wondering if anyone knew how to maximize the plot in GnuPlot or had any tips for working in real time 2D graphing.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Compiling sample DarkGDK Program
    By Phyxashun in forum Game Programming
    Replies: 6
    Last Post: 01-27-2009, 02:07 AM
  2. Hiding prompt screen
    By Utopus in forum Windows Programming
    Replies: 4
    Last Post: 07-26-2007, 02:12 AM
  3. Problems compiling this SDL app
    By Rider in forum C++ Programming
    Replies: 3
    Last Post: 03-27-2007, 12:22 PM
  4. Blank output screen after compiling C.
    By thunderdome in forum C Programming
    Replies: 2
    Last Post: 01-19-2006, 05:53 PM
  5. Compiling in Unix vs Visual C++
    By stimpyzu in forum C++ Programming
    Replies: 2
    Last Post: 09-30-2002, 06:41 AM