I downloaded some code from codeproject … this allow me to have an "Themed Windows XP style Explorer Bar" incorporated in my project — when i build it — everything is fine – but when i run the program a get a message like obj\Debug\XPExplorerBar.dll' doesn't contain any UserControl types. Can anyone help..
Obj\Debug\XPExplorerBar.dll’ doesn’t contain any UserControl types
dll
Related Solutions
Your commands are wrong !
Go to the directory where your main.cpp file is, and try the following.
g++.exe -Wall -c -g main.cpp -o obj\Debug\main.o
g++.exe -static -static-libgcc -static-libstdc++ -o "bin\Debug\Hello World.exe" obj\Debug\main.o
then you'll no longer need to copy the DLLs (for your Hello World program).
Other notes:
The MinGW installation instructions recommends setting
c:\minGW;c:\MinGW\bin;
to the PATH environment variable.
Normally the
-static -static-libgcc -static-libstdc++
linker options should work (try all 3 of them at once). But not for libwinpthread-1.dll
.
Also, try to clean
before recompiling.
There's no "-static-something" command.
Only standard libraries libgcc and libstdc++ can be set to static linking.
For other libraries, you first switch to static linking with "-static" and then list the libraries to include with separate commands, i.e. "-lpthread".
Cmake users should try adding:
set(CMAKE_CXX_STANDARD_LIBRARIES "-static-libgcc -static-libstdc++ -lwsock32 -lws2_32 ${CMAKE_CXX_STANDARD_LIBRARIES}")
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,-Bstatic,--whole-archive -lwinpthread -Wl,--no-whole-archive")
A lot of these instructions are out of date because they recommend the win32-ssl-devel-msvc package for curl, which no longer exists.
The following instructions allow you to build libcurl using only:
- Visual Studio 2013
- curl generic source tarball (tested on curl 7.44.0).
A. Build libcurl static library
- Download the latest curl generic source from: http://curl.haxx.se/latest.cgi?curl=tar.gz
- Extract the source to a local directory (we'll be using
C:\libcurl
) - Open a command prompt
"C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\bin\vcvars32.bat"
To initialize your VC environment variables (adjust your VS 2013 installation directory as needed)cd C:\libcurl\winbuild
nmake /f Makefile.vc mode=static VC=12
- The build should appear in
C:\libcurl\builds\libcurl-vc12-x86-release-static-ipv6-sspi-winssl
B. Link Against libcurl in Visual Studio
- In Visual Studio, right click your project in Solution Explorer, then click "Properties"
- Configuration Properties > C/C++ > General > Additional Include Directories: add
C:\libcurl\builds\libcurl-vc12-x86-release-static-ipv6-sspi-winssl\include
- Configuration Properties > C/C++ > Preprocessor > Preprocessor Definitions: add
CURL_STATICLIB
- Configuration Properties > Linker > General > Additional Library Directories: add
C:\libcurl\builds\libcurl-vc12-x86-release-static-ipv6-sspi-winssl\lib
- Configuration Properties > Linker > Input > Additional Dependencies: add
libcurl_a.lib
C. Call libcurl from Your Project
The following sample shows a call to libcurl:
#include "stdafx.h"
#include <curl/curl.h>
void main(int argc, char* argv[])
{
CURL *curl = curl_easy_init();
if (curl) printf("curl_easy_init() succeeded!\n");
else fprintf(stderr, "Error calling curl_easy_init().\n");
}
Best Solution
Right-click on the project > Set as Startup Project.