Why not call DllEntryPoint in C++ Builder? - winapi

I've create DLL project in RAD studio Seatle C++ Builder and I've checked checkbox that "link with runtime packages" and added to Project Options -> C++ Linker -> Additional options "midas.lib"
"Runtime package import libraries" of DLL project like that.
adortl;appanalytics;bcbie;bcbsmp;bindcomp;bindcompdbx;bindcompfmx;bindcompvcl;bindengine;CloudService;compont1;compont4;CustomIPTransport;DataSnapClient;DataSnapCommon;DataSnapConnectors;DatasnapConnectorsFreePascal;DataSnapFireDAC;DataSnapIndy10ServerTransport;DataSnapNativeClient;DataSnapProviderClient;DataSnapServer;DataSnapServerMidas;dbexpress;dbrtl;dbxcds;DbxClientDriver;DbxCommonDriver;DBXDb2Driver;DBXFirebirdDriver;DBXInformixDriver;DBXInterBaseDriver;DBXMSSQLDriver;DBXMySQLDriver;DBXOdbcDriver;DBXOracleDriver;DBXSqliteDriver;DBXSybaseASADriver;DBXSybaseASEDriver;dsnap;dsnapcon;dsnapxml;emsclient;emsclientfiredac;FireDAC;FireDACADSDriver;FireDACASADriver;FireDACCommon;FireDACCommonDriver;FireDACDb2Driver;FireDACDBXDriver;FireDACDSDriver;FireDACIBDriver;FireDACInfxDriver;FireDACMongoDBDriver;FireDACMSAccDriver;FireDACMSSQLDriver;FireDACMySQLDriver;FireDACODBCDriver;FireDACOracleDriver;FireDACPgDriver;FireDACSqliteDriver;FireDACTDataDriver;fmx;fmxase;fmxdae;fmxFireDAC;fmxobj;FMXTee;FmxTeeUI;GifImagePack;ibmonitor;ibxbindings;ibxpress;IndyCore;IndyIPClient;IndyIPCommon;IndyIPServer;IndyProtocols;IndySystem;inet;inetdb;inetdbxpress;Intraweb;Package5;RESTBackendComponents;RESTComponents;rtl;soapmidas;soaprtl;soapserver;svn;Tee;TeeDB;TeeUI;tethering;TGrfButton;Utils;vcl;vclactnband;vcldb;vcldsnap;vclFireDAC;vclib;vclie;vclimg;VCLRESTComponents;vclribbon;VclSmp;vcltouch;vclwinx;vclx;xmlrtl
I'm loading this DLL in EXE like that.
LoadLibrary(L"MyDll.dll");
When I debuging DLL,DllEntryPoint method is not called.
int WINAPI DllEntryPoint(HINSTANCE hinst, unsigned long reason, void* lpReserved)
{
return 1;
}
when I removed midas.lib or any .lib DllEntryPoint is called.
I don't understand different
any idea ?

midas.lib has no need to add.Because dsnap has already been added.
I removed midas.lib from Additional options(C++ Linker)

Related

Visual studio doesn't recognize Allegro 5 add ons

I am new to Allegro 5 and Visual Studio... I'm trying to run a simple code:
#include <allegro5/allegro.h>
#include <allegro5/allegro_image.h>
int main(){
al_init();
al_init_image_addon();
return 0;
}
And it returns an error:
LNK2019 Unrecognized external symbol __imp__al_init_image_addon referred in function _main
I already install Allegro5 from NuGet packages and enable add ons on project properties... but it still doesn't work...
Please if anyone has a solution, tell me, because I am breaking my head thinking it xD
If I delete the line al_init_image_addon(); it works perfectly and also U can create and destroy displays, for example... but the add ons simply doesn't work.
Kudos for using allegro :)
I think I once had a similar issue, try this:
Make sure you have the Allegro and AllegroDeps (both by allegro developers installed via nuget).
Right click on your 'project' (not solution) in the 'Solution Explorer' (normally on the right hand side) and go Properties.
There should be an 'Allegro 5' section:
Be sure to toggle 'Image Addon' to 'Yes' (and depending on what other addons you want turn them to yes too).
Hope this helps :)

How to set up Xcode5 to use a framework bundle in C++ Application

I am trying to set up Xcode5 to create a C++ application which uses the libspotify.framework SDK. I have tried several combinations of adding the framework to the build phases, changing search paths, etc. The program will build but it fails at runtime throwing an error (below).
So far, in my programming experience, I have been able to link static libraries into Xcode C++ programs, but this is the first time I am trying to link a *.framework library into a C++ program.
Can anyone point out the step-by-step instructions on how to include a *.framework in a simple C++ console application? I'm pretty sure this is a "C" library so it should be possible, right?
Simple program:
#include <iostream>
#include "api.h"
int main(int argc, const char * argv[])
{
// do some simple thing with the api
return 0;
}
Runtime Error:
dyld: Library not loaded:
#loader_path/../Frameworks/libspotify.framework/libspotify
Referenced from:
/Users/mjb/Desktop/SpotifyTest/DerivedData/SpotifyTest/Build/Products/Debug/SpotifyTest
Reason: image not found Program ended with exit code: 9(lldb)
Screenshot of the Xcode Project:
Follow the instructions from the README file provided with libspotify. I have included these below:
Drag and drop libspotify.framework to the "Frameworks" group in the project navigator. Check "Copy items into destination groups's folder (if needed)".
In the project navigator, select your project. Select your target and select the "Build Phases" tab.
Click on "Add Build Phase->Add Copy files".
Select Destination "Frameworks" in the "Copy Files" group.
You probably want to rename this build phase by double clicking on the title. Name it something like "Copy Frameworks".
Drag libspotify.framework from the project navigator and drop it in the "Copy Frameworks" group.
Build. You can confirm that the above worked by right-clicking on your .app under Products in the project navigator and and selecting "Show in Finder" in the menu. Right-click on the application bundle and choose "Show Package Contents". Verify that have a Contents/Frameworks/libspotify.framework folder in there.
When you include the API header, do it like this:
#include <libspotify/api.h>

Jump to Definition goes to derived data folder for static library's header files instead of the static library project

I have an iOS app that has a static library as a dependency. The static library is setup per Apple's recommendations https://developer.apple.com/library/ios/technotes/iOSStaticLibraries/iOSStaticLibraries.pdf
Sometimes when I use "Jump to Definition" on a symbol from the static library I end up in the header file that has been copied to the derived data folder of the app instead of the header file inside the static library project. Other times things work perfectly.
When "Jump to Definition" fails more often than not I delete the derived data folder for the project through the Organizer window and this seems to fix the problem temporarily.
Does anyone know if there is a way to tell Xcode to exclude the derived data folder from "Jump to Definition"?
select 'Build Phases' -> 'Target Dependencies';
add your static library .

VS 2005 Symbol mapping does not work in case of #ifdef

I am using VS 2005 as my IDE. Most of my source code uses pre-processor #ifdef. All the macro definitions that control #ifdef are present in a header file. Visual studio shows the code under #ifdef grey'ed out. Although the header file where the macros are defined is included in the source file. This is annoying since visual studio also will not create symbol mapping for the code it does not see. So in order to look for definition of a symbol I need to manually go and check it. I had added the header file where the macro definitions are present to the project. Also my include directories contain location of this file. Can someone tell my why would VS not recognize the macro definitions?
E.g.
File source.c
#include "defines.h"
#ifdef MY_DEFINE
int my_global = 0;
void foo(void)
{
printf("I am here");
}
#endif
File defines.h
#define MY_DEFINE
VS will show all the code under #ifdef as grey. If I want to check definition of my_global from other file I can not.

How could I specify a conditional compilation symbol within a MonoDevelop 2.8 project template (.xpt.xml)?

Something similar to (picked from a .csproj)
<DefineConstants>DEBUG; ANDROID</DefineConstants>
Right click the project, go to Options -> Build -> Compiler. You can add the constants where it says Define Symbols.

Resources