C++ :: VS 2012 Lib And DLL File Exported In Different Directories
Apr 3, 2014
I have a program where I want to export the .lib file in a "Lib" folder, and the .dll file in the "bin" folder. How can I choose where the lib file and .dll file go?
I'm stuck on unix system programming and am beginner about it. Assume that there is a directory which X. There are a file(text1.txt) and another directory which is Y in X. Last, there are two files(text2.noExtension) and text3.noExtension) and another directory which is Z in Y. My goal is that read files and enter directories until there is no directory. How to go on. Example:
Code:
#include <stdio.h> #include <dirent.h> int main (int c, char *v[]) { struct dirent *pDirent; DIR *pDir; if (c < 2) { printf ("Usage: testprog <dirname>"); return 1;
I am using visual studio 2012.....in below code i m writing data in to a test.txt file but i dont know with which key file stop accepting char...i tried ctrl+z and ctrl+d but not working ....
I built a C++ static library using WatCom IDE. It compiles without error, but running WLIB on it produces the msg:
Warning! Library contains no external symbols My WatCom compiler host is windows, & target is DOS.
If I convert the Library to an .exe program, by adding a main(), it executes fine, So there seems to be something I'm missing in the IDE settings for building a .lib.
My problem is my edit distance values are stored in a 2d array of ints and exported to a .csv and the ones at the end are rather LARGE.
The the edit distance max should be around 2000 but i am getting values of 1-100million, the weird thing is that I have checked back through my function and tested various parts of it and still dont understand where it is going wrong i thought it could be my memcpy and memmove parts but i have had no luck.
I'm building a cross-platform library which links to some other 3rd party libraries at run time (i.e. on Windows, the other libs will be available as DLLs whereas on Linux / OS-X etc they'd be shared objects, which are similar). For the sake of argument, one of those libraries is called "jack".
Obviously, our app can't guarantee which version of the other libs will be on the user's system (or even that they'll be installed at all). So our code is littered with statements like this:-
Code: if (!jack_port_type_get_buffer_size) { warning << _("This version of JACK is old - you should upgrade to a newer version") << endmsg; } else { some_var = jack_port_type_get_buffer_size(); }
We link to the latest version of jack, where that symbol is declared like so:-
Code: size_t jack_port_type_get_buffer_size();
One problem is that it doesn't even seem to be an exported symbol (although that wouldn't affect the other platform builds). But apart from that, our customer might have an old copy of jack installed or even no copy! We seem to be making the assumption that if our customer has an up-to-date version, jack_port_type_get_buffer_size will be set to a valid address - but in all other case it'll be magically set to zero (there's nothing in our code that sets it to zero).
If I rename a control, when I build, I get an error because deep in the code, the old name exists, but my rename doesn't change the old name. Am I doing rename wrong? (I just go to "Name" in properties and type the new name.)
Same idea with control deleting. So I add a control (textBox, label, whatever). I later decide to delete the control. When building, it still has code for the old control and won't let me proceed.
So I am using Visual Studio 2012 Professional, this is C++ code. I am just trying to get the remainder from a very simple division. Nothing difficult, heres the code:
double getProbability(){ int rd = random(); int max = numeric_limits<int>::max(); double result = rd % max; cout << "Probability: " << result << " "; return result; }
When I look at the values in debug I get:
max 2147483647 rd 1804289383 result 1804289383.0000000
That is completely wrong. The answer should be 0.840188. What is going on here?
random() just returns a number from a vector that was prepopulated with "random" integers. Not really random, but that isn't all that important. What is important is why on earth is a % operation returning such a huge number. I assigned the values to variables so I could look at them in the debugger. I know I am going to probably get a thousand different ways that I could do this "better" but again, that isn't what I am looking for. I would just like to know why the % operation is doing what it is doing?
I am trying to include library paths in VS 2012 through the new property pages.I downloaded and installed mpich2-64 bit libraries under "C:Program FilesMPICH2include" and set the include path in Microsoft.cpp.x64.user property file so the path now looks like
So first, I'm sending files from a server to a client. Basically, the server says "Incoming file" and tells the client "The name of the file is: ". So taking the name, I need to create folders, if they don't exist, for the received file to be placed in (since std::ofstream doesn't allow creating directories).
My current code below is working. My trouble is listed below the code.
std::stringstream ss (name); //name is the recv'd name std::string token;
I've been getting these errors on two computers through four different compilers. It seems the directories arnt set up. If that's the cause, I have no clue how to resolve that.
Its a very simple prog too; it just calculates a dist, using dist formula.
#include <cstdlib> #include <iostream> #include <math.h> using namespace std; void calcDistance (int x1, int y1, int x2, int y2);
I have two report.h files located in two different directories. However the contents of them are different. How can I include the report.h file located in guarddog into the report.h file located in sky?
For each project in a VS solution it's possible to stipulate per-project folders that get searched in addition to the folders that you've set globally for Visual Studio.
Which folders take priority? Do the project's folders get searched first? Or do the global folder get searched first? Or is it possible to select one set as having priority over the other?
I am currently working on a program that will take an image and compare it with all other images in the current directory and sub-directories. I decided to use Qt for this as Qt has a QImage class with an overloaded == operator. This seems to work well if there are duplicates of the same size.
However, my goal is to not only find duplicate images of the same size, but the same image which may be a different size. To do this, I shrink the larger image to the size of the smaller image using the QImage scaled function.
The concern I have with this is that the scaling isn't done the same way the smaller image may have been scaled. I tested this by shrinking a copy of a picture in Paint, that image does not get deleted. I believe that == is looking for an identical image, so when I do the shrinking (via that scaled function), even if it is of the same picture I shrunk in Paint, the two methods of shrinking are not identical, and so the images appear different.
Any better method I can try? Something that can allow for slight deviations, such as an image being 99% "the same" as another. (I admit here that I will need to define some metric for what "the same" means.) In this case, the method assumes they are "identical" and gets rid of one of them.
The main way I can think of doing this is to go through each image, one pixel at a time. If the two pixels from the different images at the same index are the same, then I can increment a same pixel counter. If this number is 99% (or some other threshold) of the total pixel count, I can make the assumption the images are the same.
// Make sure there are no errors hIConnect = InternetConnect(hInternet,"192.168.1.4", 211, "******", "*****", INTERNET_SERVICE_FTP, INTERNET_FLAG_PASSIVE, 0);
I'm very new to MFC & VisualC++. I'm using MSVS2010 Pro. I am trying to write/debug a simple form that saves and restores the content of some edit controls. It seems to work as expected, except the file saves only to the Project Folder, regardless of where I browse and select to save the file.
Code: void CMFC_FileDialogDlg::OnBnClickedbtnsave() { this->UpdateData(); CFile f; //Kinda Correct, Works but still saves in Project Folder BOOL b_OpenFileDialog = FALSE;//this doesn't act as bool in CFileDialog?
[Code] ....
My only experience is a little simple VB programming in Excel, so any specific examples??? Also, rules seem to change from version to version? I have to "update" a number of undocumented programs.
I have written a C++ program I have multiple of CSV file used as input, which I open one at a time and close it after extracting data to a output file which is the only file.
I run getline(inFile,line); outFile << line << endl;
I run this code, and only part of it is goes to the output file I got, also have spacing randomly to specific file and inconsistent
But when I slower the code, like system("Pause") in the loop, I can get extract what I want perfectly....
Is my program running to fast, why getline would be skipping part of what things I want?
One of my class assignments is to create a program that receive a .txt file containing a students name and their grades as follows:
John K. 99, 87, 57, 89, 90, 95 Amanda B. Jones 100, 88, 76, 99, 86, 92 etc..
The number of students is unknown until run time. You have to take those grades and average them weighing the first (4) at 10% a piece and the last (2) at 30% each.
Then return an output file with the students name and their letter grade A,B,C,D,F based on their computed score. In addition, on screen it needs to display the average scores for each Q1, Q2, etc. as well as the minimum and maximum for each test on the screen. I am having a hard time in assigning the scores to a variable so that they can then be computed as an average and then used to determine a letter grade. I have begun to write the code and am a bit stuck..here's what I have so far:
The Objective Of This Program Is To Create A File To Write Text And Read Back The File Content. To Do That I Have Made Two Function writeFile() To Write And readFile() To Read.The readFile() function works just fine but writeFile() doesn't.
How writeFile() function Works? when writeFile() function Execute It Takes Characters User Type And When Hit Enter(ASC|| 10) It Ask "More?(Y/N)" That Means What User Want? Want To Go Next Line Or End Input?
If "Y" Than Inputs Are Taken From Next Line Else Input Ends.
But The Problem Is When Program Encounters ch==10 It Shows "More?(Y/N)" And Takes Input In cmd variable.If cmd=='Y' I Mean More From Next Line Than It Should Execute Scanf Again To Take ch I Mean User Input.But Its Not!!! Its Always Showing "More?(Y/N)" Again And Again Like A Loop.
Code: #include <stdio.h> void writeFile(void); void readFile(void); int main(){
I'm writing a program that stores records into a file and then these records can be printed out. A last name, first name, and score is stored to be exactly 36 characters long (using leading spaces to pad) making it easier to retrieve specific records. For example, three records stored in the file would like like this: (the underscores are simply to illustrate the distance, they are not in the file itself)
When printed out, the names are formatted as follows:
lastname, firstname: 90 lname, fname: 100 last, first: 60
However, when I print them out this is what I get:
lastname, firstname: 90 lname, fname: 100$ last, first: 60H
For some reason, for any record after the first, an extra character is added to the end. These characters are not in the file, so I was thinking that the array for some reason wasn't being filled completely, (the array is initialized to size 36 and 36 characters are read from the file using fread) so it was printing out a random character assigned to the 36th array position. Except the character never changes, (always a $ for record 2, H for record 3, l for record 4 if i remember) and I've tried reducing the array size or the number of character read and it's the string that gets altered, the random character always remains. I figure the problem must be in the print_records function (appending seems to work no problem). Anyway here is my print records and appending records code.
Code: /* - Prints a single record stored in the file pointed to by ifp. */ void print_record(FILE *ifp, int record) {
I have almost a hundred names in a text file that I want to convert to email addresses and save to another file. I seem to have it working, but it doesn't print the full names in the email prefix. The output I'm looking for is Doe_John@livebrandm, but I'm only getting D_J@livebrandm. I'm not sure what I should specifically be reading up on that applies to this directly.