I have a C++ application which connects to a MySQL server.
It all works fine.
Currently it uses libmysql.dll.
At build time I link to libmysql.lib.
As far as I understand I can link to mysqlclient.lib instead and get rid of the dependency of libmysql.dll, i.e have the functionality embedded within my exe.
My question is: Where can I find the source to build mysqlclient.lib ?
When debugging the app when it's linked to mysqlclient.lib and stepping into mysql_library_init() for example the debugger (VC++ 2008) asks for the file "f:\build\mysql-5.0.67-winbuild\mysql-community-nt-5.0.67-build\libmysql\libmysql.c".
Note: libmysql.lib & mysqlclient.lib are included in the installation of MySQL.
IIRC, it's a part of the MySQL source code: http://dev.mysql.com/downloads/mysql/#downloads
Related
I am working with MPLAB X which for those who don't know an IDE based on Netbeans. We are also using Git with continuous integration. I have now started to work in several different tests for our projects.
For example, MPLAB lets you choose which encoding you want to use in your projects and UTF-8 is not the default option so from time to time we would find problems opening the projects in different platforms. Now I test that every source code file is properly encoded.
We would also like to check code formatting and style. From what I've seen Netbeans comes with a tool to format code for you, but I don't see how to run this tool to print formatting mistakes as a test in our server. I have also seen that there are many tools like uncrustify that should be able to run in our server but they are not integrated with our IDE.
I would prefer not to maintain two different configuration files for this task, for this reason I am asking if anybody knows if there is a tool that can be run both in a Linux based server and that can be integrated with Netbeans for this task.
I'm a rookie at C in general and VS 2013 also. I am trying to use some C code provided by a vendor in VS 2013 express. It compiles and runs without problem using the command line compiler but I would like to use the IDE.
I started a new project, C++ for console app, and I have pasted the code into the IDE and saved it as xyy.c so that it builds successfully. I thought it would be nice to have it in a GUI, so I duplicated the effort with a Win32 app project. It also builds.
The program's job is to connect to a PCI card that has Plx chip as an interface and program an FPGA. The Win32 program succeeds, even though I can't see any of the info printed by the program. The console program fails and I think it is because it fails to find the driver for the Plx chip. I thought I would get a clue by single stepping through the Win32 program to see which driver was supposed to be found.
However, after the first pass through a while loop, I get a pop up that says "Source Not Found" and "stack.cpp not found". Google wasn't any help to me.
I be grateful for any suggestions.
You might have "Enable .NET Framework source stepping" enabled (see http://msdn.microsoft.com/en-us/library/cc667410.aspx). So when you are at Stack... and trying to step into, it will actually try, but you don't have the sources for that. There is also a new experience for using the .NET framework reference source that was announced recently: http://blogs.msdn.com/b/dotnet/archive/2014/02/24/a-new-look-for-net-reference-source.aspx
I faced the same problem. I advise at the moment of receiving the information "stack.cpp not found" to look at the stack trace and check if there is something like this: "RTC".
If there is, you need to change the flag along the path (for example, set the Default or a more convenient configuration for you):
Project Properties -> C/C++ -> Code Generation -> Basic Runtime Checks
More details: https://learn.microsoft.com/en-us/cpp/build/reference/rtc-run-time-error-checks?view=msvc-160
I would like to practice and prepare to use a server-based PostgreSQL database, for an upcoming school assignment.
The assignment will require me to write programs in C that can execute a variety of queries, as well as check their validity, etc.
I cannot find any definitive guide online to setting up PostgreSQL with Visual Studio and C.
I understand that I need to use a libpq-fe header file but when I download it from PostgreSQL and #include it, I still get linking errors and more. It's a mess.
Can someone guide me (and future users with this problem) through the process of setting this up?
You can't just download libpq-fe.h and expect to use it without anything else.
You must use libpq - include at least libpq-fe.h, link to libpq.lib and ensure that libpq.dll is present in the program runtime path. On Visual Studio that means editing your include path and library path, then adding libpq to the linker list.
I usually do a source build of PostgreSQL when I'm working with libpq, but I'm pretty sure the library and headers are included in the binary install as well. Check the install directory.
First of all you need to read this : http://pqxx.org/development/libpqxx/browser/trunk/win32/INSTALL.txt
This will tell you how to install or build libpq on your computer.
Personally, I just install PostgreSQL for Windows from the PostgreSQL official website.
This should avoid the need for building libpq.
Now that you have all the required files libpq.lib, libpq-fe.h,libpq.dll etc...You have to set the properties page of your VS project correctly i.e do exactly as specified in the INSTALL.TXT
Once the properties pages is set correctly add :
#include <string>
#include "libpq-fe.h"
#pragma comment(lib, "libpq.lib")
For further information read this tutorial : http://www.askyb.com/cpp/c-postgresql-example/
'Hi all, I downloaded Xilium.CefGlue and built the source on Visual Studio (xilium-xilium.cefglue-b22787699e57), I also downloaded cef_binary_3.1453.1236_windows_xilium and copied the libcef.dll to the Xilium Winforms demo as the apps requires it to run but when I run it I get the following error:
An attempt was made to load a program with an incorrect format.
Exception from HRESULT: 0x8007000B
I've targeted x86, can I get some help?
Thanks
Ok, here's the steps I used to get the samples working in VS 2012:
Get the code from Xilium.CefGlue on github. (The one I used was c3d674a3a8)
Open the Xilium.CefGlue solution in VS2012
Remove or don't build the CefGlue.Demo.GtkSharp project (it didn't interest me & I didn't have the needed libraries)
In the Configuration Manager, select Active Solution Platform to be x86
Ensure that the target framework settings cooperate between projects. (e.g. CefGlue.Demo & CefGlue.Demo.WinForms by default are v2.0, but they depend on CefGlue which is v4.5) (For simplicity I set them all to v4.0 Client profile and it worked.)
Build solution — should succeed
Copy Xilium files from the unzipped cef_binary_3.1453.1236_windows_xilium to the output folder (bin\x86\Debug or bin\x86\Release). Minimum requirement seems to be:
libcef.dll and icudt.dll from .\Debug or .\Release
cef.pak and the locales\ folder from .out\Debug or .\Resources
Set CefGlue.Client as the StartUp Project
Run it
I would like to debug an instance of a SQLite database created from modified SQLite code. As a user selects some data from the database I'd like to step through the SQLite source code and see what the logic of SQLite is. The purpose for this is I would like to see if I can add a SELECT trigger to the SQLite source code and create a SQLite database with my new type of trigger in it. Currently SQLite only supports triggers on UPDATE, INSERT & DELETE.
So far I've downloaded the "amalgamation" SQLite source code from http://www.sqlite.org/index.html and managed to build it in Visual Studio 2010. I have no idea how to debug against it however. I tried creating a test C# web application that used the SQLite project as a project reference - but it won't let me add it as a reference (Throws an error saying "A reference to 'mySQLiteproj' could not be added" which is SOOO useful). My current structure is simply an empty C project with the sqlite3.c and sqlite3.h files in it.
The SQLite code is written in C, which I am unfamiliar with, so maybe I'm going completely down the wrong path? I am coming from a C# background so please don't suggest I scrap using Visual Studio and instead use Notepad or some other "hardcore" IDE :)
In short: How do I debug SQLite Source Code?
Edit: I've added the shell.c file to the project as suggested by Sergey and can now "sort of" debug. It will hit breakpoints in shell.c, but not sqlite3.c. I can step into sqlite3.c as a function call from shell.c, but the lines don't seem to match up with what code is running. Half the lines are greyed out (by resharper perhaps?) and there is no auto-watch of variables or highlighting of which line the code is currently breaking on.
To debug library code written on a language you "unfamiliar with", it is better to start from the beginning.
Here the algorithm:
Learn language (C)
Learn your tools (debugger in Visual Studio)
Learn the target (SQLite - is library which provides API for others, so you need set breakpoints on SQLite API for example sqlite3_open() and "Run" shell.c source file in Visual Studio)
I've created cmake-based build for SQLite amalgamation so you can generate Visual Studio solution, build it as Debug target and then debug. Hope it will be useful.