After I click on Build solution I get the following :
1 2 3 4 5 6
deffile1.def
c:\visual studio 2010\projects\square\square\deffile1.def(1): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
c:\visual studio 2010\projects\square\square\deffile1.def(2): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
c:\visual studio 2010\projects\square\square\deffile1.def(3): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
c:\visual studio 2010\projects\square\square\deffile1.def(4): fatal error C1004: unexpected end-of-file found
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
It doesn't look like you're treating it as a def file, it looks like you're passing that .def file to the compiler. But I can't be sure without seeing how your project is built.
I have right clicked on the def file->properties->set item type to not participate in the build then I built the project again and i no longer get the above mentioned error
The problem i am getting now is when i test the square function in VBA I get the error "Can't find dll entry point ..."
VBA code :
1 2 3 4 5 6 7
Declare Function square Lib _
"C:\Visual Studio 2010\Projects\square\Debug\square.dll" (ByRef x As Double) As Double
Sub test()
MsgBox square(2)
End Sub
Also, when I open the dll with the Dependency walker I don't see the square function- In fact I see no function exports at all
Can anybody please tell me what i am doing wrong ? Thanks