[Edit: Resolved] dll function found under debug but not under release||...

Hi all,

I have a program that runs perfectly on debug settings. On release settings however, it doesn't compile.I use the VC 2008 express edition, with default debug and release settings. I use WINAPI.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
#include <windows.h>
#include "stdafx.h"
#include "polyhedra.h"
#include <stdio.h>
#include <string>
#include <sstream>
#include <fstream>
/*... in the middle of my code there is*/
	wsprintf( buff,  "X:%i",x);
/*... also*/

	case WM_CREATE:
			hRadioButtonDashes= CreateWindow("button","Dashes",
WS_CHILD | WS_VISIBLE | BS_AUTOCHECKBOX,0,75,80,20,hWnd,
(HMENU)RadioButtonDashesIndex,	hInst, NULL);


I get the following compiler errors (for the first piece of code):
error C2664: 'wsprintfW':Converting parameter 1 from char[100] to LPWSTR not possible

And for the second piece of code:
error C2664: 'CreateWindowExW': Converting parameter 2 from 'const char [7]' in 'LPCWSTR' not possible.

Has anyone encountered this problem before? Any advice ?

Thanks in advance!
Last edited on
closed account (z05DSL3A)
Your UNICODE settings are different in debug and release.
Thanks a lot! All fixed!

I thought UNICODE stood for "universal" i.e. no need to do any action for it to work LOL
[Edit: Resolved the problem! sorry for bothering you!]

Just got a new problem, this time a dll issue.

My project is a dll file. Under debug settings, my external testing program has no problem to open it. Under release settings however, the program properly loads the dll file, however, fails to find the (only) function that the dll provides.

The function is declared as:
file: rootSA.cpp
1
2
3
4
__declspec(dllexport) void _stdcall TestFunctionC(int* rankG, int* NumRoots, int* x, int* output)
{
/*some code here*/
}


I also have a .def file included in the project:

file: rootSA.def
1
2
3
4
 
LIBRARY rootSA
EXPORTS
	TestFunctionC


My compiler options are:
/O2 /Oi /GL /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_USRDLL" /D "ROOTSA_EXPORTS" /D "_WINDLL" /FD /EHsc /MD /Gy /Fo"Release\\" /Fd"Release\vc90.pdb" /W3 /nologo /c /Zi /TP /errorReport:prompt

My linker options are:

/OUT:"C:\math\rootFKFT\cpp\Release\rootSA.dll" /INCREMENTAL:NO /NOLOGO /DLL /MANIFEST /MANIFESTFILE:"Release\rootSA.dll.intermediate.manifest" /MANIFESTUAC:"level='asInvoker' uiAccess='false'" /DEBUG /PDB:"c:\math\rootFKFT\cpp\Release\rootSA.pdb" /SUBSYSTEM:WINDOWS /OPT:REF /OPT:ICF /LTCG /DYNAMICBASE /NXCOMPAT /MACHINE:X86 /ERRORREPORT:PROMPT kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib

Has anyone had a similar problem? Thanks in advance!

[Edit:] I just added

/DEF:".\rootSA.def"

order to the linker and it all worked! sorry for the fuss...
Last edited on
Topic archived. No new replies allowed.