Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixing the errors/warnings from using the MSVC toolchain #6

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Fixing the errors/warnings from using the MSVC toolchain #6

wants to merge 1 commit into from

Conversation

poday
Copy link

@poday poday commented Jun 18, 2012

A lot of small changes to remove compilation errors & warnings from using MSVC. Some stem from symbol collisions between "min", "max", & "polygon" while others are fixing ambiguity of struct vs class. And then there's attempting to fix the .pro file issues like using a ".lib" instead if ".a" and removing the unsupported options like "-static -static-libgcc -static-libstdc++".

@ghost ghost assigned jsadusk Jun 19, 2012
@jsadusk
Copy link
Contributor

jsadusk commented Jun 19, 2012

You need to set your local git username and email. All your commits came through as unknown Corey@Ike.

Also on linux the build fails with:
g++ -c -m64 -pipe -fopenmp -g -fPIC -Wall -W -D_REENTRANT -DQT_WEBKIT -DQT_GUI_LIB -DQT_CORE_LIB -DQT_SHARED -I/usr/share/qt4/mkspecs/linux-g++-64 -I. -I/usr/include/qt4/QtCore -I/usr/include/qt4/QtGui -I/usr/include/qt4 -I.. -I../../submodule/json-cpp/include -I../../submodule/libthing/src/main/qt-cpp/include -I../../submodule/libthing/src/main/cpp/include -I../../submodule/EzCppLog -I. -o gcoder_gantry.o gcoder_gantry.cc
gcoder_gantry.cc: In member function ‘Scalar mgl::Gantry::volumetricE(const mgl::Extruder&, const mgl::Extrusion&, Scalar, Scalar, Scalar) const’:
gcoder_gantry.cc:98:30: error: ‘UNREFERENCED_PARAMETER’ was not declared in this scope
make[1]: *** [gcoder_gantry.o] Error 1
make[1]: Leaving directory `/home/jsadusk/work/corey/src/mgl'
make: *** [sub-src-mgl-make_default] Error 2

If this is a VC++ specific directive, can you wrap it in an #ifdef WIN32?

@poday
Copy link
Author

poday commented Jun 19, 2012

yeah, I realized I didn't set the name correctly after submitting it (I
know git supports modifying comments after commit but I couldn't easily
find it).

Regarding UNREFERENCED_PARAMETER:
I tossed the define in config.h.
Basically the issue is that MSVC tosses a warning when a parameter isn't
used. The solution is to either use the parameter, remove the parameter,
or indicate that you're intentionally not using it (say because of a fixed
API). MS does define that macro but I didn't realize that I was pulling it
in & I assumed that I was using the one I had defined.
Honestly you could disable the warning or keep the macro but I wanted to
make sure that you were aware of the warnings that might not be showing up
in different toolchains.

On Tue, Jun 19, 2012 at 8:52 AM, jsadusk <
reply@reply.github.com

wrote:

You need to set your local git username and email. All your commits came
through as unknown Corey@Ike.

Also on linux the build fails with:
g++ -c -m64 -pipe -fopenmp -g -fPIC -Wall -W -D_REENTRANT -DQT_WEBKIT
-DQT_GUI_LIB -DQT_CORE_LIB -DQT_SHARED
-I/usr/share/qt4/mkspecs/linux-g++-64 -I. -I/usr/include/qt4/QtCore
-I/usr/include/qt4/QtGui -I/usr/include/qt4 -I..
-I../../submodule/json-cpp/include
-I../../submodule/libthing/src/main/qt-cpp/include
-I../../submodule/libthing/src/main/cpp/include -I../../submodule/EzCppLog
-I. -o gcoder_gantry.o gcoder_gantry.cc
gcoder_gantry.cc: In member function ‘Scalar
mgl::Gantry::volumetricE(const mgl::Extruder&, const mgl::Extrusion&,
Scalar, Scalar, Scalar) const’:
gcoder_gantry.cc:98:30: error: ‘UNREFERENCED_PARAMETER’ was not declared
in this scope
make[1]: *** [gcoder_gantry.o] Error 1
make[1]: Leaving directory `/home/jsadusk/work/corey/src/mgl'
make: *** [sub-src-mgl-make_default] Error 2

If this is a VC++ specific directive, can you wrap it in an #ifdef WIN32?


Reply to this email directly or view it on GitHub:
#6 (comment)

@jsadusk
Copy link
Contributor

jsadusk commented Jun 20, 2012

Ok, yeah we usually have a no-warnings policy, and gcc usually complains
about unused parameters as well so I'm actually surprised this one slipped
through. The gcc way to avoid warnings like this is to have the parameter
but leave it unnamed, ie
void myfunc(int)
Does this not work with msvcc?
On Jun 19, 2012 7:26 PM, "poday" <
reply@reply.github.com>
wrote:

yeah, I realized I didn't set the name correctly after submitting it (I
know git supports modifying comments after commit but I couldn't easily
find it).

Regarding UNREFERENCED_PARAMETER:
I tossed the define in config.h.
Basically the issue is that MSVC tosses a warning when a parameter isn't
used. The solution is to either use the parameter, remove the parameter,
or indicate that you're intentionally not using it (say because of a fixed
API). MS does define that macro but I didn't realize that I was pulling it
in & I assumed that I was using the one I had defined.
Honestly you could disable the warning or keep the macro but I wanted to
make sure that you were aware of the warnings that might not be showing up
in different toolchains.

On Tue, Jun 19, 2012 at 8:52 AM, jsadusk <
reply@reply.github.com

wrote:

You need to set your local git username and email. All your commits came
through as unknown Corey@Ike.

Also on linux the build fails with:
g++ -c -m64 -pipe -fopenmp -g -fPIC -Wall -W -D_REENTRANT -DQT_WEBKIT
-DQT_GUI_LIB -DQT_CORE_LIB -DQT_SHARED
-I/usr/share/qt4/mkspecs/linux-g++-64 -I. -I/usr/include/qt4/QtCore
-I/usr/include/qt4/QtGui -I/usr/include/qt4 -I..
-I../../submodule/json-cpp/include
-I../../submodule/libthing/src/main/qt-cpp/include
-I../../submodule/libthing/src/main/cpp/include
-I../../submodule/EzCppLog
-I. -o gcoder_gantry.o gcoder_gantry.cc
gcoder_gantry.cc: In member function ‘Scalar
mgl::Gantry::volumetricE(const mgl::Extruder&, const mgl::Extrusion&,
Scalar, Scalar, Scalar) const’:
gcoder_gantry.cc:98:30: error: ‘UNREFERENCED_PARAMETER’ was not declared
in this scope
make[1]: *** [gcoder_gantry.o] Error 1
make[1]: Leaving directory `/home/jsadusk/work/corey/src/mgl'
make: *** [sub-src-mgl-make_default] Error 2

If this is a VC++ specific directive, can you wrap it in an #ifdef WIN32?


Reply to this email directly or view it on GitHub:
#6 (comment)


Reply to this email directly or view it on GitHub:
#6 (comment)

@poday
Copy link
Author

poday commented Jun 20, 2012

Yeah, removing the name from the unused parameter prevents the unused
parameter warning from firing.

On Tue, Jun 19, 2012 at 6:58 PM, jsadusk <
reply@reply.github.com

wrote:

Ok, yeah we usually have a no-warnings policy, and gcc usually complains
about unused parameters as well so I'm actually surprised this one slipped
through. The gcc way to avoid warnings like this is to have the parameter
but leave it unnamed, ie
void myfunc(int)
Does this not work with msvcc?
On Jun 19, 2012 7:26 PM, "poday" <
reply@reply.github.com>
wrote:

yeah, I realized I didn't set the name correctly after submitting it (I
know git supports modifying comments after commit but I couldn't easily
find it).

Regarding UNREFERENCED_PARAMETER:
I tossed the define in config.h.
Basically the issue is that MSVC tosses a warning when a parameter isn't
used. The solution is to either use the parameter, remove the parameter,
or indicate that you're intentionally not using it (say because of a
fixed
API). MS does define that macro but I didn't realize that I was pulling
it
in & I assumed that I was using the one I had defined.
Honestly you could disable the warning or keep the macro but I wanted to
make sure that you were aware of the warnings that might not be showing
up
in different toolchains.

On Tue, Jun 19, 2012 at 8:52 AM, jsadusk <
reply@reply.github.com

wrote:

You need to set your local git username and email. All your commits
came
through as unknown Corey@Ike.

Also on linux the build fails with:
g++ -c -m64 -pipe -fopenmp -g -fPIC -Wall -W -D_REENTRANT -DQT_WEBKIT
-DQT_GUI_LIB -DQT_CORE_LIB -DQT_SHARED
-I/usr/share/qt4/mkspecs/linux-g++-64 -I. -I/usr/include/qt4/QtCore
-I/usr/include/qt4/QtGui -I/usr/include/qt4 -I..
-I../../submodule/json-cpp/include
-I../../submodule/libthing/src/main/qt-cpp/include
-I../../submodule/libthing/src/main/cpp/include
-I../../submodule/EzCppLog
-I. -o gcoder_gantry.o gcoder_gantry.cc
gcoder_gantry.cc: In member function ‘Scalar
mgl::Gantry::volumetricE(const mgl::Extruder&, const mgl::Extrusion&,
Scalar, Scalar, Scalar) const’:
gcoder_gantry.cc:98:30: error: ‘UNREFERENCED_PARAMETER’ was not
declared
in this scope
make[1]: *** [gcoder_gantry.o] Error 1
make[1]: Leaving directory `/home/jsadusk/work/corey/src/mgl'
make: *** [sub-src-mgl-make_default] Error 2

If this is a VC++ specific directive, can you wrap it in an #ifdef
WIN32?


Reply to this email directly or view it on GitHub:
#6 (comment)


Reply to this email directly or view it on GitHub:
#6 (comment)


Reply to this email directly or view it on GitHub:
#6 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants