News:

Masm32 SDK description, downloads and other helpful links
Message to All Guests
NB: Posting URL's See here: Posted URL Change

Main Menu

Linker error for GetOpenFileName

Started by garyhess, October 10, 2012, 01:12:19 AM

Previous topic - Next topic

garyhess

I'm using Easy Code / GoASM and trying to call GetOpenFileName as follows:

Invoke GetOpenFileName, Addr ofn

However, I'm getting the following linker error:

Linking...

Error!
The following symbol was not defined in the object file or files:-
GetOpenFileNameA
Output file not made

Errors ocurred.


I guess that I need to include some other header file that defines GetOpenFileName. Any suggestions? I've been exploring various Win32 functions with Easy Code / GoASM and this is the first time I've had this problem.

Thanks,
Gary


TouEnMasm


The error is at link,need a library comdlg32.lib
Fa is a musical note to play with CL

garyhess

I have commdlg.inc but not comdlg32.lib.

I just found a copy of comdlg32.lib but I'm not sure how to link it in Easy Code. Any ideas?

Vozzie

Hi,

Menu Project -> Add library files...

Or in project explorer, right click your project, choose "Add library" from the context menu.

Select the library files you need...

You should add both the include (.inc) as the library file (.lib). To add include files, repeat the steps but instead of "Add library" select "Add include" ...

garyhess

Hi Vozzie,

I don't have "Add library files..." under " Project".  I wonder what version of Easy Code you are using? I have version 1.06.0.0015 GoAsm. Screenshot attached.

I tried to add "comdlg32.lib" but I get the following message:

comdlg32.lib: File has not been added because GoLink linker ignores static library files (*.lib).

Any ideas? I'm still getting the same linker error when I try to compile.

Gary

wjr

For this, GoLink does not use the comdlg32.lib file, but instead requires the comdlg32.dll file. Under Project, "Files to link" will allow you to add this file...

garyhess

Thanks!

I started to search the web for "comdlg32.dll", but then I found out it's sitting in "c:\WINDOWS\system32".

Now it compiles and links OK.

Vozzie

Hi,

Quote from: garyhess on October 10, 2012, 03:36:02 AMI wonder what version of Easy Code you are using?

The MASM version, that's probably why. Nice to know that GoAsm doesn't need the lib but dll.  :t